rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
else: if repr(self.item.getAttributeValue(attrName)) == value: print "Reload: item %s, unassigning %s = '%s'" % \ (self.item.itsPath, attrName, value) self.item.removeAttributeValue(attrName) | def unapplyAssignments(self): """ Do whatever needs to be done to the item to "remove" this assignment. """ for (attrName, value, key) in self.getAssignments(): card = self.item.getAttributeAspect(attrName, "cardinality") if card == "dict": print "Reload: item %s, unassigning %s[%s] = '%s'" % \ (self.item.itsPath, attr... | |
changes = "-nochanges" | changes = "-first-run" | 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") changes = "-nochanges" for releaseMode in ('debug', 'release'): if changes == "-changes": | for releaseMode in ('debug', 'release'): | 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") changes = "-nochanges" for releaseMode in ('debug', 'release'): | 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 moveCollections(self, fromItem, toItem): """Move all collection references from one item to another.""" | def moveCollections(self, fromEvent, toEvent): """Move all collection references from one event to another.""" fromItem = fromEvent.itsItem.getMembershipItem() toItem = fromEvent.itsItem.getMembershipItem() | def moveCollections(self, fromItem, toItem): """Move all collection references from one item to another.""" for collection in getattr(fromItem, 'collections', []): collection.add(toItem) collection.remove(fromItem) |
fromItem = EventStamp(fromEvent).itsItem toItem = EventStamp(toEvent).itsItem | fromItem = EventStamp(fromEvent).itsItem.getMembershipItem() toItem = EventStamp(toEvent).itsItem.getMembershipItem() | def copyCollections(self, fromEvent, toEvent): """Copy all collection references from one item to another.""" fromItem = EventStamp(fromEvent).itsItem toItem = EventStamp(toEvent).itsItem for collection in getattr(fromItem, 'collections', []): collection.add(toItem) |
self.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK, self.OnLeftClick) | def __init__(self, *arguments, **keywords): """ Giant hack. Calling event.GetEventObject in OnShow of application, while the object is being created cause the object to get the wrong type because of a "feature" of SWIG. So we need to avoid OnShows in this case. """ oldIgnoreSynchronizeWidget = wx.GetApp().ignoreSynchro... | |
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 ... | |
if self.skipNextRangeSelect: self.skipNextRangeSelect = False else: | if (item is not None or event.Selecting() or event.ControlDown()): | def OnRangeSelect(self, event): if not wx.GetApp().ignoreSynchronizeWidget: topLeftList = self.GetSelectionBlockTopLeft() self.blockItem.selection = [] for topLeft, bottomRight in zip (topLeftList, self.GetSelectionBlockBottomRight()): self.blockItem.selection.append ([topLeft[0], bottomRight[0]]) topLeftList.sort() t... |
coll.removeItem(itemIndex) | coll.remove(itemIndex) | def __setitem__(self, key, value): """ replace the item associated with the key from the ref collection attribute. Note that the new item may have a different key, but it will be placed in the same position in the ref collection, and the keyed item will be removed. @param key: the key used for position lookup into the ... |
coll.removeItem(itemIndex) | coll.remove(itemIndex) | def __delitem__(self, key): """ Delete the keyed item from our ref collection. @param key: the key used for item location in the ref collection. Throws an exception if there is no item associated with the key. @type key: C{immutable}, typically C{String} """ itemIndex, coll = self._index(key) coll.removeItem(itemIndex) |
self.setStatusMessage (_(u"Synchronizing shared collections...")) SyncProgress.Show(wx.GetApp().mainFrame, rv=self.itsView) self.setStatusMessage (_(u"Shared collections synchronized")) | self.RepositoryCommitWithStatus () sharing.scheduleNow(view) | def onSyncWebDAVEvent (self, event): """ Synchronize WebDAV sharing. |
Currently, we're limited to a depth of three nested views """ assert len (Globals.views) <= 3 | Currently, we're limited to a depth of four nested views """ assert len (Globals.views) <= 4 | def pushView (self): """ Pushes a new view on to our list of views. @param self: the new view @type block: C{Block} @param Globals.mainViewRoot.lastDynamicBlock: the last block synched @type lastDynamicBlock: C{DynamicBlock}, or C{False} for no previous block, or C{True} for forced resync. |
if attrType is not None: | if attrType is not None and not attrType.isAlias(): | def setupTypeDelegate(self, attrs): |
flickrPhotos = flickr.photos_search(tags=self.tag,per_page=10) | flickrPhotos = flickr.photos_search(tags=self.tag,per_page=10,sort="date-posted-asc") | def getCollectionFromFlickr(self,repView): coll = ItemCollection.ItemCollection(view = repView) if self.username: flickrUsername = flickr.people_findByUsername(self.username) flickrPhotos = flickr.people_getPublicPhotos(flickrUsername.id,10) coll.displayName = self.username elif self.tag: flickrPhotos = flickr.photos_s... |
self.testdir = os.path.join(self.rootdir, 'chandler', 'repository', \ | self.testdir = os.path.join(self.rootdir, 'repository', \ | def setUp(self): RepositoryTestCase.RepositoryTestCase._setup(self, False) |
ImportExport().Export() def OnImportItems(self, event): ImportExport().Import() self.wxMainFrame.activeParcel.UpdateFromRepository() | fileDialog = wxFileDialog(self.wxMainFrame, _("Select file to export to:"), "", "SavedItems", "*.*", wxSAVE|wxOVERWRITE_PROMPT ) if fileDialog.ShowModal() == wxID_OK: filePath = fileDialog.GetPath() try: ImportExport().Export(filepath=filePath) except: message = _("Couldn't export repository to %s") % (filePath) wxMess... | def OnExportItems(self, event): ImportExport().Export() |
def __str__(self): """ for debugging """ return "<%s%s:%s %s>" %(type(self).__name__, "", self.itsName, self.itsUUID.str16()) | def __str__(self): """ for debugging """ return "<%s%s:%s %s>" %(type(self).__name__, "", self.itsName, self.itsUUID.str16()) | |
if DEBUG: logger.debug("Adding %s to %s...", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) | def add(self, item): """ Add an item to the collection. """ if DEBUG: logger.debug("Adding %s to %s...", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) self.inclusions.add(item) | |
if DEBUG: logger.debug("...removing from exclusions (%s)", self.exclusions.getItemDisplayName().encode('ascii', 'replace')) | def add(self, item): """ Add an item to the collection. """ if DEBUG: logger.debug("Adding %s to %s...", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) self.inclusions.add(item) | |
if DEBUG: logger.debug("...removing from trash (%s)", self.trash.getItemDisplayName().encode('ascii', 'replace')) | def add(self, item): """ Add an item to the collection. """ if DEBUG: logger.debug("Adding %s to %s...", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) self.inclusions.add(item) | |
if DEBUG: logger.debug("...done adding %s to %s", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) | def add(self, item): """ Add an item to the collection. """ if DEBUG: logger.debug("Adding %s to %s...", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) self.inclusions.add(item) | |
if DEBUG: logger.debug("Removing %s from %s...", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) if DEBUG: logger.debug("...adding to exclusions (%s)", self.exclusions.getItemDisplayName().encode('ascii', 'replace')) | isDeleting = item.isDeleting() | def remove(self, item): """ Remove an item from the collection. """ |
self.exclusions.add(item) | if not isDeleting: self.exclusions.add(item) | def remove(self, item): """ Remove an item from the collection. """ |
if DEBUG: logger.debug("...removing from inclusions (%s)", self.inclusions.getItemDisplayName().encode('ascii', 'replace')) | def remove(self, item): """ Remove an item from the collection. """ | |
if self.trash is not None: | if not (isDeleting or self.trash is None): | def remove(self, item): """ Remove an item from the collection. """ |
if DEBUG: logger.debug("...adding to trash (%s)", self.trash.getItemDisplayName().encode('ascii', 'replace')) | def remove(self, item): """ Remove an item from the collection. """ | |
if DEBUG: logger.debug("...done removing %s from %s", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) | def remove(self, item): """ Remove an item from the collection. """ | |
for archive in archivedirs: | for archive in archivedirs[:-1]: | def prune(): global startDir nowDT = datetime.datetime.now() tooOld = nowDT - datetime.timedelta(days=longPolicyDays) tooNew = nowDT - datetime.timedelta(hours=longPolicyDays) tooOldStr = tooOld.strftime("%Y%m%d%H%M%S") tooNewStr = tooNew.strftime("%Y%m%d%H%M%S") os.chdir(startDir) # get directories where tbox clie... |
filterAttributes=('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) |
self.allDayCloseArrowImage = wx.GetApp().GetImage("AllDayCloseArrow.png") self.allDayOpenArrowImage = wx.GetApp().GetImage("AllDayOpenArrow.png") self.allDayBlankArrowImage = wx.GetApp().GetImage("AllDayBlankArrow.png") | self.allDayCloseArrowImage = wx.GetApp().GetImage("AllDayCloseArrow_whitebg.png") self.allDayOpenArrowImage = wx.GetApp().GetImage("AllDayOpenArrow_whitebg.png") self.allDayBlankArrowImage = wx.GetApp().GetImage("AllDayBlankArrow_whitebg.png") | def __init__(self, *arguments, **keywords): super(wxCalendarControl, self).__init__(*arguments, **keywords) self.allDayCloseArrowImage = wx.GetApp().GetImage("AllDayCloseArrow.png") self.allDayOpenArrowImage = wx.GetApp().GetImage("AllDayOpenArrow.png") self.allDayBlankArrowImage = wx.GetApp().GetImage("AllDayBlankArr... |
print wxAllDay.autoExpandMode, currentHeight, wxAllDay.collapsedHeight, wxAllDay.expandedHeight | def OnExpandButtonClick(self, event): #wxAllDay = self.blockItem.calendarContainer.allDayEventsCanvas.widget wxAllDay = self.GetAllDayWidget() currentHeight = wxAllDay.GetSize()[1] if currentHeight >= wxAllDay.collapsedHeight and \ currentHeight < wxAllDay.expandedHeight: # Expand! wxAllDay.GetParent().SetSashPosition... | |
print "*** setFiringTime: will fire at %s in %s minutes" % (when, millisecondsUntilFiring / 60000) | logger.debug("*** setFiringTime: will fire at %s in %s minutes" % (when, millisecondsUntilFiring / 60000)) | def setFiringTime(self, when): # First turn off the old timer timer = self.widget timer.Stop() |
print "*** setFiringTime: No new time." | logger.debug("*** setFiringTime: No new time.") | def setFiringTime(self, when): # First turn off the old timer timer = self.widget timer.Stop() |
def onTZPrefChange(self, op, item, names): | def onTZPrefChange(self, op, uuid, names): | def onTZPrefChange(self, op, item, names): if 'showUI' in names: self.widget.tzChoice.Show(item.showUI) self.widget.Layout() |
self.widget.tzChoice.Show(item.showUI) | prefs = self.itsView.findUUID(uuid) self.widget.tzChoice.Show(prefs.showUI) | def onTZPrefChange(self, op, item, names): if 'showUI' in names: self.widget.tzChoice.Show(item.showUI) self.widget.Layout() |
if not hasattr (self, 'hoverImageRow'): | if not hasattr (self, 'hoverImageRow') and not self.IsCellEditControlEnabled(): | def OnMouseEvents (self, event): """ This code is tricky, tread with care -- DJA """ event.Skip() #Let the grid also handle the event by default |
Block.finishEdits() | Block.Block.finishEdits() | def onRunSelectedScriptEvent(self, event): # Triggered from "Tests | Run a Script" items = self.__getSelectedItems() if len(items) > 0: for item in items: if hasattr(item, 'execute'): # in case the user was just editing the script, # ask the focus to finish changes, if it can Block.finishEdits() |
if not event.recurrenceID in rruleset: | recurrenceID = event.recurrenceID if isDayItem(event): recurrenceID = datetime.combine( recurrenceID.date(), time(0, tzinfo=recurrenceID.tzinfo)) if not recurrenceID in rruleset: | def _generateRule(self, after=None, before=None, inclusive=False): """Yield all occurrences in this rule.""" event = first = self.getFirstInRule() # check for modifications taking place before first, but only if # if we're actually interested in dates before first (i.e., the # after argument is None or less than first.... |
newfirst._makeGeneralChange() | newfirst._makeGeneralChange(master) | def changeThis(self, attr=None, value=None): """Make this event a modification, don't modify future events. Without arguments, change self appropriately to make it a THIS modification. One edge case does have an effect on other events. Moving an event's startTime so it begins in a different rule will ........FIXME ... |
if version < self._version: kinds = [] for item in items(): if item.isSchema(): if isinstance(item, Kind): kinds.append(item.itsUUID) item._unloadItem(refCounted or item.isPinned(), self, False) self._version = version if kinds: try: loading = self._setLoading(True) kinds = [kind for kind in (self.find(uuid) for uuid... | kinds = [] for item in items(): if item.isSchema(): if isinstance(item, Kind): kinds.append(item.itsUUID) item._unloadItem(refCounted or item.isPinned(), self, False) self._version = version if kinds: try: loading = self._setLoading(True) kinds = [kind for kind in (self.find(uuid) for uuid in kinds) if kind is not No... | def _refreshItems(self, version, items): |
kind.flushCaches('reload') else: for item in items(): item._unloadItem(refCounted or item.isPinned(), self, False) self._version = version for item in items(): if item.isSchema(): self.find(item.itsUUID) | kind.flushCaches('unload') self._setLoading(loading, True) for kind in kinds: kind.flushCaches('reload') | def _refreshItems(self, version, items): |
if self.parent.blockItem.dayMode: label = selectedDate.Format("%B %d %Y") else: label = selectedDate.Format("%B %Y") self.monthButton.SetLabel(label) | self.monthButton.SetLabel(selectedDate.Format("%B %Y")) | def wxSynchronizeWidget(self): |
if '__WXMAC__' in wx.PlatformInfo: def Destroy(self): if (self.blockItem.mainFrameToolbar): self.blockItem.getFrame().SetToolBar (None) super (wxToolbar, self).Destroy() | def __init__(self, *arguments, **keywords): super (wxToolbar, self).__init__ (*arguments, **keywords) # keep track of ToolbarItems so we can tell when/how they change in synchronize self.toolItemList = [] # non-persistent list self.toolItems = 0 | |
if '__WXMAC__' in wx.PlatformInfo: if (self.mainFrameToolbar): self.getFrame().SetToolBar (toolbar) | def instantiateWidget (self): self.ensureDynamicChildren () heightGutter = self.buttonsLabeled and 23 or 6 parentWidget = self.parentBlock.widget toolbar = wxToolbar(parentWidget, self.getWidgetID(), wx.DefaultPosition, (-1, self.toolSize.height+heightGutter), style=self.calculate_wxStyle()) # set the tool bitmap size ... | |
return x and not y | return flags[0] and not flags[1] | def changed(self, item, attribute=None): """ determine whether item has entered/exited the query result set |
if index is None: coll.append(item, alias=self.itemNameAccessor(item)) else: | coll.append(item, alias=self.itemNameAccessor(item)) if index is not None: | def insert(self, index, item): """ Insert item before index in our ref collection. @param index: the position used for insertion into the ref collection. @type index: C{item} that exists in the ref collection, or C{None} to append. @param item: the C{item} to insert before C{index} in the ref collection. @type item: C{... |
class AETextCtrl(wx.TextCtrl): | class AETextCtrl(DragAndDrop.DraggableWidget, DragAndDrop.DropReceiveWidget, DragAndDrop.TextClipboardHandler, wx.TextCtrl): def __init__(self, *arguments, **keywords): super (AETextCtrl, self).__init__ (*arguments, **keywords) self.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouseEvents) def OnMouseEvents(self, event): if self... | def AttributeChanged(self): """ Called by the attribute editor when it changes the underlying value. """ pass # for now. |
self.__setSampleText(control, self.sampleText) else: self.showingSample = False self.__changeTextQuietly(control, value) | self.__changeTextQuietly(control, self.sampleText, True, False) else: self.__changeTextQuietly(control, value, False, False) | def BeginControlEdit (self, item, attributeName, control): self.sampleText = self.GetSampleText(item, attributeName) self.item = item self.attributeName = attributeName logger.debug("BeginControlEdit: context for %s.%s is '%s'", item, attributeName, self.sampleText) |
self.showingSample = False self.__changeTextQuietly(control, value) else: self.__setSampleText(control, self.sampleText) | self.__changeTextQuietly(control, value, False, False) else: self.__changeTextQuietly(control, self.sampleText, True, False) | def SetControlValue(self, control, value): if len(value) != 0 or self.sampleText is None: self.showingSample = False self.__changeTextQuietly(control, value) else: self.__setSampleText(control, self.sampleText) |
self.showingSample = False | self.__changeTextQuietly(control, currentText, False, True) | def onTextChanged(self, event): if not getattr(self, "ignoreTextChanged", False): control = event.GetEventObject() if getattr(self, 'sampleText', None) is not None: logger.debug("StringAE.onTextChanged: not ignoring.") currentText = control.GetValue() if self.showingSample: logger.debug("onTextChanged: removing sample"... |
self.__setSampleText(control, self.sampleText) | self.__changeTextQuietly(control, self.sampleText, True, False) | def onTextChanged(self, event): if not getattr(self, "ignoreTextChanged", False): control = event.GetEventObject() if getattr(self, 'sampleText', None) is not None: logger.debug("StringAE.onTextChanged: not ignoring.") currentText = control.GetValue() if self.showingSample: logger.debug("onTextChanged: removing sample"... |
def __changeTextQuietly(self, control, text): | def __changeTextQuietly(self, control, text, isSample=False, alreadyChanged=False): | def onTextChanged(self, event): if not getattr(self, "ignoreTextChanged", False): control = event.GetEventObject() if getattr(self, 'sampleText', None) is not None: logger.debug("StringAE.onTextChanged: not ignoring.") currentText = control.GetValue() if self.showingSample: logger.debug("onTextChanged: removing sample"... |
logger.debug("__changeTextQuietly: to '%s'", text) control.SetValue(text) | try: logger.debug("__changeTextQuietly: to '%s', sample=%s", text, isSample) normalTextColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWTEXT) if isSample: self.showingSample = True backColor = control.GetBackgroundColour() | def __changeTextQuietly(self, control, text): self.ignoreTextChanged = True logger.debug("__changeTextQuietly: to '%s'", text) # text = "%s %s" % (control.GetFont().GetFaceName(), control.GetFont().GetPointSize()) control.SetValue(text) del self.ignoreTextChanged |
del self.ignoreTextChanged def __setSampleText(self, control, sampleText): logger.debug("__setSampleText: installing sampletext") self.showingSample = True self.__changeTextQuietly(control, sampleText) textColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWTEXT) backColor = control.GetBackgroundColour() def _... | def __shadeBetween(shade, color1, color2): shade1 = shade(color1) shade2 = shade(color2) smaller = min(shade1, shade2) delta = abs(shade1 - shade2) return smaller + (delta / 2) textColor = wx.Colour(__shadeBetween(wx.Colour.Red, normalTextColor, backColor), __shadeBetween(wx.Colour.Green, normalTextColor, backColor), _... | def __changeTextQuietly(self, control, text): self.ignoreTextChanged = True logger.debug("__changeTextQuietly: to '%s'", text) # text = "%s %s" % (control.GetFont().GetFaceName(), control.GetFont().GetPointSize()) control.SetValue(text) del self.ignoreTextChanged |
if not hasattr(item, attributeName): return | def SetAttributeValue (self, item, attributeName, valueString): if not valueString: if not hasattr(item, attributeName): return # no change try: delattr(item, attributeName) except AttributeError: pass else: # lookup an existing item by name, if we can find it, value = Calendar.Location.getLocation (item.itsView, value... | |
pass | return | def SetAttributeValue (self, item, attributeName, valueString): if not valueString: if not hasattr(item, attributeName): return # no change try: delattr(item, attributeName) except AttributeError: pass else: # lookup an existing item by name, if we can find it, value = Calendar.Location.getLocation (item.itsView, value... |
value = Calendar.Location.getLocation (item.itsView, valueString) if getattr(item, attributeName, None) is value: | newValue = Calendar.Location.getLocation (item.itsView, valueString) try: oldValue = getattr(item, attributeName) except AttributeError: oldValue = None if oldValue is newValue: | def SetAttributeValue (self, item, attributeName, valueString): if not valueString: if not hasattr(item, attributeName): return # no change try: delattr(item, attributeName) except AttributeError: pass else: # lookup an existing item by name, if we can find it, value = Calendar.Location.getLocation (item.itsView, value... |
setattr (item, attributeName, value) | setattr (item, attributeName, newValue) | def SetAttributeValue (self, item, attributeName, valueString): if not valueString: if not hasattr(item, attributeName): return # no change try: delattr(item, attributeName) except AttributeError: pass else: # lookup an existing item by name, if we can find it, value = Calendar.Location.getLocation (item.itsView, value... |
wx.DefaultPosition, size) | wx.DefaultPosition, size, style) | def CreateControl (self, forEditing, changeCallback, parentWidget, id, parentBlock, font): # Figure out the size we should be size = wx.DefaultSize if font is not None and parentBlock is not None: measurements = Styles.getMeasurements(font) try: parentWidth = parentBlock.minimumSize.width except: parentWidth = wx.Defa... |
control = wx.Choice(parentWidget, id, wx.DefaultPosition, size) | style = wx.TAB_TRAVERSAL control = wx.Choice(parentWidget, id, wx.DefaultPosition, size, [], style) | def CreateControl (self, forEditing, changeCallback, parentWidget, id, parentBlock, font): |
logger.debug("dequeued: %s %s %s %s", collection, op, item, other) | if DEBUG: logger.debug("dequeued: %s %s %s %s", collection, op, item, other) | def deliverNotifications(view): # first play back the notification queue if not hasattr(view,'notificationQueue'): view.notificationQueue = Queue.Queue() view.addNotificationCallback(repositoryViewCallback) notificationQueue = view.notificationQueue kc = schema.ns("osaf.pim.collections", view).kind_collections while ... |
logger.debug("Collection Changed on %s: %s %s %s %s" % (self, op, item, name, other)) | if DEBUG: logger.debug("Collection Changed on %s: %s %s %s %s", self, op, item, name, other) | def collectionChanged(self, op, item, name, other, positions): """ The method called by the repository level set that backs a collection. |
logger.debug("%s is queuing %s %s" % (self, op, other)) | if DEBUG: logger.debug("%s is queuing %s %s", self, op, other) | def collectionChanged(self, op, item, name, other, positions): """ The method called by the repository level set that backs a collection. |
logger.debug("Delivering %s [%s] %s to %s from %s using %s" % (op, item, other, i, self.itsName, method_name)) | if DEBUG: logger.debug("Delivering %s [%s] %s to %s from %s using %s", op, item, other, i, self.itsName, method_name) | def notifySubscribers(self, op, item, name, other, positions): """ Deliver notifications to all subscribers |
else: logger.debug("Didn't find the specified notification handler named %s for %s" % (method_name, i)) else: | elif DEBUG: logger.debug("Didn't find the specified notification handler named %s for %s", method_name, i) elif DEBUG: | def notifySubscribers(self, op, item, name, other, positions): """ Deliver notifications to all subscribers |
logger.debug("Adding %s to %s...", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) self.inclusions.add (item) | if DEBUG: logger.debug("Adding %s to %s...", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) self.inclusions.add(item) | def add (self, item): """ Add an item to the collection """ |
logger.debug("...removing from exclusions (%s)", self.exclusions.getItemDisplayName().encode('ascii', 'replace')) self.exclusions.remove (item) | if DEBUG: logger.debug("...removing from exclusions (%s)", self.exclusions.getItemDisplayName().encode('ascii', 'replace')) self.exclusions.remove(item) | def add (self, item): """ Add an item to the collection """ |
logger.debug("...removing from trash (%s)", self.trash.getItemDisplayName().encode('ascii', 'replace')) self.trash.remove (item) logger.debug("...done adding %s to %s", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) | if DEBUG: logger.debug("...removing from trash (%s)", self.trash.getItemDisplayName().encode('ascii', 'replace')) self.trash.remove(item) if DEBUG: logger.debug("...done adding %s to %s", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) | def add (self, item): """ Add an item to the collection """ |
logger.debug("Removing %s from %s...", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) | if DEBUG: logger.debug("Removing %s from %s...", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) | def remove (self, item): """ Remove an item from the collection """ |
logger.debug("...adding to exclusions (%s)", self.exclusions.getItemDisplayName().encode('ascii', 'replace')) | if DEBUG: logger.debug("...adding to exclusions (%s)", self.exclusions.getItemDisplayName().encode('ascii', 'replace')) | def remove (self, item): """ Remove an item from the collection """ |
logger.debug("...removing from inclusions (%s)", self.inclusions.getItemDisplayName().encode('ascii', 'replace')) | if DEBUG: logger.debug("...removing from inclusions (%s)", self.inclusions.getItemDisplayName().encode('ascii', 'replace')) | def remove (self, item): """ Remove an item from the collection """ |
logger.debug("...adding to trash (%s)", self.trash.getItemDisplayName().encode('ascii', 'replace')) | if DEBUG: logger.debug("...adding to trash (%s)", self.trash.getItemDisplayName().encode('ascii', 'replace')) | def remove (self, item): """ Remove an item from the collection """ |
logger.debug("...done removing %s from %s", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) | if DEBUG: logger.debug("...done removing %s from %s", item.getItemDisplayName().encode('ascii', 'replace'), self.getItemDisplayName().encode('ascii', 'replace')) | def remove (self, item): """ Remove an item from the collection """ |
if buildenv['version'] == 'debug': additional_path = buildenv['root'] + os.sep + 'debug' + os.sep + \ 'lib' additional_path_rel = buildenv['root'] + os.sep + 'release' + \ os.sep + 'lib' additional_path = additional_path + os.pathsep + additional_path_rel else: additional_path = buildenv['root'] + os.sep + 'release' + ... | ver = buildenv['version'] additional_path=os.path.join(buildenv['root'],ver,'lib')+\ os.pathsep + os.path.join(buildenv['root'],ver,'db','lib')+\ os.pathsep + os.path.join(buildenv['root'],ver,'dbxml','lib') | def setupEnvironment(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'release' + os.sep + 'bin' + \ os.pathsep + buildenv[... |
if buildenv['version'] == 'debug': additional_path = os.path.join( buildenv['root'], 'debug', 'Library', 'Frameworks') else: additional_path = os.path.join( buildenv['root'], 'release', 'Library', 'Frameworks') | additional_path = os.path.join( buildenv['root'], ver, 'Library', 'Frameworks') | def setupEnvironment(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'release' + os.sep + 'bin' + \ os.pathsep + buildenv[... |
dc.SetPen(wx.BLACK_PEN) | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item if item.isDeleted(): return | |
if '__WXGTK__' not in wx.PlatformInfo: self.timeHeight += 3 y += self.timeHeight | if '__WXGTK__' in wx.PlatformInfo: y += 1 else: y += 3 | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item if item.isDeleted(): return |
navigationRow.Add((5,5), 0) | navigationRow.Add((10,1), 0) | def __init__(self, parent, id, tzCharacterStyle, *arguments, **keywords): super(wxCalendarControl, self).__init__(parent, id, *arguments, **keywords) app = wx.GetApp() self.allDayCloseArrowImage = app.GetImage("AllDayCloseArrow_whitebg.png") self.allDayOpenArrowImage = app.GetImage("AllDayOpenArrow_whitebg.png") self.... |
size = event.GetSize() | size = self.GetClientSize() | def OnSize(self, event): if not Globals.wxApplication.insideSynchronizeFramework: size = event.GetSize() widthMinusLastColumn = 0 assert self.GetColumnCount() > 0, "We're assuming that there is at least one column" for column in xrange (self.GetColumnCount() - 1): widthMinusLastColumn += self.GetColumnWidth (column) la... |
size = event.GetSize() | def OnSize(self, event): if not Globals.wxApplication.insideSynchronizeFramework: size = event.GetSize() if isinstance (self, wx.gizmos.TreeListCtrl): widthMinusLastColumn = 0 assert self.GetColumnCount() > 0, "We're assuming that there is at least one column" for column in xrange (self.GetColumnCount() - 1): widthMinu... | |
self.SetSize (size) event.Skip() | event.Skip() | def OnSize(self, event): if not Globals.wxApplication.insideSynchronizeFramework: size = event.GetSize() if isinstance (self, wx.gizmos.TreeListCtrl): widthMinusLastColumn = 0 assert self.GetColumnCount() > 0, "We're assuming that there is at least one column" for column in xrange (self.GetColumnCount() - 1): widthMinu... |
('Creating_new_event_from_the_File_Menu_after_large_data_import', ' ('Creating_a_new_event_in_the_Cal_view_after_large_data_import', ' ('Creating_a_new_calendar_after_large_data_import', ' | ('creating_new_event_from_the_file_menu_after_large_data_import', ' ('creating_a_new_event_in_the_cal_view_after_large_data_import', ' ('creating_a_new_calendar_after_large_data_import', ' | def __init__(self): self._app_path = os.getcwd() self._options = { 'tbox_data': '.', # raw .perf files 'html_data': '.', # where to output generated .html 'perf_data': '.', # where to store processed data 'verbose': False, 'debug': False, 'cleanup': False, # remove .perf files when processed 'c... |
('Switching_view_after_importing_large_data', 'Switch Views with 3000 event calendar'), ('Stamping_after_large_data_import', 'Stamp with 3000 event calendar'), | ('switching_view_after_importing_large_data', 'Switch Views with 3k event calendar'), ('stamping_after_large_data_import', 'Stamp with 3k event calendar'), | def __init__(self): self._app_path = os.getcwd() self._options = { 'tbox_data': '.', # raw .perf files 'html_data': '.', # where to output generated .html 'perf_data': '.', # where to store processed data 'verbose': False, 'debug': False, 'cleanup': False, # remove .perf files when processed 'c... |
'Switching_view_after_importing_large_data': 1, 'Stamping_after_large_data_import': 1, | 'switching_view_after_importing_large_data': 1, 'stamping_after_large_data_import': 1, | def __init__(self): self._app_path = os.getcwd() self._options = { 'tbox_data': '.', # raw .perf files 'html_data': '.', # where to output generated .html 'perf_data': '.', # where to store processed data 'verbose': False, 'debug': False, 'cleanup': False, # remove .perf files when processed 'c... |
print 'loading %s' % self._options['configfile'] | def loadConfiguration(self): items = { 'configfile': ('-c', '--config', 's', self._options['configfile'], '', ''), 'verbose': ('-v', '--verbose', 'b', self._options['verbose'], '', ''), 'debug': ('-d', '--debug', 'b', self._options['debug'], '', ''), 'cleanup': ('-x', '--cleanup', 'b', self._o... | |
print '%s: %d %d' % (buildname, len(lines), p) | def loadPerfData(self): if self._options['debug']: t = time.time() | |
def variance(self, values): n = len(values) v = 0 avg = 0 if n > 1: sum = 0 | def standardDeviation(self, values): count = len(values) stdDev = 0.0 mean = 0.0 s = 0.0 if count > 1: | def variance(self, values): n = len(values) v = 0 avg = 0 |
for item in values: avg = avg + item sum = sum + item*item avg = avg / n x = (sum - n*avg*avg) / n*n if x < 0: x = abs(x) v = math.sqrt(x) | for n in xrange(1, count + 1): delta = values[n - 1] - mean mean = mean + delta / float(n) s = s + delta * (values[n - 1] - mean) var = s / (n - 1) stdDev = math.sqrt(var) | def variance(self, values): n = len(values) v = 0 avg = 0 |
avg = values[0] return (v, n, avg) def generateVarianceDetailPage(self, pagename, tests, startdate, enddate): | mean = values[0] return (stdDev, count, mean) def generateDetailPage(self, pagename, tests, startdate, enddate): | def variance(self, values): n = len(values) v = 0 avg = 0 |
indexpage.append('<h1>Performance Variance for the previous 7 days</h1>\n') | indexpage.append('<h1>Performance Standard Deviation for the previous 7 days</h1>\n') | def generateVarianceDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
detailpage.append('<h1>Performance Variance for the previous 7 days</h1>\n') | detailpage.append('<h1>Performance Standard Deviation for the previous 7 days</h1>\n') | def generateVarianceDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
indexpage.append('<tr><th>Build</th><th>Variance</th><th>Count</th><th>Average</th><th>0</th><th>-1</th><th>-2</th><th>-3</th><th>-4</th><th>-5</th><th>-6</th><th>-7</th><th>-8</th></tr>\n') | indexpage.append('<tr><th>Build</th><th>Std.Dev.</th><th>Count</th><th>Average</th><th>0</th><th>-1</th><th>-2</th><th>-3</th><th>-4</th><th>-5</th><th>-6</th><th>-7</th><th>-8</th></tr>\n') | def generateVarianceDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
if self._options['debug']: print "%s %s %s %s %f" % (testkey, buildkey, datekey, hour, datapoint[DP_AVERAGE]) | def generateVarianceDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} | |
(v, n, avg) = self.variance(values) | (v, n, avg) = self.standardDeviation(values) if self._options['debug']: print "std.dev: %02.5f average: %02.3f count: %d" % (v, avg, n) | def generateVarianceDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
detailpage.append('<p>Sample Average is %2.3f and variance is %2.3f</p>\n' % (avg, v)) detailpage.append('<!-- avg: %02.5f count: %d var: %02.5f -->\n' % (avg, n, v)) | detailpage.append('<p>Sample Average is %2.3f and std.dev is %2.3f</p>\n' % (avg, v)) detailpage.append('<!-- avg: %02.5f count: %d stddev: %02.5f -->\n' % (avg, n, v)) | def generateVarianceDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
def _generateSummaryDetailLine(self, platforms, testkey, enddate, testDisplayName, previousTargets): | def _generateSummaryDetailLine(self, platforms, testkey, enddate, testDisplayName, currentValue, previousValue): | def _generateSummaryDetailLine(self, platforms, testkey, enddate, testDisplayName, previousTargets): line = '<tr><td><a href="detail_%s.html#%s" target="_new">%s</a></td>' % (enddate, testkey, testDisplayName) graph = [] if testkey in self.SummaryTargets.keys(): targetAvg = self.SummaryTargets[testkey] else: targetAv... |
avg = platforms[key]['avg'] * 60 | current = currentValue[key] * 60 previous = previousValue[key] * 60 | def _generateSummaryDetailLine(self, platforms, testkey, enddate, testDisplayName, previousTargets): line = '<tr><td><a href="detail_%s.html#%s" target="_new">%s</a></td>' % (enddate, testkey, testDisplayName) graph = [] if testkey in self.SummaryTargets.keys(): targetAvg = self.SummaryTargets[testkey] else: targetAv... |
variance = platforms[key]['var'] previous = previousTargets[key] * 60 c_diff = avg - previous | stdDev = platforms[key]['stddev'] c_diff = current - previous | def _generateSummaryDetailLine(self, platforms, testkey, enddate, testDisplayName, previousTargets): line = '<tr><td><a href="detail_%s.html#%s" target="_new">%s</a></td>' % (enddate, testkey, testDisplayName) graph = [] if testkey in self.SummaryTargets.keys(): targetAvg = self.SummaryTargets[testkey] else: targetAv... |
s = colorDelta(avg, previous, variance) timeClass = self.colorTime(testkey, avg, variance) graph.append('%s | %s | %s | %s | %02.3f | %02.3f | %03.1f\n' % (enddate, key, testkey, revision, avg, c_diff, c_perc)) | s = colorDelta(current, previous, stdDev) timeClass = self.colorTime(testkey, current, stdDev) graph.append('%s | %s | %s | %s | %02.3f | %02.3f | %03.1f\n' % (enddate, key, testkey, revision, current, c_diff, c_perc)) if self._options['debug']: print key, testkey, targetAvg, current, c_perc, c_diff, s, stdDe... | def _generateSummaryDetailLine(self, platforms, testkey, enddate, testDisplayName, previousTargets): line = '<tr><td><a href="detail_%s.html#%s" target="_new">%s</a></td>' % (enddate, testkey, testDisplayName) graph = [] if testkey in self.SummaryTargets.keys(): targetAvg = self.SummaryTargets[testkey] else: targetAv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.