rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
assert not hasattr (self, "hoverRow")
assert not hasattr (self, "hoverImageRow")
def OnMouseEvents (self, event): """ This code is tricky, tred with care -- DJA """ event.Skip() #Let the grid also handle the event gridWindow = self.GetGridWindow()
if row == getattr (grid, "hoverRow", wx.NOT_FOUND):
if row == getattr (grid, "hoverImageRow", wx.NOT_FOUND):
def Draw (self, grid, attr, dc, rect, row, col, isSelected): DrawingUtilities.SetTextColorsAndFont (grid, attr, dc, isSelected)
timesAndReminders.append (reminderTime, item)
timesAndReminders.append((reminderTime, item))
def getPendingReminders (self): # @@@BJS Eventually, the query should be able to do the sorting for us; # for now, that doesn't seem to work so we're doing it here. # ... this routine should just be "return self.contents.resultSet" timesAndReminders = [] for item in self.contents: try: reminderTime = item.reminderTime ...
scripting.User.emulate_sidebarClick(App_ns.sidebar, "All")
scripting.User.emulate_sidebarClick(App_ns.sidebar, "Dashboard")
def SetDisplayName(self, displayName, timeInfo=True): """ Set the title @type displayName : string @param displayName : the new title @type timeInfo: boolean """ if not self.isCollection: self.SetEditableBlock("HeadlineBlock", "display name", displayName, timeInfo=timeInfo) else: # select the collection self.SelectItem...
log.add(reportEvent)
log.add(reportEvent.itsItem)
def silentCallback(*args, **kwds): # Simply return the interrupt flag return interrupt_flag == IMMEDIATE_STOP
logger.debug("%s: onSetContentsEvent: %s, %s", debugName(self), event.arguments['item'], event.arguments['collection'])
def onSetContentsEvent (self, event): # logger.debug("DetailRoot.onSetContentsEvent: %s", event.arguments['item']) Block.Block.finishEdits() self.setContentsOnBlock(event.arguments['item'], event.arguments['collection'])
self.widget.Freeze() try: syncInside(self) finally: self.widget.Thaw()
if self.item is not None: self.widget.Freeze() try: syncInside(self) finally: self.widget.Thaw()
def syncInside(block): # process from the children up map(syncInside, block.childrenBlocks) block.synchronizeWidget()
self.show(self.shouldShow(self.item))
self.show(self.item is not None and self.shouldShow(self.item))
def synchronizeWidget(self, useHints=False): super(DetailSynchronizer, self).synchronizeWidget(useHints) self.show(self.shouldShow(self.item))
return item is not None
return True
def shouldShow (self, item): return item is not None
self.synchronizeLabel(self.staticTextLabelValue(self.item))
if self.item is not None: self.synchronizeLabel(self.staticTextLabelValue(self.item))
def synchronizeWidget(self, useHints=False): super(StaticTextLabel, self).synchronizeWidget(useHints) self.synchronizeLabel(self.staticTextLabelValue(self.item))
mixinClass = self.stampMixinClass() mixinKind = mixinClass.getKind(self.itsView) stamped = item.isItemOf(mixinKind) if __debug__: looksStampedbyClass = isinstance(item, mixinClass) assert looksStampedbyClass == stamped, \ "Class/Kind mismatch! Item is class %s, kind %s; " \ "stamping with class %s, kind %s" % ( item.__...
if item is not None: mixinClass = self.stampMixinClass() mixinKind = mixinClass.getKind(self.itsView) stamped = item.isItemOf(mixinKind) if __debug__: looksStampedbyClass = isinstance(item, mixinClass) assert looksStampedbyClass == stamped, \ "Class/Kind mismatch! Item is class %s, kind %s; " \ "stamping with class %s,...
def synchronizeWidget(self, useHints=False): super(DetailStampButton, self).synchronizeWidget(useHints)
if not item or not self._isStampable(item):
if item is None or not self._isStampable(item):
def onButtonPressedEvent (self, event): # Rekind the item by adding or removing the associated Mixin Kind Block.Block.finishEdits() item = self.item if not item or not self._isStampable(item): return mixinKind = self.stampMixinClass().getKind(self.itsView) operation = item.itsKind.isKindOf(mixinKind) and 'remove' or '...
self.widget.SetState("%s.%s" % (self.icon, self.item.private and "Stamped" or "Unstamped"))
if self.item is not None: self.widget.SetState("%s.%s" % (self.icon, self.item.private and "Stamped" or "Unstamped"))
def synchronizeWidget(self, useHints=False): # toggle this button to reflect the privateness of the selected item super(PrivateSwitchButtonBlock, self).synchronizeWidget(useHints) self.widget.SetState("%s.%s" % (self.icon, self.item.private and "Stamped" or "Unstamped"))
item = self.item self.postEventByName("FocusTogglePrivate", {'items': [item]}) tool = event.arguments['sender'] self.widget.SetState("%s.%s" % (self.icon, self.item.private and "Stamped" or "Unstamped"))
item = self.item if item is not None: self.postEventByName("FocusTogglePrivate", {'items': [item]}) self.widget.SetState("%s.%s" % (self.icon, self.item.private and "Stamped" or "Unstamped"))
def onButtonPressedEvent(self, event): item = self.item self.postEventByName("FocusTogglePrivate", {'items': [item]}) tool = event.arguments['sender'] # in case the user canceled the dialog, reset markupbar buttons self.widget.SetState("%s.%s" % (self.icon, self.item.private and "Stamped" or "Unstamped"))
enable = (self.item.getSharedState() == ContentItem.READONLY)
checked = self.item is not None and \ (self.item.getSharedState() == ContentItem.READONLY)
def synchronizeWidget(self, useHints=False): # toggle this icon to reflect the read only status of the selected item super(ReadOnlyIconBlock, self).synchronizeWidget(useHints)
enable and "Stamped" or "Unstamped"))
checked and "Stamped" or "Unstamped"))
def synchronizeWidget(self, useHints=False): # toggle this icon to reflect the read only status of the selected item super(ReadOnlyIconBlock, self).synchronizeWidget(useHints)
enable = ( self.item.getSharedState() == ContentItem.READONLY )
enable = self.item is not None and \ (self.item.getSharedState() == ContentItem.READONLY)
def onButtonPressedEventUpdateUI(self, event): enable = ( self.item.getSharedState() == ContentItem.READONLY ) event.arguments ['Enable'] = enable
self.loadTextValue(self.item)
if self.item is not None: self.loadTextValue(self.item)
def synchronizeWidget(self, useHints=False): super(EditTextAttribute, self).synchronizeWidget(useHints) self.loadTextValue(self.item)
return hasattr(item, 'appearsIn')
return len(getAppearsInNames(item)) > 0
def shouldShow (self, item): return hasattr(item, 'appearsIn')
getMasterMethod = getattr(item, 'getMaster', None) if getMasterMethod is not None: item = getMasterMethod() if not hasattr(item, 'appearsIn'): return u"" collectionNames = _(", ").join(sorted([coll.displayName for coll in item.appearsIn if hasattr(coll, 'displayName')]))
collectionNames = getAppearsInNames(item)
def GetAttributeValue(self, item, attributeName): # Only a recurrence master appears 'in' the collection (for 0.6, anyway) # so if this item lets us get its master, do so and use that instead. getMasterMethod = getattr(item, 'getMaster', None) if getMasterMethod is not None: item = getMasterMethod()
self.selection = self.item
if self.item is not None: self.selection = self.item
def synchronizeWidget(self, useHints=False): super(HTMLDetailArea, self).synchronizeWidget(useHints) self.selection = self.item
self.todayButton = CollectionCanvas.CanvasTextButton(self, today.Format("%B %d, %Y"),
self.todayButton = CollectionCanvas.CanvasTextButton(self, today.Format("%b %d, %Y"),
def OnInit(self): # Setup the navigation buttons today = DateTime.today() self.prevButton = CollectionCanvas.CanvasBitmapButton(self, "application/images/backarrow.png") self.nextButton = CollectionCanvas.CanvasBitmapButton(self, "application/images/forwardarrow.png") self.todayButton = CollectionCanvas.CanvasTextButt...
self.todayButton = CollectionCanvas.CanvasTextButton(self, today.Format("%B %d, %Y"),
self.todayButton = CollectionCanvas.CanvasTextButton(self, today.Format("%b %d, %Y"),
def OnInit(self):
deferred, account.numRetries, account.timeout,
deferred, retries, account.timeout,
def __sendMail(self, from_addr, to_addrs, messageText, deferred, testing=False): if __debug__: self.parent.printCurrentView("transport.__sendMail")
if (filterKind is not None and filterKind.isKindOf (buttonEvent.kindParameter)):
if (filterKind is not None and buttonEvent.kindParameter is not None and filterKind.isKindOf(buttonEvent.kindParameter)):
def setPreferredKind (self, filterKind): if self.filterKind != filterKind:
if prev == 0:
if prev == 0 or current == 0:
def colorDelta(current, prev, stdDev): """ Return the color for the deltas. Changes are within std dev, no coloring: >>> colorDelta(1, 1, 0.01) 'ok' >>> colorDelta(1.05, 1, 0.1) 'ok' >>> colorDelta(1, 1.05, 0.1) 'ok' Previous run had no result (0), so no coloring: >>> colorDelta(1, 0.0, 0.01) 'ok' Significant impr...
No result (0 time): >>> perf.colorTime('perf_stamp_as_event', 0.0, 0.1) 'ok'
def colorTime(self, testName, testTime, stdDev): """ Return the color for the test time. Times within std dev of acceptable, no coloring: >>> perf = perf() #doctest: +ELLIPSIS ... >>> perf.colorTime('perf_stamp_as_event', 1, 0.01) 'ok' >>> perf.colorTime('perf_stamp_as_event', 1.05, 0.1) 'ok' >>> perf.colorTime('perf...
line += '<td class="centered">%2.0fs</td>' % targetAvg
line += '<td class="number">%2.1fs</td>' % targetAvg
def _generateSummaryDetailLine(self, platforms, testkey, enddate, testDisplayName, currentValue, previousValue): graph = [] if testkey in self.SummaryTargets.keys(): targetAvg = self.SummaryTargets[testkey] else: targetAvg = 0.0
detail.append('<h2>%s</h2>\n' % (testDisplayName))
detail.append('<h2 id="%s">%s</h2>\n' % (testkey, testDisplayName))
def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runtime) ] }}}}
if view.isDeferringDelete():
if not self.isNew() and view.isDeferringDelete():
def delete(self, recursive=False, deletePolicy=None, cloudAlias=None, _noMonitors=False): """ Delete this item.
if self.nbPass == self.nbAction: status = "PASS"
if nbTCFailed == 0: status = "PASS" else: status = "FAIL"
def Close(self): if self.toClose: now = datetime.now() elapsed = now - self.startDate self.Print("++++++++++++++++++++++++SUMMARY++++++++++++++++++++++++") self.Print("Start date (before %s test script) = %s" %(self.mainDescription, self.startDate)) self.Print("End date (after %s test script) = %s" %(self.mainDescripti...
status = "FAIL"
if self.nbPass == self.nbAction: status = "PASS" else: status = "FAIL"
def Close(self): if self.toClose: now = datetime.now() elapsed = now - self.startDate self.Print("++++++++++++++++++++++++SUMMARY++++++++++++++++++++++++") self.Print("Start date (before %s test script) = %s" %(self.mainDescription, self.startDate)) self.Print("End date (after %s test script) = %s" %(self.mainDescripti...
self.subTestcaseDesc = None self.toClose = True
self.subTestcaseDesc = None self.toClose = True self.startDate = datetime.now() self.nbPass = 0 self.nbFail = 0 self.nbUnchecked = 0 self.nbAction = 0 self.failureList = [] self.passedList = []
def Close(self): if self.toClose: now = datetime.now() elapsed = now - self.startDate self.Print("++++++++++++++++++++++++SUMMARY++++++++++++++++++++++++") self.Print("Start date (before %s test script) = %s" %(self.mainDescription, self.startDate)) self.Print("End date (after %s test script) = %s" %(self.mainDescripti...
Sgf.Type(startTime)
startTimeBlock.widget.SetValue(startTime)
def SetStartTime(self, startTime, dict=None): if (self.isEvent and not self.allDay): #self.updateExpectedFieldDict(dict) # update the expected field dict if dict: self.logger.Start("Set the start time to : %s" %startTime) Sgf.SummaryViewSelect(self.item) startTimeBlock = Sgf.StartTime() # Emulate the mouse click in the...
Sgf.Type(location)
locationBlock.widget.SetValue(location)
def SetLocation(self, location, dict=None): if self.isEvent: #self.updateExpectedFieldDict(dict) # update the expected field dict if dict: self.logger.Start("Set the location to : %s" %location) Sgf.SummaryViewSelect(self.item) locationBlock = Sgf.Location() Sgf.LeftClick(locationBlock) # Select the old text locationBl...
valueType = PANELS[panelType]['fields'][field]['type']
fieldInfo = PANELS[panelType]['fields'][field] valueType = fieldInfo['type'] valueRequired = fieldInfo.get('required', False)
def __StoreFormData(self, panelType, panel, data): for field in PANELS[panelType]['fields'].keys(): control = wx.xrc.XRCCTRL(panel, field) valueType = PANELS[panelType]['fields'][field]['type'] if valueType == "string": val = control.GetValue().strip() elif valueType == "boolean": val = (control.GetValue() == True) eli...
width = counterpart.size.width
width = counterpart.dayWidth
def PlaceItemOnCalendar(self): counterpart = Globals.repository.find(self.canvas.counterpartUUID) width = counterpart.size.width height = int(self.item.duration.hours * counterpart.hourHeight) position = counterpart.getPosFromDateTime(self.item.startTime) bounds = wx.Rect(position.x, position.y, width, height) self.Set...
dc.DrawText(time.Format('%I:%M %p'), (10, 0)) dc.DrawText(self.item.headline, (10, 14))
dc.DrawText(time.Format('%I:%M %p ') + self.item.headline, (10, 0))
def Draw(self, dc): # @@@ Scaffolding dc.SetBrush(wx.Brush(wx.Color(180, 192, 121))) dc.DrawRoundedRectangle((1, 1), (self.bounds.width - 1, self.bounds.height - 1), radius=10) dc.SetTextForeground(wx.BLACK) dc.SetFont(wx.SWISS_FONT) time = self.item.startTime dc.DrawText(time.Format('%I:%M %p'), (10, 0)) dc.DrawText(s...
if not Globals.wxApplication.insideSynchronizeFramework: counterpart = Globals.repository.find(self.counterpartUUID) newSize = self.GetSize() counterpart.size.width = newSize.width counterpart.size.height = newSize.height self.SetVirtualSize(newSize) for drawableObject in self.zOrderedDrawableObjects: drawableObject.Pl...
counterpart = Globals.repository.find(self.counterpartUUID) newSize = self.GetSize() counterpart.size.width = newSize.width counterpart.size.height = newSize.height self.SetVirtualSize(newSize) for drawableObject in self.zOrderedDrawableObjects: drawableObject.PlaceItemOnCalendar()
def OnSize(self, event): if not Globals.wxApplication.insideSynchronizeFramework: counterpart = Globals.repository.find(self.counterpartUUID) newSize = self.GetSize() counterpart.size.width = newSize.width counterpart.size.height = newSize.height self.SetVirtualSize(newSize) for drawableObject in self.zOrderedDrawableO...
self.updateRange(DateTime.today())
self.updateRange(DateTime.today() + self.rangeIncrement)
def __init__(self, *arguments, **keywords): super (WeekBlock, self).__init__(*arguments, **keywords) self.rangeIncrement = DateTime.RelativeDateTime(days=7) self.updateRange(DateTime.today())
if not Globals.wxApplication.insideSynchronizeFramework: counterpart = Globals.repository.find(self.counterpartUUID) newSize = self.GetSize() counterpart.size.width = newSize.width counterpart.size.height = newSize.height self.SetVirtualSize(newSize)
counterpart = Globals.repository.find(self.counterpartUUID) newSize = self.GetSize() counterpart.size.width = newSize.width counterpart.size.height = newSize.height self.SetVirtualSize(newSize)
def OnSize(self, event): if not Globals.wxApplication.insideSynchronizeFramework: counterpart = Globals.repository.find(self.counterpartUUID) newSize = self.GetSize() counterpart.size.width = newSize.width counterpart.size.height = newSize.height self.SetVirtualSize(newSize) event.Skip()
self.blockItem.contents[self.dropRow].contents.add(item)
self.blockItem.contents[self.dropRow].add(item)
def AddItem(self, itemUUID): item = self.blockItem.findUUID(itemUUID) self.blockItem.contents[self.dropRow].contents.add(item)
for i in range(level+2): print " ",
pass
def PrintItem(uri, rep, level=0): """ Given a uri, display its info along with all its children recursively Example: PrintItem("//Schema", rep) """ for i in range(level): print " ", item = rep.find(uri) print uri for (name, value) in item.iterAttributes(): t = type(value) if name == "attributes": for i in range(l...
print "%s:" % name for (attr,source) in GetAttributes(item): for k in range(level+4): print " ", if source is item: print attr.getItemPath() else: print attr.getItemPath(), "(from %s)" % source.getItemPath()
def PrintItem(uri, rep, level=0): """ Given a uri, display its info along with all its children recursively Example: PrintItem("//Schema", rep) """ for i in range(level): print " ", item = rep.find(uri) print uri for (name, value) in item.iterAttributes(): t = type(value) if name == "attributes": for i in range(l...
App_ns.root.ApplicationBarAll() wx.GetApp().Yield()
def processNextIdle(): wx.GetApp().Yield() ev = wx.IdleEvent() wx.GetApp().ProcessEvent(ev) wx.GetApp().Yield()
def backup(self, dbHome=None, withLog=True):
def backup(self, dbHome=None, withLog=False):
def backup(self, dbHome=None, withLog=True):
env = self._env store = self.store
def backup(self, dbHome=None, withLog=True):
if not withLog: if self._encrypted: flags = DB.DB_ENCRYPT else: flags = 0 for db in env.log_archive(DBEnv.DB_ARCH_DATA):
for db in self._env.log_archive(DBEnv.DB_ARCH_DATA):
def backup(self, dbHome=None, withLog=True):
if withLog: shutil.copy2(srcPath, dstPath) else: lsnFile = db + ".lsn" lsnPath = os.path.join(self.dbHome, lsnFile) shutil.copy2(srcPath, lsnPath) env.lsn_reset(lsnFile, flags) shutil.move(lsnPath, dstPath) if withLog: for log in env.log_archive(DBEnv.DB_ARCH_LOG): path = os.path.join(dbHome, log) self.logger.info(pat...
shutil.copy2(srcPath, dstPath) for log in self._env.log_archive(DBEnv.DB_ARCH_LOG): path = os.path.join(dbHome, log) self.logger.info(path) shutil.copy2(os.path.join(self.dbHome, log), path)
def backup(self, dbHome=None, withLog=True):
if not withLog: env = None try: env = DBEnv() env.open(dbHome, (DBEnv.DB_RECOVER_FATAL | DBEnv.DB_CREATE | self.OPEN_FLAGS), 0) if self._encrypted: flags = DB.DB_ENCRYPT else: flags = 0 for db in env.log_archive(DBEnv.DB_ARCH_DATA): env.lsn_reset(db, flags) env.close() env = None for name in os.listdir(dbHome): if (...
def backup(self, dbHome=None, withLog=True):
self.postEventByName ('SelectedDateChanged',{'start':self.rangeStart})
self.postEventByName ('SelectedDateChanged',{'start':self.selectedDate})
def postDateChanged(self): """ Convenience method for changing the selected date. """ self.postEventByName ('SelectedDateChanged',{'start':self.rangeStart})
TrashCollection = \ ListCollection.update(parcel, 'TrashCollection', displayName=_(u"Trash"), renameable=False, dontDisplayAsCalendar=True, outOfTheBoxCollection = True ) notes = KindCollection.update(parcel, 'notes') notes.kind = pim.Note.getKind(parcel.itsView) notes.recursive=True
TrashCollection = ListCollection.update( parcel, 'TrashCollection', displayName=_(u"Trash"), renameable=False, dontDisplayAsCalendar=True, outOfTheBoxCollection = True) notes = KindCollection.update( parcel, 'notes', kind = pim.Note.getKind(parcel.itsView), recursive = True)
def GetColorForHue (hue): rgb = wx.Image.HSVtoRGB (wx.Image_HSVValue (hue / 360.0, 0.5, 1.0)) return ColorType (rgb.red, rgb.green, rgb.blue, 255)
events = \ KindCollection.update(parcel, 'events') events.kind=pim.CalendarEventMixin.getKind(parcel.itsView) events.recursive=True
events = KindCollection.update( parcel, 'events', kind = pim.CalendarEventMixin.getKind(parcel.itsView), recursive = True)
def GetColorForHue (hue): rgb = wx.Image.HSVtoRGB (wx.Image_HSVValue (hue / 360.0, 0.5, 1.0)) return ColorType (rgb.red, rgb.green, rgb.blue, 255)
eventsWithReminders = \ FilteredCollection.update(parcel, 'eventsWithReminders', source=events, filterExpression='item.reminders', filterAttributes=['reminders'])
eventsWithReminders = FilteredCollection.update( parcel, 'eventsWithReminders', source=events, filterExpression='item.reminders', filterAttributes=['reminders'])
def GetColorForHue (hue): rgb = wx.Image.HSVtoRGB (wx.Image_HSVValue (hue / 360.0, 0.5, 1.0)) return ColorType (rgb.red, rgb.green, rgb.blue, 255)
masterEvents = \ FilteredCollection.update(parcel, 'masterEvents', source = events, filterExpression = masterFilter, filterAttributes = ['occurrences', 'rruleset'])
masterEvents = FilteredCollection.update( parcel, 'masterEvents', source = events, filterExpression = masterFilter, filterAttributes = ['occurrences', 'rruleset'])
def GetColorForHue (hue): rgb = wx.Image.HSVtoRGB (wx.Image_HSVValue (hue / 360.0, 0.5, 1.0)) return ColorType (rgb.red, rgb.green, rgb.blue, 255)
locations = \ KindCollection.update(parcel, 'locations') locations.kind = pim.Location.getKind(parcel.itsView) locations.recursive = True
locations = KindCollection.update( parcel, 'locations', kind = pim.Location.getKind(parcel.itsView), recursive = True)
def GetColorForHue (hue): rgb = wx.Image.HSVtoRGB (wx.Image_HSVValue (hue / 360.0, 0.5, 1.0)) return ColorType (rgb.red, rgb.green, rgb.blue, 255)
mailCollection = \ KindCollection.update(parcel, 'mail') mailCollection.kind=pim.mail.MailMessageMixin.getKind(parcel.itsView) mailCollection.recursive=True inSource = \ FilteredCollection.update(parcel, 'inSource', source=mailCollection, filterExpression=u'getattr(item, \'isInbound\', False)', filterAttributes=['isI...
mailCollection = KindCollection.update( parcel, 'mail', kind = pim.mail.MailMessageMixin.getKind(parcel.itsView), recursive = True) inSource = FilteredCollection.update( parcel, 'inSource', source=mailCollection, filterExpression=u'getattr(item, \'isInbound\', False)', filterAttributes=['isInbound'])
def GetColorForHue (hue): rgb = wx.Image.HSVtoRGB (wx.Image_HSVValue (hue / 360.0, 0.5, 1.0)) return ColorType (rgb.red, rgb.green, rgb.blue, 255)
outSource = \ FilteredCollection.update(parcel, 'outSource', source=mailCollection, filterExpression=u'getattr(item, \'isOutbound\', False)', filterAttributes=['isOutbound'])
outSource = FilteredCollection.update( parcel, 'outSource', source=mailCollection, filterExpression=u'getattr(item, \'isOutbound\', False)', filterAttributes=['isOutbound'])
def GetColorForHue (hue): rgb = wx.Image.HSVtoRGB (wx.Image_HSVValue (hue / 360.0, 0.5, 1.0)) return ColorType (rgb.red, rgb.green, rgb.blue, 255)
scriptsCollection = KindCollection.update(parcel, 'scripts') scriptsCollection.kind = scripting.Script.getKind(parcel.itsView)
scriptsCollection = KindCollection.update( parcel, 'scripts', kind = scripting.Script.getKind(parcel.itsView))
def GetColorForHue (hue): rgb = wx.Image.HSVtoRGB (wx.Image_HSVValue (hue / 360.0, 0.5, 1.0)) return ColorType (rgb.red, rgb.green, rgb.blue, 255)
insertions.append(ley)
insertions.append(key)
def _applyIndexChanges(self, view, indexChanges, deletes):
'release' : ["Developers' release/ directory", "Description of release distro"], 'debug' : ["Developers' debug/ directory", "Description of debug distro"],
'release' : ["Developers' 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' : ["Developers' debug...
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]: hardhatutil.rmdirRecursive(os.path.join(...
fileOut.write("<p><a href="+newDirName+"/"+actual+">: "+ _descriptions[x][0] +"</a> " + _descriptions[x][1] +"</p>\n")
fileOut.write("<p><a href="+newDirName+"/"+actual+"> "+ _descriptions[x][0] +"</a>: " + _descriptions[x][1] +"</p>\n")
def CreateIndex(outputDir, newDirName, nowString, buildName): """Generates an index.html page from the hint files that hardhat creates which contain the actual distro filenames""" fileOut = file(outputDir+os.sep+"index.html", "w") fileOut.write("<html><head><link rel=Stylesheet href=http://www.osafoundation.org/css/OSA...
class StaticCalendarRedirectAttribute (StaticRedirectAttribute): def shouldShow (self, item):
class CalendarEventBlock (DetailSynchronizer, LabeledTextAttributeBlock): def shouldShow (self, item):
def loadAttributeIntoWidget(self, item, widget): value = '' try: section = item.getAttributeValue (self.whichAttribute()) value = section.getAttributeValue ('emailAddresses') except AttributeError: value = {} # convert the email address list to a nice string. whoNames = [] for whom in value.values(): whoNames.append (s...
class EditCalendarRedirectTimeAttribute (EditRedirectAttribute):
class StaticTimeAttribute (StaticTextLabel): def shouldShow (self, item): calendarMixinKind = Calendar.CalendarParcel.getCalendarEventMixinKind() shouldShow = item.isItemOf (calendarMixinKind) return shouldShow def staticTextLabelValue (self, item): timeLabel = self.title + _(': ') return timeLabel class EditTimeAt...
def shouldShow (self, item): # only shown for CalendarEventMixn kinds calendarMixinKind = Calendar.CalendarParcel.getCalendarEventMixinKind() return item.isItemOf (calendarMixinKind)
timeFormat = '%Y-%m-%d %H:%M %p' def shouldShow (self, item):
timeFormat = '%Y-%m-%d %I:%M %p' def shouldShow (self, item):
def shouldShow (self, item): # only shown for CalendarEventMixn kinds calendarMixinKind = Calendar.CalendarParcel.getCalendarEventMixinKind() return item.isItemOf (calendarMixinKind)
tupleDate = DateTime.strptime (dateString, self.timeFormat) except:
theDate = DateTime.Parser.DateTimeFromString (dateString) except ValueError:
def saveAttributeFromWidget(self, item, widget): """" Update the attribute from the user edited string in the widget. """ dateString = widget.GetValue().strip('?') try: # convert to Date/Time tupleDate = DateTime.strptime (dateString, self.timeFormat) except: pass else: theDate = DateTime.mktime (tupleDate) try: # save...
else: theDate = DateTime.mktime (tupleDate)
except DateTime.RangeError: pass
def saveAttributeFromWidget(self, item, widget): """" Update the attribute from the user edited string in the widget. """ dateString = widget.GetValue().strip('?') try: # convert to Date/Time tupleDate = DateTime.strptime (dateString, self.timeFormat) except: pass else: theDate = DateTime.mktime (tupleDate) try: # save...
item.setAttributeValue(self.whichAttribute(), theDate)
whichTimeAttribute = self.whichAttribute() if 'start' in whichTimeAttribute: item.ChangeStart (theDate) else: item.setAttributeValue(whichTimeAttribute, theDate)
def saveAttributeFromWidget(self, item, widget): """" Update the attribute from the user edited string in the widget. """ dateString = widget.GetValue().strip('?') try: # convert to Date/Time tupleDate = DateTime.strptime (dateString, self.timeFormat) except: pass else: theDate = DateTime.mktime (tupleDate) try: # save...
tupleTime = DateTime.localtime (theDate) dateString = DateTime.strftime (self.timeFormat, tupleTime)
dateString = theDate.strftime (self.timeFormat)
def saveAttributeFromWidget(self, item, widget): """" Update the attribute from the user edited string in the widget. """ dateString = widget.GetValue().strip('?') try: # convert to Date/Time tupleDate = DateTime.strptime (dateString, self.timeFormat) except: pass else: theDate = DateTime.mktime (tupleDate) try: # save...
tupleTime = DateTime.localtime (dateTime) value = DateTime.strftime (self.timeFormat, tupleTime)
value = dateTime.strftime (self.timeFormat)
def loadAttributeIntoWidget(self, item, widget): """" Update the widget display based on the value in the attribute. """ try: dateTime = item.getAttributeValue(self.whichAttribute()) except AttributeError: value = '' else: tupleTime = DateTime.localtime (dateTime) value = DateTime.strftime (self.timeFormat, tupleTime) ...
class StaticDurationAttribute (StaticTextLabel): """ Static Text that displays the name of the selected item's Attribute """ def shouldShow (self, item): calendarMixinKind = Calendar.CalendarParcel.getCalendarEventMixinKind() return item.isItemOf (calendarMixinKind) def staticTextLabelValue (self, item): durationLabe...
def loadAttributeIntoWidget(self, item, widget): """" Update the widget display based on the value in the attribute. """ try: dateTime = item.getAttributeValue(self.whichAttribute()) except AttributeError: value = '' else: tupleTime = DateTime.localtime (dateTime) value = DateTime.strftime (self.timeFormat, tupleTime) ...
DrawClippedText(dc, word, x, y, rectWidth, width)
assert thisLine == u'', "Should be drawing first long word" DrawClippedText(dc, word, rectX, y, rectWidth, width)
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...
DrawClippedText(dc, word, x, y, availableWidth, width)
assert x == rectX and thisLine == u'', "should be writing a long word at the beginning of a line" DrawClippedText(dc, word, rectX, y, availableWidth, width)
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...
wordWithSpace = word + ' ' dc.DrawText(wordWithSpace, x, y)
thisLine += word + 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...
if thisLine: dc.DrawText(thisLine, rectX, y)
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...
oldItem.unwatchCollection(view[source[0]], source[1], 'set', oldAttribute)
sourceItem = view.findUUID(source[0]) if sourceItem is not None: oldItem.unwatchCollection(sourceItem, source[1], 'set', oldAttribute)
def _setSourceItem(self, source, item, attribute, oldItem, oldAttribute): if isinstance(source, AbstractSet): source._setOwner(item, attribute)
uri = string.lstrip(uri, "//parcels")
uri = uri[10:]
def FindParcelFile(uri, searchPath): path = "" uri = string.lstrip(uri, "//parcels") for part in string.split(uri, '/'): path = os.path.join(path, part) path = os.path.join(path, 'parcel.xml') file = SearchFile(path, searchPath) return file
global buildscriptFile
global buildscriptFile, fromAddr, mailtoAddr, alertAddr, adminAddr, defaultDomain, defaultRsyncServer
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", help="Where to mail script reports\n" " [default] buildreport " + "(at) osafoundation " + "(dot) org"...
default="buildreport", help="Where to mail script reports\n" " [default] buildreport " + "(at) osafoundation " + "(dot) 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", help="Where to mail script reports\n" " [default] buildreport " + "(at) osafoundation " + "(dot) org"...
default="chandler", help="Name of script to use (without .py extension)\n" "[default] chandler")
default="newchandler", help="Name of script to use (without .py extension)\n" "[default] newchandler")
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", help="Where to mail script reports\n" " [default] buildreport " + "(at) osafoundation " + "(dot) org"...
default="buildman", help="E-mail to notify on build errors \n" " [default] buildman " + "(at) osafoundation " + "(dot) org")
default=alertAddr, help="E-mail to notify on build errors \n" " [default] " + alertAddr + defaultDomain) parser.add_option("-r", "--rsyncServer", action="store", type="string", dest="rsyncServer", default=defaultRsyncServer, help="Net address of server where builds get uploaded \n" " [default] " + defaultRsyncServer)
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", help="Where to mail script reports\n" " [default] buildreport " + "(at) osafoundation " + "(dot) org"...
fromAddr += "@" + defaultDomain
fromAddr += defaultDomain mailtoAddr = options.toAddr alertAddr = options.alertAddr if mailtoAddr.find('@') == -1: mailtoAddr += defaultDomain if alertAddr.find('@') == -1: 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", help="Where to mail script reports\n" " [default] buildreport " + "(at) osafoundation " + "(dot) org"...
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", help="Where to mail script reports\n" " [default] buildreport " + "(at) osafoundation " + "(dot) org"...
msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromAddr, toAddr)) msg = msg + "Subject: " + status + " from " + buildName + "\n" msg = msg + "tinderbox: tree: " + treeName + "\n" msg = msg + "tinderbox: buildname: " + buildName + "\n" msg = msg + "tinderbox: starttime: " + startTime + "\n" msg = m...
subject = "[tinderbox] " + status + " from " + buildName msg = ("From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (fromAddr, toAddr, subject)) msg += "tinderbox: tree: " + treeName + "\n" msg += "tinderbox: buildname: " + buildName + "\n" msg += "tinderbox: starttime: " + startTime + "\n" msg += "tinderbox: timenow: " + n...
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 + "Subject: " + status + " from " + buildName + "\n" msg = msg + "tinderbox: tree: " + treeName + "\n" msg = msg +...
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 + "Subject: " + status + " from " + buildName + "\n" msg = msg + "tinderbox: tree: " + treeName + "\n" msg = msg +...
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) for anyDir in dirs: if not os.path.isdir(os.path.join(dir, anyDir)): dirs.rem...
'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) for anyDir in dirs: if not os.path.isdir(os.path.join(dir, anyDir)): dirs.rem...
view.commit() if isinstance(schema.reset(view), NullRepositoryView): if not allowSchemaView: raise AssertionError, "schema.py was used before it was initialized here causing it to setup a NullRepositoryView"
def initRepository(directory, options, allowSchemaView=False): repository = DBRepository(directory) kwds = { 'stderr': options.stderr, 'ramdb': options.ramdb, 'create': True, 'recover': options.recover, 'exclusive': True, 'refcounted': True, 'logged': not not options.logging, 'verify': options.verify or __debug__ } ...
self.control.Show(False)
wx.CallAfter(self.control.Destroy)
def destroyControl(self): if self.control is None: return # @@@DLD create EndEdit method on AE to delete the control? self.control.Show(False) #@@@DLD should Destroy() the control, but that crashes! #self.DestroyChildren() self.control = None
self.rep.delete()
if os.path.exists(self.rep.dbHome): self.rep.delete() else: self.rep.logger.warn("no repository at %s", self.rep.dbHome)
def tearDown(self): self.rep.close() self.rep.delete()
defaultFileName = 'UserScript.py'
def isAttributeModifiable(self, attribute): return True
if __debug__ and not fileName: fileName = self.defaultFileName debugFile = open(self.defaultFileName, 'wt') try: debugFile.write(self.bodyString) finally: debugFile.close()
def execute(self, fileName=""): assert len(self.bodyString) > 0, "Empty script body"
value = value.getInputStream().read()
uStr = value.getReader().read() value = uStr.encode('ascii', 'replace')
def exportProcess(self, item, depth=0):
x = rect.x + 1 y = rect.y + 1
rectX = rect.x + 1 rectY = rect.y rowHeight = rect.GetHeight()
def DrawClippedTextWithDots(dc, string, rect, alignRight=False): x = rect.x + 1 y = rect.y + 1 for line in unicode(string).split (os.linesep): # test for flicker by drawing a random character first each time we draw # line = chr(ord('a') + random.randint(0,25)) + line lineWidth, lineHeight = dc.GetTextExtent (line) lo...
localX = alignRight and (rect.x + 1 + rect.width - 2 - lineWidth) or x dc.DrawText (line, localX, y)
if alignRight: x = rect.x + rect.width - lineWidth - 1 else: x = rectX y = rectY + (rowHeight - lineHeight) / 2 dc.DrawText (line, x, y)
def DrawClippedTextWithDots(dc, string, rect, alignRight=False): x = rect.x + 1 y = rect.y + 1 for line in unicode(string).split (os.linesep): # test for flicker by drawing a random character first each time we draw # line = chr(ord('a') + random.randint(0,25)) + line lineWidth, lineHeight = dc.GetTextExtent (line) lo...
x = rect.x + 1 + rect.width - 2 - width dc.DrawRectangle(x, rect.y + 1, width + 1, height) dc.DrawText('...', x, rect.y + 1) y += lineHeight
x = rect.x + rect.width - width - 1 dc.DrawRectangle (x, y, width + 1, height) dc.DrawText('...', x, y) rectY += lineHeight
def DrawClippedTextWithDots(dc, string, rect, alignRight=False): x = rect.x + 1 y = rect.y + 1 for line in unicode(string).split (os.linesep): # test for flicker by drawing a random character first each time we draw # line = chr(ord('a') + random.randint(0,25)) + line lineWidth, lineHeight = dc.GetTextExtent (line) lo...
presentationStyle={'sampleText': u'location',
presentationStyle={'sampleText': _(u'location'),
def makeCalendarArea(parcel, oldVersion): blocks = schema.ns("osaf.framework.blocks", parcel.itsView) locationArea = \ CalendarLocationAreaBlock.template('CalendarLocationArea', childrenBlocks=[ makeSpacer(parcel, SizeType(0, 22)), makeEditor(parcel, 'CalendarLocation', viewAttribute=pim.EventStamp.location.name, pres...
'sampleText': u'',
'sampleText': _(u'enter title'),
def makeNoteSubtree(parcel, oldVersion): """ Build the subtree (and related stuff) for Note. """ blocks = schema.ns("osaf.framework.blocks", parcel.itsView) # First, the headline AEBlock and the area it sits in headlineAEBlock = makeEditor(parcel, 'HeadlineBlock', viewAttribute=u'displayName', characterStyle=blocks.Bi...
dashT = '-dt' else: dashT = '-rt'
dashT = '-dvt' else: dashT = '-vrt'
def Do(hardhatScript, mode, workingDir, outputDir, cvsVintage, buildVersion, log): testDir = os.path.join(workingDir, "chandler") os.chdir(testDir) if mode == "debug": dashT = '-dt' else: dashT = '-rt' try: # test print "Testing " + mode log.write("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n") lo...
if False: for child in parent.childrenBlocks: print child, child.parentBlock
for child in parent.childrenBlocks: self.assertEqual(child.parentBlock, parent) self.assertEqual(child1, parent.getValue('foo', alias='one')) self.assertEqual(child2, parent.getValue('foo', alias='two'))
def testCollections(self):