rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
busyInfo = wx.BusyInfo (_("Commiting repository...")) | busyInfo = wx.BusyInfo (_("Committing repository...")) | def OnClose(self, event): """ Main window is about to be closed when the application is quitting. """ # Finish any edits in progress. from osaf.framework.blocks.Block import Block Block.finishEdits() |
Work around a widgets grid bug: ignore single shift key down to avoid beginning editing a cell """ if event.GetKeyCode() != wx.WXK_SHIFT: | Work around a widgets grid bug on Linux: ignore single shift or control key down to avoid beginning editing a cell """ keyCode = event.GetKeyCode() if (keyCode != wx.WXK_SHIFT and keyCode != wx.WXK_CONTROL): | def OnKeyDown(self, event): """ Work around a widgets grid bug: ignore single shift key down to avoid beginning editing a cell """ if event.GetKeyCode() != wx.WXK_SHIFT: event.Skip() |
skipNextRangeSelect = False def OnLeftClick (self, event): self.skipNextRangeSelect = not event.ControlDown() event.Skip() | def OnInit (self): elementDelegate = self.blockItem.elementDelegate if not elementDelegate: elementDelegate = 'osaf.framework.blocks.ControlBlocks.AttributeDelegate' mixinAClass (self, elementDelegate) """ wxTableData handles the callbacks to display the elements of the table. Setting the second argument to True cause ... | |
topLeftList = self.GetSelectionBlockTopLeft() | def OnRangeSelect(self, event): if not wx.GetApp().ignoreSynchronizeWidget: self.blockItem.selection = [] topLeftList = self.GetSelectionBlockTopLeft() for topLeft, bottomRight in zip (topLeftList, self.GetSelectionBlockBottomRight()): self.blockItem.selection.append ([topLeft[0], bottomRight[0]]) topLeftList.sort() t... | |
if item != self.blockItem.selectedItemToView: | if item is not self.blockItem.selectedItemToView: | def OnRangeSelect(self, event): if not wx.GetApp().ignoreSynchronizeWidget: self.blockItem.selection = [] topLeftList = self.GetSelectionBlockTopLeft() for topLeft, bottomRight in zip (topLeftList, self.GetSelectionBlockBottomRight()): self.blockItem.selection.append ([topLeft[0], bottomRight[0]]) topLeftList.sort() t... |
self.blockItem.postEventByName("SelectItemBroadcast", {'item':item}) | if self.skipNextRangeSelect: self.skipNextRangeSelect = False else: self.blockItem.postEventByName("SelectItemBroadcast", {'item':item}) | def OnRangeSelect(self, event): if not wx.GetApp().ignoreSynchronizeWidget: self.blockItem.selection = [] topLeftList = self.GetSelectionBlockTopLeft() for topLeft, bottomRight in zip (topLeftList, self.GetSelectionBlockBottomRight()): self.blockItem.selection.append ([topLeft[0], bottomRight[0]]) topLeftList.sort() t... |
self.editor.SetItem(box.getItem(), position, size) | self.editor.SetItem(box.getItem(), position, size, size.height) | def OnEditItem(self, box): position = box.bounds.GetPosition() size = box.bounds.GetSize() |
self.editor.SetItem(box.getItem(), textPos, textSize) | self.editor.SetItem(box.getItem(), textPos, textSize, self.smallFont.GetPointSize()) | def OnEditItem(self, box): position = self.CalcScrolledPosition(box.bounds.GetPosition()) size = box.bounds.GetSize() |
def SetItem(self, item, position, size): | def SetItem(self, item, position, size, pointSize): | def SetItem(self, item, position, size): self.item = item self.SetValue(item.displayName) |
self.SetSize(size) | newSize = wx.Size(size.width, size.height) if '__WXGTK__' in wx.PlatformInfo: newSize.height = pointSize + 8 self.SetSize(newSize) | def SetItem(self, item, position, size): self.item = item self.SetValue(item.displayName) |
else return "init_failed" | elif ret == "init_failed": return ret | def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log): # make sure workingDir is absolute, remove it, and create it workingDir = os.path.abspath(workingDir) if not os.path.exists(workingDir): os.mkdir(workingDir) os.chdir(workingDir) # remove outputDir and create it outputDir = os.path.join(wor... |
ret = Do(hardhatScript, "debug", workingDir, outputDir, cvsVintage, buildVersion, clobber, log) | if ret == "no_changes": ret = Do(hardhatScript, "debug", workingDir, outputDir, cvsVintage, buildVersion, clobber, log) | def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log): # make sure workingDir is absolute, remove it, and create it workingDir = os.path.abspath(workingDir) if not os.path.exists(workingDir): os.mkdir(workingDir) os.chdir(workingDir) # remove outputDir and create it outputDir = os.path.join(wor... |
style=wx.NO_BORDER | wx.TE_NO_VSCROLL | wx.TE_MULTILINE | wx.TE_AUTO_SCROLL | style = wx.NO_BORDER if '__WXMAC__' in wx.PlatformInfo: style |= wx.TE_MULTILINE style |= wx.TE_NO_VSCROLL elif '__WXGTK__' in wx.PlatformInfo: style |= wx.TE_MULTILINE style |= wx.TE_NO_VSCROLL else: style |= wx.TE_PROCESS_ENTER | def __init__(self, *arguments, **keywords): # Windows and Mac add an extra vertical scrollbar for TE_MULTILINE, # and GTK does not. Further, if GTK is not multiline, then the single # line mode looks really wonky with a huge cursor. The undocumented # flag TE_NO_VSCROLL may solve the former problem, introducing anothe... |
event.Skip() | def OnStaticClick(self, event): editControl = self.editControl editControl.SetFocus() # if we're currently displaying the "sample text", select # the entire field, otherwise position the insertion appropriately # The AE should provide a SampleText api for this, # or better yet, encapsulate the concept of SampleText in... | |
return "| %d | %s | %s |" % (self.errorCode, self.errorString, self.errorDate.strftime()) | return "| %d | %s | %s |" % (self.errorCode, self.errorString, str(self.errorDate)) | def __str__(self): if self.isStale(): return super(MailDeliveryError, self).__str__() # Stale items shouldn't go through the code below |
result += "<td valign=top>%s</td>\n" % (attribute.initialValue) | result += "<td valign=top>%s</td>\n" % (attribute.initialValue,) | def RenderItem(repoView, item): result = "" # For Kinds, display their attributes (except for the internal ones # like notFoundAttributes): isKind = item.isItemOf(repoView.findPath("//Schema/Core/Kind")) isBlock = item.isItemOf(repoView.findPath("//parcels/osaf/framework/blocks/Block")) path = "<a href=%s>[top]</a>... |
if reminder.isDeleted(): logger.critical("Found deleted reminder on %r %s at %s", remindable, remindable, remindable.startTime) | def processReminder((reminderTime, remindable, reminder)): logger.debug("*** now-ing %s due to %s", remindable, reminder) remindable.itsItem.triageStatus = TriageEnum.now remindable.itsItem.setTriageStatusChanged(when=reminderTime) if reminder.isDeleted(): logger.critical("Found deleted reminder on %r %s at %s", remind... | |
itemName = 'ContactTableView' else: itemName = 'AllTableView' | itemName = 'ContactsView' else: itemName = 'AllView' | def onNewEvent (self, notification): # Create a new Content Item # Triggered from "File | New Item" menu, for any of the item kinds. event = notification.event newItem = event.kindParameter.newItem (None, None) newItem.InitOutgoingAttributes () self.RepositoryCommitWithStatus () |
self.Bind(wx.EVT_IDLE, self.OnIdle) self.Bind(wx.EVT_MENU, self.OnCommand, id=-1) self.Bind(wx.EVT_TOOL, self.OnCommand, id=-1) self.Bind(wx.EVT_UPDATE_UI, self.OnCommand, id=-1) self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroyWindow, id=-1) self.Bind(wx.EVT_SHOW, self.OnShow, id=-1) self.Bind(wx.EVT_KEY_DOWN, self.OnKe... | def _displayHook(obj): if obj is not None: print repr(obj) | |
try: return s.replace("&","&").replace("<","<").replace(">",">") except Exception, e: print e, s, type(s) raise | return s.replace("&","&").replace("<","<").replace(">",">") | def clean(s): s = unicode(s) try: return s.replace("&","&").replace("<","<").replace(">",">") except Exception, e: print e, s, type(s) raise |
nextKey = self.nextKey(key) | def clear(self): """ Remove all references from this ref collection. """ | |
key = nextKey | key = self.firstKey() | def clear(self): """ Remove all references from this ref collection. """ |
webbrowser.open('http://cosmo-demo.osafoundation.org/') | webbrowser.open('http://cosmo-demo.osafoundation.org/chandler06_signup.html') | def OnSignUpWebDAV(self, evt): webbrowser.open('http://cosmo-demo.osafoundation.org/') |
if changesInCVS(chanDir, workingDir, cvsVintage, log): log.write("Changes in CVS, do an install\n") | (makeInstall, makeDistribution) = changesInCVS(chanDir, workingDir, cvsVintage, log, 'Makefile') if makeInstall: log.write("Changes in CVS require install\n") | def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log): global buildenv, changes try: buildenv = hardhatlib.defaults buildenv['root'] = workingDir buildenv['hardhatroot'] = whereAmI hardhatlib.init(buildenv) except hardhatlib.HardHatMissingCompilerError: print "Could not locate compiler. Exiti... |
else: log.write("No changes, install skipped\n") | if not makeInstall and not makeDistribution: log.write("No changes\n") | def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log): global buildenv, changes try: buildenv = hardhatlib.defaults buildenv['root'] = workingDir buildenv['hardhatroot'] = whereAmI hardhatlib.init(buildenv) except hardhatlib.HardHatMissingCompilerError: print "Could not locate compiler. Exiti... |
def changesInCVS(moduleDir, workingDir, cvsVintage, log): | def changesInCVS(moduleDir, workingDir, cvsVintage, log, filename): | def changesInCVS(moduleDir, workingDir, cvsVintage, log): changesAtAll = False |
if NeedsUpdate(outputList): | (filenameChanged, changesAtAll) = NeedsUpdate(outputList, filename) if changesAtAll: | def changesInCVS(moduleDir, workingDir, cvsVintage, log): changesAtAll = False |
changesAtAll = True | def changesInCVS(moduleDir, workingDir, cvsVintage, log): changesAtAll = False | |
return changesAtAll | return (filenameChanged, changesAtAll) | def changesInCVS(moduleDir, workingDir, cvsVintage, log): changesAtAll = False |
print "Doing make " + dbgStr + " install\n" log.write("Doing make " + dbgStr + " install\n") | print "Doing make " + dbgStr + " clean install\n" log.write("Doing make " + dbgStr + " clean install\n") | def doInstall(buildmode, workingDir, log): |
def NeedsUpdate(outputList): | def NeedsUpdate(outputList, filename): """ @return: Returns a tuple of booleans. The first is true if filename is empty and there were some changes or the filename was changed. The second is true if there were any changes. """ | def NeedsUpdate(outputList): for line in outputList: if line.lower().find("ide scripts") != -1: # this hack is for skipping some Mac-specific files that # under Windows always appear to be needing an update continue if line.lower().find("xercessamples") != -1: # same type of hack as above continue if line[0] == "U": pr... |
return True | return ((not filename or line[2:-1] == filename), True) | def NeedsUpdate(outputList): for line in outputList: if line.lower().find("ide scripts") != -1: # this hack is for skipping some Mac-specific files that # under Windows always appear to be needing an update continue if line.lower().find("xercessamples") != -1: # same type of hack as above continue if line[0] == "U": pr... |
return True return False | return ((not filename or line[2:-1] == filename), True) return (False, False) | def NeedsUpdate(outputList): for line in outputList: if line.lower().find("ide scripts") != -1: # this hack is for skipping some Mac-specific files that # under Windows always appear to be needing an update continue if line.lower().find("xercessamples") != -1: # same type of hack as above continue if line[0] == "U": pr... |
def getInstance (typeName, item, attributeName, readOnly, presentationStyle): | def getInstance(typeName, cardinality, item, attributeName, readOnly, presentationStyle): | def getInstance (typeName, item, attributeName, readOnly, presentationStyle): """ Get a new unshared instance of the Attribute Editor for this type (and optionally, format). These unshared instances are used in the detail view; we don't cache them. @param typeName: The name of the type of the attribute to be edited, ... |
optionally including "+" and a format string; see L{getAEClass} for explanation of how the format string is used. | optionally including "+"-separated parameters; see L{getAEClass} for explanation of how the mechanism works. | def getInstance (typeName, item, attributeName, readOnly, presentationStyle): """ Get a new unshared instance of the Attribute Editor for this type (and optionally, format). These unshared instances are used in the detail view; we don't cache them. @param typeName: The name of the type of the attribute to be edited, ... |
aeClass = getAEClass(typeName, readOnly, format) | aeClass = getAEClass(typeName, cardinality, readOnly, format) | def getInstance (typeName, item, attributeName, readOnly, presentationStyle): """ Get a new unshared instance of the Attribute Editor for this type (and optionally, format). These unshared instances are used in the detail view; we don't cache them. @param typeName: The name of the type of the attribute to be edited, ... |
def getAEClass (typeName, readOnly=False, format=None): | def getAEClass(typeName, cardinality='single', readOnly=False, format=None): | def getAEClass (typeName, readOnly=False, format=None): """ Decide which attribute editor class to use for this type. We'll try several ways to find an appropriate editor: - If we're readOnly, try "+readOnly" before we try without it. - If we have a format, try "+format" before we try without it. - If those fail, just... |
We'll try several ways to find an appropriate editor: - If we're readOnly, try "+readOnly" before we try without it. - If we have a format, try "+format" before we try without it. - If those fail, just try the type itself. - Failing that, use _default. | We'll try several ways to find an appropriate editor, considering cardinality, readonlyness, and format, if any are provided, before falling back to not considering them. As a last resort, we'll use the '_default' one. | def getAEClass (typeName, readOnly=False, format=None): """ Decide which attribute editor class to use for this type. We'll try several ways to find an appropriate editor: - If we're readOnly, try "+readOnly" before we try without it. - If we have a format, try "+format" before we try without it. - If those fail, just... |
if format is not None: if readOnly: yield "%s+%s+readOnly" % (typeName, format) yield "%s+%s" % (typeName, format) if readOnly: yield "%s+readOnly" % typeName yield typeName | formatList = format is not None and ('+%s' % format, '',) or ('',) readOnlyList = readOnly and ('+readOnly', '',) or ('',) cardinalityList = cardinality != 'single' \ and ('+%s' % cardinality, '',) or ('',) for c in cardinalityList: for f in formatList: for r in readOnlyList: yield "%s%s%s%s" % (typeName, c, f, r) | def generateEditorTags(): if format is not None: if readOnly: yield "%s+%s+readOnly" % (typeName, format) yield "%s+%s" % (typeName, format) if readOnly: yield "%s+readOnly" % typeName yield typeName logger.warn("AttributeEditors.getAEClass: using _default for %s/%s", typeName, format) yield "_default" |
doAutoCompletion = False | doAutoCompletion = bigAutocompletionSwitch \ and getattr(type(self), 'generateCompletionMatches', None) is not None | def CreateControl(self, forEditing, readOnly, parentWidget, id, parentBlock, font): # logger.debug("StringAE.CreateControl") # We'll use a DragAndDropTextCtrl, unless we're an edit-in-place # control in 'edit' mode. useStaticText = self.EditInPlace() and not forEditing # We'll do autocompletion if someone implements ... |
control = event.GetEventObject() ateLastKey = getattr(control, 'ateLastKey', False) if not ateLastKey: matchGenerator = getattr(type(self), 'generateCompletionMatches', None) if False: controlValue = self.GetControlValue(control) insertionPoint = control.GetInsertionPoint() (start, end) = self.findCompletionRange(cont... | if bigAutocompletionSwitch: control = event.GetEventObject() ateLastKey = getattr(control, 'ateLastKey', False) if not ateLastKey: matchGenerator = getattr(type(self), 'generateCompletionMatches', None) if matchGenerator is not None: controlValue = self.GetControlValue(control) insertionPoint = control.GetInsertionPoin... | def onKeyUp(self, event): """ Handle a Key pressed in the control, part two: at 'key-up', the key's already been processed into the control; we can react to it, maybe by doing autocompletion. """ control = event.GetEventObject() ateLastKey = getattr(control, 'ateLastKey', False) if not ateLastKey: matchGenerator = geta... |
if theValue is None: theValue = u"" else: theValue = unicode(theValue) | def GetAttributeValue(self, item, attributeName): """ Get the attribute's current value """ try: theValue = getattr(item, attributeName) except AttributeError: valueString = u"" else: if theValue is None: theValue = u"" else: theValue = unicode(theValue) try: cardinality = item.getAttributeAspect (attributeName, "cardi... | |
if cardinality == "list": valueString = u", ".join([part.getItemDisplayName() for part in theValue]) else: valueString = unicode(theValue) | if cardinality == "single": if theValue is None: valueString = u"" else: valueString = unicode(theValue) elif cardinality == "list" or cardinality == "set": valueString = _(u", ").join([unicode(part) for part in theValue]) | def GetAttributeValue(self, item, attributeName): """ Get the attribute's current value """ try: theValue = getattr(item, attributeName) except AttributeError: valueString = u"" else: if theValue is None: theValue = u"" else: theValue = unicode(theValue) try: cardinality = item.getAttributeAspect (attributeName, "cardi... |
try: cardinality = item.getAttributeAspect (attributeName, "cardinality") except AttributeError: cardinality = "single" if cardinality == "single": if self.GetAttributeValue(item, attributeName) != valueString: if self.allowEmpty() or len(valueString.strip()) > 0: setattr (item, attributeName, valueString) self.Att... | if self.GetAttributeValue(item, attributeName) == valueString: return if self.allowEmpty() or len(valueString.strip()) > 0: try: cardinality = item.getAttributeAspect (attributeName, "cardinality") except AttributeError: cardinality = "single" if cardinality == "single": value = valueString elif cardinality == "li... | def SetAttributeValue(self, item, attributeName, valueString): try: cardinality = item.getAttributeAspect (attributeName, "cardinality") except AttributeError: cardinality = "single" if cardinality == "single": if self.GetAttributeValue(item, attributeName) != valueString: # The value changed if self.allowEmpty() or le... |
buildOptions.append("FINAL=0") | buildOptions.append("--debug") | def build(buildenv): version = buildenv['version'] if buildenv['os'] in ('osx', 'posix'): # Create the build directory buildDir = os.path.abspath("build_%s" % version) if os.access(buildDir, os.F_OK): hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Temporary build directory exists: " + buildDir... |
if attrName != "body": | if attrName == "body": value = unicode(value) else: | def _importElement(self, element, item=None, changes=None, previousView=None, updateCallback=None): |
if value is None: | if value is None or value is NoneRef: | def _attach(self, item, other): value = other._references.get(self.otherName) if value is None: if self.ref is not None: self.ref.attach(item, self.attrName, other, self.otherName, self.otherCard) else: value = ItemRef(item, self.attrName, other, self.otherName, self.otherCard) self.valueDict.__setitem__(self.refName... |
self.GetMonthControl.Enable(enable) self.GetYearControl.Enable(enable) | self.GetMonthControl().Enable(enable) self.GetYearControl().Enable(enable) | def Enable(self, enable): # XXX do we really need to even implement this function? # shouldn't child widgets hide themselves? if not super(PyMiniCalendar, self).Enable(enable): return False |
self.GetMonthControl.Show(show) self.GetYearControl.Show(show) | self.GetMonthControl().Show(show) self.GetYearControl().Show(show) | def Show(self, show): # XXX do we really need to even implement this function? # shouldn't child widgets hide themselves? if not super(PyMiniCalendar, self).Show(show): return False |
raise | raise SaveValueError, (item, name, e) | def _value(self, item, name, value, version, flags, withSchema, attribute): |
if not printer.Print(self.frame, printout, True): wx.MessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wx.OK) | printSuccess = printer.Print(self.frame, printout, True) if not printSuccess: if printer.GetLastError() != wx.PRINTER_CANCELLED: wx.MessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wx.OK) | def OnPrint(self): data = wx.PrintDialogData(self.printData) data.SetToPage(1) printer = wx.Printer(data) printout = CanvasPrintout(self.canvas) if not printer.Print(self.frame, printout, True): wx.MessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wx.OK) else: ... |
if installTargetFile: installSource = os.path.join(buildenv['root'], installTargetFile) installTarget = os.path.join(buildenv['outputdir'], installTargetFile) if os.path.exists(installTarget): os.remove(installTarget) if os.path.exists(installSource): os.rename(installSource, installTarget) if buildenv['version'] ==... | def distribute(buildenv): _createVersionFile(buildenv) buildVersionShort = \ hardhatutil.RemovePunctuation(buildenv['buildVersion']) # When the build version string is based on one of our CVS tags # (which usually begin with "CHANDLER_") let's remove the "CHANDLER_" # prefix from the string so it doesn't end up in t... | |
if installTargetFile: installSource = os.path.join(buildenv['root'], installTargetFile) installTarget = os.path.join(buildenv['outputdir'], installTargetFile) if os.path.exists(installTarget): os.remove(installTarget) if os.path.exists(installSource): os.rename(installSource, installTarget) if buildenv['version'] ==... | def distribute(buildenv): _createVersionFile(buildenv) buildVersionShort = \ hardhatutil.RemovePunctuation(buildenv['buildVersion']) # When the build version string is based on one of our CVS tags # (which usually begin with "CHANDLER_") let's remove the "CHANDLER_" # prefix from the string so it doesn't end up in t... | |
doCopyLog("***Error during tests***", workingDir, logPath, log) | log.write("***Error during functional tests***\n") log.write("Exception:\n") log.write(str(e) + "\n") | def doFunctionalTests(releaseMode, workingDir, log): hardhatlib.setupEnvironment(buildenv) chandlerDir = os.path.join(workingDir, "chandler") if buildenv['os'] == 'win': runChandler = 'RunChandler.bat' else: runChandler = 'RunChandler' if releaseMode == 'debug': runChandler = os.path.join(chandlerDir, 'debug', runCh... |
doCopyLog("Tests successful", workingDir, logPath, log) | log.write("Functional tests passed") | def doFunctionalTests(releaseMode, workingDir, log): hardhatlib.setupEnvironment(buildenv) chandlerDir = os.path.join(workingDir, "chandler") if buildenv['os'] == 'win': runChandler = 'RunChandler.bat' else: runChandler = 'RunChandler' if releaseMode == 'debug': runChandler = os.path.join(chandlerDir, 'debug', runCh... |
print "perf testing error", e print "exception raised: ", e doCopyLog("***Error during tests***", workingDir, logPath, log) | print "perf tests failed", e log.write("***Error during performance tests***\n") log.write("Exception:\n") log.write(str(e) + "\n") | def doPerformanceTests(hardhatScript, mode, workingDir, outputDir, buildVersion, log): hardhatlib.setupEnvironment(buildenv) chandlerDir = os.path.join(workingDir, "chandler") testDir = os.path.join(chandlerDir, 'tools', 'QATestScripts', 'Performance') if buildenv['version'] == 'debug': python = buildenv['python_... |
doCopyLog("Tests successful", workingDir, logPath, log) | log.write("Performance tests passed") | def doPerformanceTests(hardhatScript, mode, workingDir, outputDir, buildVersion, log): hardhatlib.setupEnvironment(buildenv) chandlerDir = os.path.join(workingDir, "chandler") testDir = os.path.join(chandlerDir, 'tools', 'QATestScripts', 'Performance') if buildenv['version'] == 'debug': python = buildenv['python_... |
doCopyLog("***Error during distribution building process*** ", workingDir, logPath, log) | doCopyLog("***Error during distribution building*** ", workingDir, logPath, log) | def doDistribution(releaseMode, workingDir, log, outputDir, buildVersion, buildVersionEscaped, hardhatScript): # Create end-user, developer distributions print "Making distribution files for " + releaseMode log.write(separator) log.write("Making distribution files for " + releaseMode + "\n") if releaseMode == "debug"... |
targets = ['install', 'strip'] | targets = ['install', 'strip', 'purge'] | def doInstall(buildmode, workingDir, log, cleanFirst=False): # for our purposes, we do not really do a build # we will update chandler from SVN, and grab new tarballs when they appear if buildmode == "debug": dbgStr = "DEBUG=1" else: dbgStr = "" if cleanFirst: clean = " clean " else: clean = " " moduleDir = os.path.j... |
log.write("No build log!\n") | log.write("Exception:\n") log.write(str(e) + "\n") | def doInstall(buildmode, workingDir, log, cleanFirst=False): # for our purposes, we do not really do a build # we will update chandler from SVN, and grab new tarballs when they appear if buildmode == "debug": dbgStr = "DEBUG=1" else: dbgStr = "" if cleanFirst: clean = " clean " else: clean = " " moduleDir = os.path.j... |
print "Unit tests failed" log.write("Unit tests failed\n") | print "Tests failed" log.write("Tests failed\n") | def main(): global buildscriptFile, buildDir, fromAddr, mailtoAddr, alertAddr, adminAddr, defaultDomain, defaultRsyncServer # this is a sane default - the "true" value is pulled from the module being built treeName = "Chandler" parser = OptionParser(usage="%prog [options] buildName", version="%prog 1.2") parser.add_o... |
default="buildreport@osafoundation.org", help="Where to mail script reports\n" " [default] buildreport@osafoundation.org") | default=mailtoAddr, help="Where to mail script reports\n" " [default] " + mailtoAddr + defaultDomain) | def main(): global buildscriptFile parser = OptionParser(usage="%prog [options] buildName", version="%prog 1.2") parser.add_option("-t", "--toAddr", action="store", type="string", dest="toAddr", default="buildreport@osafoundation.org", help="Where to mail script reports\n" " [default] buildreport@osafoundation.org") p... |
default="buildman@osafoundation.org", help="E-mail to notify on build errors \n" " [default] buildman@osafoundation.org") | default=alertAddr, help="E-mail to notify on build errors \n" " [default] " + alertAddr + defaultDomain) | def main(): global buildscriptFile parser = OptionParser(usage="%prog [options] buildName", version="%prog 1.2") parser.add_option("-t", "--toAddr", action="store", type="string", dest="toAddr", default="buildreport@osafoundation.org", help="Where to mail script reports\n" " [default] buildreport@osafoundation.org") p... |
SendMail(fromAddr, options.toAddr, startTime, buildName, "building", | SendMail(fromAddr, mailtoAddr, startTime, buildName, "building", | def main(): global buildscriptFile parser = OptionParser(usage="%prog [options] buildName", version="%prog 1.2") parser.add_option("-t", "--toAddr", action="store", type="string", dest="toAddr", default="buildreport@osafoundation.org", help="Where to mail script reports\n" " [default] buildreport@osafoundation.org") p... |
SendMail(fromAddr, options.alertAddr, startTime, buildName, "The build failed", | SendMail(fromAddr, alertAddr, startTime, buildName, "The build failed", | def main(): global buildscriptFile parser = OptionParser(usage="%prog [options] buildName", version="%prog 1.2") parser.add_option("-t", "--toAddr", action="store", type="string", dest="toAddr", default="buildreport@osafoundation.org", help="Where to mail script reports\n" " [default] buildreport@osafoundation.org") p... |
SendMail(fromAddr, options.alertAddr, startTime, buildName, "Unit tests failed", | SendMail(fromAddr, alertAddr, startTime, buildName, "Unit tests failed", | def main(): global buildscriptFile parser = OptionParser(usage="%prog [options] buildName", version="%prog 1.2") parser.add_option("-t", "--toAddr", action="store", type="string", dest="toAddr", default="buildreport@osafoundation.org", help="Where to mail script reports\n" " [default] buildreport@osafoundation.org") p... |
SendMail(fromAddr, options.toAddr, startTime, buildName, status, treeName, | SendMail(fromAddr, mailtoAddr, startTime, buildName, status, treeName, | def main(): global buildscriptFile parser = OptionParser(usage="%prog [options] buildName", version="%prog 1.2") parser.add_option("-t", "--toAddr", action="store", type="string", dest="toAddr", default="buildreport@osafoundation.org", help="Where to mail script reports\n" " [default] buildreport@osafoundation.org") p... |
msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromAddr, toAddr)) msg = msg + "tinderbox: tree: " + treeName + "\n" msg = msg + "tinderbox: buildname: " + buildName + "\n" msg = msg + "tinderbox: starttime: " + startTime + "\n" msg = msg + "tinderbox: timenow: " + nowTime + "\n" msg = msg + "tinde... | msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromAddr, toAddr)) msg += "Subject: " + status + " from " + buildName + "\n" msg += "tinderbox: tree: " + treeName + "\n" msg += "tinderbox: buildname: " + buildName + "\n" msg += "tinderbox: starttime: " + startTime + "\n" msg += "tinderbox: timenow: " + nowTime + "\n" msg += "t... | def SendMail(fromAddr, toAddr, startTime, buildName, status, treeName, logContents): nowTime = str(int(time.time())) msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromAddr, toAddr)) msg = msg + "tinderbox: tree: " + treeName + "\n" msg = msg + "tinderbox: buildname: " + buildName + "\n" msg = msg + "tinde... |
msg = msg + logContents | msg += logContents | def SendMail(fromAddr, toAddr, startTime, buildName, status, treeName, logContents): nowTime = str(int(time.time())) msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromAddr, toAddr)) msg = msg + "tinderbox: tree: " + treeName + "\n" msg = msg + "tinderbox: buildname: " + buildName + "\n" msg = msg + "tinde... |
subdir = os.path.join(dir, subdir) | def RotateDirectories(dir): """Removes all but the 3 newest subdirectories from the given directory; assumes the directories are named with timestamps (numbers) because it uses normal sorting to determine the order.""" dirs = os.listdir(dir) dirs.sort() for subdir in dirs[:-3]: # print " subdir = ", subdir if os.path... | |
hardhatutil.rmdirRecursive(os.path.join(dir, subdir)) | hardhatutil.rmdirRecursive(subdir) list2 = os.listdir(buildDir) for fileName in list2: fileName = os.path.join(buildDir, fileName) if os.path.isdir(fileName): continue elif fileName.find('Chandler_') != -1: os.remove(fileName) | def RotateDirectories(dir): """Removes all but the 3 newest subdirectories from the given directory; assumes the directories are named with timestamps (numbers) because it uses normal sorting to determine the order.""" dirs = os.listdir(dir) dirs.sort() for subdir in dirs[:-3]: # print " subdir = ", subdir if os.path... |
'release' : ["Pre-built release directory", "If you are using CVS to check out Chandler you can either build everything yourself or you can download this pre-compiled 'release' directory. Download, unpack, and place the contained 'release' directory next to your 'Chandler' directory."], 'debug' : ["Pre-built debug dir... | def RotateDirectories(dir): """Removes all but the 3 newest subdirectories from the given directory; assumes the directories are named with timestamps (numbers) because it uses normal sorting to determine the order.""" dirs = os.listdir(dir) dirs.sort() for subdir in dirs[:-3]: # print " subdir = ", subdir if os.path... | |
btn = wx.Button( self, -1, "Resize", (10, 190) ) | btn = wx.Button( self, -1, "Resize", (10, 200) ) | def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log |
btn = wx.Button( self, -1, "Add Bitmap Item", (110, 190) ) self.Bind( wx.EVT_BUTTON, self.OnAddBitmapItemButton, btn ) | btn = wx.Button( self, -1, "Enable", (110, 200) ) self.Bind( wx.EVT_BUTTON, self.OnTestEnableButton, btn ) | def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log |
btn = wx.Button( self, -1, "Delete Selected Item", (275, 190) ) self.Bind( wx.EVT_BUTTON, self.OnTestDeleteButton, btn ) | btn = wx.Button( self, -1, "Add Bitmap Item", (10, 250) ) self.Bind( wx.EVT_BUTTON, self.OnTestAddBitmapItemButton, btn ) btn = wx.Button( self, -1, "Delete Selected Item", (175, 250) ) self.Bind( wx.EVT_BUTTON, self.OnTestDeleteItemButton, btn ) | def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log |
def OnAddBitmapItemButton( self, event ): | def OnTestEnableButton(self, event): curEnabled = self.ch1.IsEnabled() curEnabled = not curEnabled self.ch1.Enable( curEnabled ) self.ch2.Enable( curEnabled ) self.l0.SetLabel( "enabled (%d)" %(curEnabled) ) def OnTestAddBitmapItemButton( self, event ): | def OnAddBitmapItemButton( self, event ): ch = self.ch2 itemCount = ch.GetItemCount() ch.AppendItem( "", wx.colheader.COLUMNHEADER_JUST_Center, 40, 0, 0, 1 ) testBmp = images.getTest2Bitmap() ch.SetBitmapRef( itemCount, testBmp ) ch.SetSelectedItemIndex( itemCount ) ch.ResizeToFit() self.l0.SetLabel( "added bitmap item... |
def OnTestDeleteButton( self, event ): | def OnTestDeleteItemButton( self, event ): | def OnTestDeleteButton( self, event ): ch = self.ch1 itemIndex = ch.GetSelectedItemIndex() if (itemIndex >= 0): ch.DeleteItem( itemIndex ) self.l0.SetLabel( "deleted item (%d) from (%d)" %(itemIndex, ch.GetId()) ) else: self.l0.SetLabel( "header (%d): no item selected" %(ch.GetId()) ) |
if newItem.date_parsed: | if getattr(newItem, 'date_parsed', None): | def _DoItems(self, items): # make children |
if canvasItem._item == self.item: allDayCanvas.widget.OnSelectItem(canvasItem.GetItem()) | if canvasItem.item == self.item: allDayCanvas.widget.OnSelectItem(canvasItem.item) | def SelectItem(self): """ Select the item in chandler (summary view or calendar view or sidebar selection) """ if not self.isCollection: # if not in the Calendar view (select in the summary view) # check the button state button = App_ns.ApplicationBarEventButton buttonState = button.widget.IsToggled() if not buttonStat... |
if canvasItem._item == self.item: timedCanvas.widget.OnSelectItem(canvasItem.GetItem()) | if canvasItem.item == self.item: timedCanvas.widget.OnSelectItem(canvasItem.item) | def SelectItem(self): """ Select the item in chandler (summary view or calendar view or sidebar selection) """ if not self.isCollection: # if not in the Calendar view (select in the summary view) # check the button state button = App_ns.ApplicationBarEventButton buttonState = button.widget.IsToggled() if not buttonStat... |
TestItem = UITestItem(canvasItem._item, self.logger) | TestItem = UITestItem(canvasItem.item, self.logger) | def DoubleClickInCalView(self, x=100, y=100, gotoTestDate=True): """ Emulate a double click in the calendar a the given position @type x : int @param x : the x coordinate @type y : int @param y : the y coordinate """ if self.state == "CalendarView": # move to a known date, otherwise we'll just be operating # on whatev... |
allEvents = pim_ns.events | def recurringEventsInRange(view, start, end, filterColl = None, dayItems = True, timedItems = True): """ Yield all recurring events between start and end that appear in filterColl. """ tzprefs = schema.ns('osaf.app', view).TimezonePrefs if tzprefs.showUI: startIndex = 'effectiveStart' endIndex = 'recurrenceEnd' else... | |
allEvents, end, 'recurrenceEnd', endIndex, | masterEvents, end, 'recurrenceEnd', endIndex, | def recurringEventsInRange(view, start, end, filterColl = None, dayItems = True, timedItems = True): """ Yield all recurring events between start and end that appear in filterColl. """ tzprefs = schema.ns('osaf.app', view).TimezonePrefs if tzprefs.showUI: startIndex = 'effectiveStart' endIndex = 'recurrenceEnd' else... |
assert thisLine, "Should have text if we're wrapping" dc.DrawText(thisLine, rectX, y) thisLine = u'' | if thisLine: dc.DrawText(thisLine, rectX, y) thisLine = u'' | def DrawWrappedText(dc, text, rect, measurements=None): """ Simple wordwrap - draws the text into the current DC returns the height of the text that was written measurements is a FontMeasurements object as returned by Styles.getMeasurements() """ if measurements is None: measurements = Styles.getMeasurements(dc.GetF... |
return base64.encodestring(viewStr) | viewStr = string.replace(viewStr, ' ', '--b--') return viewStr | def EncodeObjectList(self, objectList): viewStr = cPickle.dumps(objectList) return base64.encodestring(viewStr) |
pickledStr = base64.decodestring(objectStr) objectList = cPickle.loads(pickledStr) | mappedResponse = objectStr.encode('ascii') mappedResponse = self.FixExtraBlanks(mappedResponse) objectList = cPickle.loads(mappedResponse) return objectList | def DecodeObjectList(self, objectStr): pickledStr = base64.decodestring(objectStr) objectList = cPickle.loads(pickledStr) |
wx.OPEN | wx.CHANGE_DIR | wx.HIDE_READONLY) | wx.OPEN | wx.HIDE_READONLY) | def onImportIcalendarEvent(self, event): # triggered from "File | Import/Export" menu wildcard = "iCalendar files|*.ics|All files (*.*)|*.*" dlg = wx.FileDialog(wx.GetApp().mainFrame, "Choose a file to import", "", "import.ics", wildcard, wx.OPEN | wx.CHANGE_DIR | wx.HIDE_READONLY) if dlg.ShowModal() == wx.ID_OK: (dir,... |
parent = self.getParent(view) | if self.parentName: parent = ModuleMaker(self.parentName)._find_schema_item(view) if parent is None: return None else: parent = self.getParent(view) | def _find_schema_item(self,view): if self.moduleName.startswith('//'): # kludge to support putting Parcel + Manager in //Schema/Core return view.findPath(self.moduleName) parent = self.getParent(view) item = parent.getItemChild(self.name) from application.Parcel import Parcel if isinstance(item,Parcel): return item |
return view._schema_cache[moduleName] | ob = view._schema_cache[moduleName] if ob is None: raise RuntimeError( "Recursive schema item initialization: "+moduleName ) return ob | def parcel_for_module(moduleName, view=None): """Return the Parcel for the named module If the named module has a ``__parcel__`` attribute, its value will be used to redirect to another parcel. If the module does not have a ``__parcel__``, then a new parcel will be created, cached, and returned. If the module has a `... |
u'sharedURL', u'sharedUUID', u'collectionOwner' u'itemCollectionResults']: | u'sharedURL', u'sharedUUID', u'collectionOwner', u'itemCollectionResults', u'itemCollectionInclusions', u'itemCollectionInclusions' u'itemCollectionExclusions']: | def syncToServer(dav, item): from Dav import DAV url = unicode(dav.url) # set them here, even though we have to set them again later item.sharedVersion = item._version kind = item.itsKind # build a giant property string and then do a PROPPATCH # we don't ever want to actually change the UUID value on the server # s... |
_(u"Save Settings"), "", "chandler.ini", wildcard, wx.SAVE) | _(u"Save Settings"), "", "chandler.ini", wildcard, wx.SAVE|wx.OVERWRITE_PROMPT) | def onSaveSettingsEvent(self, event): # triggered from "Test | Save Settings" Menu |
except error.ConnectionDone, err: | except Exception, err: | def checkAccess(host, port=80, useSSL=False, username=None, password=None, path=None, repositoryView=None): """ Check the permissions for a webdav account by reading and writing to that server. Returns a tuple (result code, reason), where result code indicates the level of permissions: CANT_CONNECT, NO_ACCESS, READ_ON... |
triesLeft = 10 | def checkAccess(host, port=80, useSSL=False, username=None, password=None, path=None, repositoryView=None): """ Check the permissions for a webdav account by reading and writing to that server. Returns a tuple (result code, reason), where result code indicates the level of permissions: CANT_CONNECT, NO_ACCESS, READ_ON... | |
triesLeft -= 1 if triesLeft == 0: return -1 testFilename = chandlerdb.util.c.UUID() | testFilename = unicode(chandlerdb.util.c.UUID()) | def checkAccess(host, port=80, useSSL=False, username=None, password=None, path=None, repositoryView=None): """ Check the permissions for a webdav account by reading and writing to that server. Returns a tuple (result code, reason), where result code indicates the level of permissions: CANT_CONNECT, NO_ACCESS, READ_ON... |
for range in self.blockItem.selection: if range [2]: if firstSelectedRow is None: firstSelectedRow = range[0] self.SelectBlock (range[0], 0, range[1], newColumns, True) else: for row in xrange (range[0], range[1] + 1): self.DeselectRow (row) | if len (self.blockItem.contents) > 0: for range in self.blockItem.selection: if range [2]: if firstSelectedRow is None: firstSelectedRow = range[0] self.SelectBlock (range[0], 0, range[1], newColumns, True) else: for row in xrange (range[0], range[1] + 1): self.DeselectRow (row) | def wxSynchronizeWidget(self): """ A Grid can't easily redisplay its contents, so we write the following helper function to readjust everything after the contents change """ #Trim/extend the control's rows and update all values |
if __exp.match(emailAddress) is not None: | if re.match("\w+((-\w+)|(\.\w+)|(\_\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]{2,5}", emailAddress) is not None: | def isValidEmailAddress(emailAddress): """ This method tests an email address for valid syntax as defined RFC 822 ***Warning*** This method will return False if Name and Address is past i.e. John Jones <john@jones.com>. The method only validates against the actual email address i.e. john@jones.com @param emailAddress... |
self.publisher = mine | self.publisher = publisher | def __init__(self, parent, title, size=wx.DefaultSize, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE, resources=None, view=None, url=None, name=None, modal=True, immediate=False, mine=None, publisher=None): |
block.synchronizeWidget(useHints=True) | if block is not None: block.synchronizeWidget(useHints=True) | def propagateAsynchronousNotifications(self): |
earliest = nextRecurrenceID continue | if before is not None and \ datetimeOp(calculated.startTime, '>', before): return None else: earliest = nextRecurrenceID continue | def expired(reminder): nextTime = reminder.getNextReminderTimeFor(event) return (nextTime is not None and datetimeOp(nextTime, '<=', now)) |
installTargetFile = '%s.exe' % installTargetFile installSource = os.path.join(buildenv['root'], installTargetFile) installTarget = os.path.join(buildenv['outputdir'], installTargetFile) | installSource = os.path.join(buildenv['root'], installTargetFile) installTarget = os.path.join(buildenv['outputdir'], installTargetFile) | def distribute(buildenv): _createVersionFile(buildenv) buildVersionShort = \ hardhatutil.RemovePunctuation(buildenv['buildVersion']) # When the build version string is based on one of our CVS tags # (which usually begin with "CHANDLER_") let's remove the "CHANDLER_" # prefix from the string so it doesn't end up in t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.