rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
heightGutter = 9 if self.buttonsLabeled: heightGutter += 14 | def instantiateWidget (self): self.ensureDynamicChildren () # @@@DLD - remove this workaround for previous wxWidgets issues heightGutter = 9 if self.buttonsLabeled: heightGutter += 14 toolbar = wxToolbar(self.parentBlock.widget, Block.Block.getWidgetID(self), wx.DefaultPosition, (-1, self.toolSize.height+heightGutter),... | |
(-1, self.toolSize.height+heightGutter), | (-1, self.toolSize.height), | def instantiateWidget (self): self.ensureDynamicChildren () # @@@DLD - remove this workaround for previous wxWidgets issues heightGutter = 9 if self.buttonsLabeled: heightGutter += 14 toolbar = wxToolbar(self.parentBlock.widget, Block.Block.getWidgetID(self), wx.DefaultPosition, (-1, self.toolSize.height+heightGutter),... |
if isitem(other) and other.isDeleting(): logger.error("setting bi-ref on attribute '%s' of %s with an item that is being deleted: %s", key, item._repr_(), other._repr_()) return False | def _verifyAssignment(self, key, other, logger, repair=False): | |
attrType = item.getAttributeAspect(attribute, 'type') if type(value) in (str, unicode, int, float): | try: attrType = item.getAttributeAspect(attribute, 'type') if type(value) in (str, unicode, int, float): needSerialized = False else: needSerialized = True curValue = getattr(item, attribute, "") if curValue is None: mimeType, encoding, curSerialized = None, None, curValue else: (mimeType, encoding, curSerialized) = ... | def importValue(item, changes, attribute, value, previousView, updateCallback=None, setCallback=None): """ Conditionally set a value (brought in via the sharing layer) on an item, depending on whether the new value is different than the old one, and whether the value has really changed remotely since the last sync. Con... |
else: needSerialized = True curValue = getattr(item, attribute, "") if curValue is None: mimeType, encoding, curSerialized = None, None, curValue else: (mimeType, encoding, curSerialized) = \ serializeLiteral(getattr(item, attribute, ""), attrType) (mimeType, encoding, newSerialized) = serializeLiteral(value, attrTyp... | def importValue(item, changes, attribute, value, previousView, updateCallback=None, setCallback=None): """ Conditionally set a value (brought in via the sharing layer) on an item, depending on whether the new value is different than the old one, and whether the value has really changed remotely since the last sync. Con... | |
phone.phoneType = random.choice(PHONETYPES) | def GeneratePhoneNumbers(): list = [] for i in range(random.randint(1, 3)): phone = Contacts.PhoneNumber() phone.phoneNumber = GeneratePhoneNumber() phone.phoneType = random.choice(PHONETYPES) list.append(phone) return list | |
item.untilIsDate = True item.until = value self.AttributeChanged() if not item.isDeleted(): | def SetAttributeValue(self, item, attributeName, valueString): eventTZ = item.startTime.tzinfo if attributeName != 'until': attributeName = 'until' try: item = item.rruleset.rrules.first() except AttributeError: assert False, "Hey - Setting 'ends' on an event without a recurrence rule?" # If the user removed the stri... | |
self.GetAttributeValue(item, attributeName)) | pim.shortDateFormat.format(value)) def changeRecurrenceEnd(self, item, newEndValue): item.untilIsDate = True item.until = value self.AttributeChanged() wx.CallAfter(changeRecurrenceEnd, self, item, value) | def SetAttributeValue(self, item, attributeName, valueString): eventTZ = item.startTime.tzinfo if attributeName != 'until': attributeName = 'until' try: item = item.rruleset.rrules.first() except AttributeError: assert False, "Hey - Setting 'ends' on an event without a recurrence rule?" # If the user removed the stri... |
if timeInfo: self.logger.endAction(True) | 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... | |
assert candidate, "Couldn't find a dynamic child to synchronize with" | assert candidate is not None, "Couldn't find a dynamic child to synchronize with" | def synchToDynamicBlock (block, isChild): """ Function to set and remember the dynamic Block we synch to. If it's a child block, it will be used so we must sync, and remember it for later. If it's not a child, we only need to sync if we had a different block last time. """ previous = Globals.mainView.lastDynamicBlock i... |
chandlerDir = os.path.join(workingDir, "chandler") | chandlerDir = os.path.join(workingDir, 'chandler') logDir = os.path.join(chandlerDir, 'test_profile') chandlerLog = os.path.join(logDir, 'chandler.log') FuncTestLog = os.path.join(logDir, 'FunctionalTestSuite.log') | def doFunctionalTests(releaseMode, workingDir, log): 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', runChandler) elif releaseMode == 'release': ... |
os.remove('chandler.log') | os.remove(chandlerLog) | def doFunctionalTests(releaseMode, workingDir, log): 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', runChandler) elif releaseMode == 'release': ... |
'--profileDir=.', | '--profileDir=%s' % logDir, | def doFunctionalTests(releaseMode, workingDir, log): 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', runChandler) elif releaseMode == 'release': ... |
hardhatutil.dumpOutputList(outputList, log) | def doFunctionalTests(releaseMode, workingDir, log): 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', runChandler) elif releaseMode == 'release': ... | |
log.write("Test log:\n") hardhatutil.dumpOutputList(e.outputList, log) | def doFunctionalTests(releaseMode, workingDir, log): 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', runChandler) elif releaseMode == 'release': ... | |
log.write("chandler.log:\n") try: CopyLog('chandler.log', log) except: pass log.write(separator) log.write("FunctionalTestSuite.log:\n") try: CopyLog('FunctionalTestSuite.log', log) except: pass log.write(separator) | def doFunctionalTests(releaseMode, workingDir, log): 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', runChandler) elif releaseMode == 'release': ... | |
'--create', '--profileDir=%s' % chandlerDir, '--scriptFile=%s' % testFile] | '--create', '--profileDir=%s' % logDir, '--scriptFile=%s' % testFile] | def doPerformanceTests(hardhatScript, mode, workingDir, outputDir, buildVersion, log): chandlerDir = os.path.join(workingDir, "chandler") testDir = os.path.join(chandlerDir, 'tools', 'QATestScripts', 'Performance') if buildenv['version'] == 'debug': python = buildenv['python_d'] pythonOpts = '' elif buildenv['vers... |
CopyLog('chandler.log', log) | CopyLog(chandlerLog, log) | def doPerformanceTests(hardhatScript, mode, workingDir, outputDir, buildVersion, log): chandlerDir = os.path.join(workingDir, "chandler") testDir = os.path.join(chandlerDir, 'tools', 'QATestScripts', 'Performance') if buildenv['version'] == 'debug': python = buildenv['python_d'] pythonOpts = '' elif buildenv['vers... |
inclusions=[pim_ns.allCollection, pim_ns.trashCollection, pim_ns.inCollection, pim_ns.outCollection] | inclusions=[pim_ns.allCollection, pim_ns.inCollection, pim_ns.outCollection, pim_ns.trashCollection] | def installParcel(parcel, oldVersion=None): import scripts as Scripts from osaf import sharing, startup from osaf.framework import scripting pim_ns = schema.ns('osaf.pim', parcel) sharing_ns = schema.ns('osaf.sharing', parcel) me = pim.Contact.update(parcel, 'me', displayName=_(u'Me'), contactName=pim.ContactName.up... |
if account.useSSL == useSSL and account.host == host and account.port == port and account.path == path: | accountPath = account.path.strip('/') if account.useSSL == useSSL and account.host == host and account.port == port and accountPath == path: | def findMatchingWebDAVAccount(view, url): """ Find a WebDAV account which corresponds to a URL. The url being passed in is for a collection -- it will include the collection name in the url. We need to find a webdav account who has been set up to operate on the parent directory of this collection. For example, if the... |
if __debug__: createNewRepository = hasattr (self, 'CreateNewRepository') else: createNewRepository = 0 if self.version != Application.VERSION or createNewRepository: | if self.version != Application.VERSION: | def __setstate__(self, dict): """ Data often lives a long time, even longer than code and we may need to update it over time as it's structure changes. A convienent way to do this is to check for an old version in __setstate__, which is called each time the object is loaded, and update the data as necessary. Until the ... |
if __debug__ and createNewRepository: self.CreateNewRepository = 1 | def __setstate__(self, dict): """ Data often lives a long time, even longer than code and we may need to update it over time as it's structure changes. A convienent way to do this is to check for an old version in __setstate__, which is called each time the object is loaded, and update the data as necessary. Until the ... | |
EVT_MENU(self, XRCID ('CreateNewRepository'), self.OnCreateNewRepository) | def loadClass(moduleName, className): return getattr(__import__(moduleName, {}, {}, className), className) | |
if __debug__: def OnCreateNewRepository (self, event): if (hasattr (self.model, 'CreateNewRepository')): del self.model.CreateNewRepository else: self.model.CreateNewRepository = true menuBar = self.wxMainFrame.GetMenuBar () menuBar.Check (XRCID ('CreateNewRepository'), hasattr (self.model, 'CreateNewRepository')) | def loadClass(moduleName, className): return getattr(__import__(moduleName, {}, {}, className), className) | |
return self[unicode(section)].as_float(unicode(option)) | numberAsString = self[unicode(section)][unicode(option)] return ICUnumberParse(numberAsString).getDouble() | def getfloat(self, section, option): try: return self[unicode(section)].as_float(unicode(option)) except: return None |
self.currentPanel.Destroy() | self.innerSizer.Detach(self.currentPanel) self.currentPanel.Hide() wx.CallAfter(self.currentPanel.Destroy) | def __SwapDetailPane(self, index): """ Given an index into the account list, store the current pane's (if any) contents to the data list, destroy current pane, determine type of pane to pull in, load it, populated it. """ |
self.accountsList.SetFocus() | def __SwapDetailPane(self, index): """ Given an index into the account list, store the current pane's (if any) contents to the data list, destroy current pane, determine type of pane to pull in, load it, populated it. """ | |
onDeleteEventUpdateUI = onRemoveEventUpdateUI | def onDeleteEventUpdateUI(self, event): """Bug 5717, OnDelete shouldn't be active in a text ctrl on Mac.""" event.arguments['Enable'] = '__WXMAC__' not in wx.PlatformInfo | def onRemoveEventUpdateUI(self, event): (startSelect, endSelect) = self.GetSelection() event.arguments ['Enable'] = startSelect < self.GetLastPosition() |
items.add(_item) | if filter is None or filter(_item) is True: items.add(_item) | def collectChildren(_item): if not _item in items: items.add(_item) for child in _item.iterChildren(): collectItems(child) |
inviteeEmailAddress = invitee.emailAddress inviteeStringsList.append(inviteeEmailAddress) inviteeContact = Contacts.Contact.getContactForEmailAddress(self.itsView, inviteeEmailAddress) | inviteeList.append(invitee) inviteeStringsList.append(invitee.emailAddress) inviteeContact = Contacts.Contact.getContactForEmailAddress(self.itsView, invitee.emailAddress) | def onShareItemEvent (self, event): """ Share an ItemCollection. """ itemCollection = event.arguments ['item'] |
self.setStatusMessage (_("inviting %s") % inviteeStringsList) | self.setStatusMessage (_("inviting %s") % ", ".join(inviteeStringsList)) | def onShareItemEvent (self, event): """ Share an ItemCollection. """ itemCollection = event.arguments ['item'] |
itemCollection.displayName, inviteeStringsList) | itemCollection, inviteeList) | def onShareItemEvent (self, event): """ Share an ItemCollection. """ itemCollection = event.arguments ['item'] |
self.item._version) | 0) | def isDirty(self): if not self.dirty: sharedVersion = self.item.sharedVersion if sharedVersion == 0: sharedVersion = 1 self.item.itsView.mapHistory(self._histfunc, sharedVersion, self.item._version) return self.dirty |
log.debug('Checking dirty...') log.debug(' values: %s' % (values)) log.debug(' refs: %s' % (references)) | log.info('%s|- Checking dirty...' % (OFFSET())) log.info('%s| |- values: %s' % (OFFSET(), values)) log.info('%s| `- refs: %s' % (OFFSET(), references)) | def _histfunc(self, item, version, status, values, references): if self.dirty: return if self.item == item: log.debug('Checking dirty...') log.debug(' values: %s' % (values)) log.debug(' refs: %s' % (references)) for value in values: if value not in [u'etag', u'sharedURL', u'sharedVersion']: self.dirty = True retur... |
log.info('Syncing %s (%s)' % (unicode(dav.url), item.getItemDisplayName())) log.info('|- needsPut %s' % (needsPut)) log.info('|- localChanges %s' % (localChanges)) log.info('| `- versions %s : %s' % (item.sharedVersion, item._version)) log.info('`- serverChanges %s' % (serverChanges)) | log.info('%s|- needsPut %s' % (offset, needsPut)) log.info('%s|- localChanges %s' % (offset, localChanges)) log.info('%s| `- versions %s : %s' % (offset, item.sharedVersion, item._version)) log.info('%s`- serverChanges %s' % (offset, serverChanges)) | def syncItem(dav, item): # changes flags needsPut = False localChanges = False serverChanges = False # see if the local version has changed by comparing the last shared version # with the item's current version if item.sharedVersion != item._version: if item.sharedVersion == -1: localChanges = True else: localChanges ... |
log.info(' |-- our etag %s' % (etag)) log.info(' `-- svr etag %s' % (davETag)) | log.info('%s |-- our etag %s' % (offset, etag)) log.info('%s `-- svr etag %s' % (offset, davETag)) | def syncItem(dav, item): # changes flags needsPut = False localChanges = False serverChanges = False # see if the local version has changed by comparing the last shared version # with the item's current version if item.sharedVersion != item._version: if item.sharedVersion == -1: localChanges = True else: localChanges ... |
log.debug('Doing merge') | def merge(dav, item, davItem, hasLocalChanges): # for now, just pull changes from the server and overwrite local changes... log.debug('Doing merge') item.etag = davItem.etag syncFromServer(item, davItem) | |
log.info('Merging List: %s in %s' % (attrName, str(item))) | def mergeList(item, attrName, nodes, nodesAreItemRefs): list = item.getAttributeValue(attrName, default=[]) serverList = [] for node in nodes: if nodesAreItemRefs: try: value = Dav.DAV(node.content).get() except Dav.NotFound: value = None else: value = node.content if value: serverList.append(value) try: log.info('M... | |
log.info('adding %s to list %s' % (i, item)) | log.info('%sAdding %s to list %s' % (OFFSET(), i, item)) | def mergeList(item, attrName, nodes, nodesAreItemRefs): list = item.getAttributeValue(attrName, default=[]) serverList = [] for node in nodes: if nodesAreItemRefs: try: value = Dav.DAV(node.content).get() except Dav.NotFound: value = None else: value = node.content if value: serverList.append(value) try: log.info('M... |
for i in list: if i not in serverList: item.removeValue(attrName, i) log.info('%sremoving %s from list %s' % (OFFSET(), i, item)) | def mergeList(item, attrName, nodes, nodesAreItemRefs): list = item.getAttributeValue(attrName, default=[]) serverList = [] for node in nodes: if nodesAreItemRefs: try: value = Dav.DAV(node.content).get() except Dav.NotFound: value = None else: value = node.content if value: serverList.append(value) try: log.info('M... | |
u'sharedURL', u'sharedUUID', u'collectionOwner']: | u'sharedURL', u'sharedUUID', u'collectionOwner' u'itemCollectionResults']: | 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... |
item.itsKind = davItem.itsKind | def syncFromServer(item, davItem): item.itsKind = davItem.itsKind kind = davItem.itsKind for (name, attr) in kind.iterAttributes(True): value = davItem.getAttribute(attr) if not value: continue log.info('Getting: %s (%s)' % (name, attr.type.itsName)) # see if its an ItemRef or not if isinstance(attr.type, Kind): # ... | |
log.info('Getting: %s (%s)' % (name, attr.type.itsName)) | log.info('%sGetting: %s (%s)' % (OFFSET(), name, attr.type.itsName)) | def syncFromServer(item, davItem): item.itsKind = davItem.itsKind kind = davItem.itsKind for (name, attr) in kind.iterAttributes(True): value = davItem.getAttribute(attr) if not value: continue log.info('Getting: %s (%s)' % (name, attr.type.itsName)) # see if its an ItemRef or not if isinstance(attr.type, Kind): # ... |
log.info('Got.....: %s' % (value)) | log.info('%sGot.....: %s' % (OFFSET(), value)) | def syncFromServer(item, davItem): item.itsKind = davItem.itsKind kind = davItem.itsKind for (name, attr) in kind.iterAttributes(True): value = davItem.getAttribute(attr) if not value: continue log.info('Getting: %s (%s)' % (name, attr.type.itsName)) # see if its an ItemRef or not if isinstance(attr.type, Kind): # ... |
image = button.getButtonImage (item, mouseOver) | image = button.getButtonImage (item, mouseOver, isSelected) | def Draw (self, grid, attr, dc, rect, row, col, isSelected): DrawingUtilities.SetTextColorsAndFont (grid, attr, dc, isSelected) |
def getButtonImage (self, item, mouseOverFlag): | def getButtonImage (self, item, mouseOverFlag, isSelected): | def getButtonImage (self, item, mouseOverFlag): """ The rules for naming icons are complicated, which is a reflection of complexity of our sidebar design. Here is a description of the rules: |
if image is not None and userCollection.colorizeIcon: userCollection.ensureColor() color = userCollection.color rgbValue = DrawingUtilities.color2rgb(color.red, color.green, color.blue) hsvValue = rgb_to_hsv(*rgbValue) image.RotateHue (hsvValue[0]) | def getButtonImage (self, item, mouseOverFlag): """ The rules for naming icons are complicated, which is a reflection of complexity of our sidebar design. Here is a description of the rules: | |
def getButtonImage (self, item, mouseOverFlag): | def getButtonImage (self, item, mouseOverFlag, isSelected): | def getButtonImage (self, item, mouseOverFlag): """ The rules for naming icons are complicated, which is a reflection of complexity of our sidebar design, so here is a summary of the rules: |
image = app.GetImage (imagePrefix + iconName + mouseDown + mouseOver + imageSuffix) | image = app.GetRawImage (imagePrefix + iconName + mouseDown + mouseOver + imageSuffix) | def getButtonImage (self, item, mouseOverFlag): """ The rules for naming icons are complicated, which is a reflection of complexity of our sidebar design, so here is a summary of the rules: |
image = app.GetImage (imagePrefix + iconName + mouseDown + imageSuffix) | image = app.GetRawImage (imagePrefix + iconName + mouseDown + imageSuffix) | def getButtonImage (self, item, mouseOverFlag): """ The rules for naming icons are complicated, which is a reflection of complexity of our sidebar design, so here is a summary of the rules: |
image = app.GetImage (imagePrefix + iconName + imageSuffix) | image = app.GetRawImage (imagePrefix + iconName + imageSuffix) if image is not None: if isSelected: color = self.buttonOwner.widget.GetSelectionForeground() rgbValue = DrawingUtilities.color2rgb(color.Red(), color.Green(), color.Blue()) hsvValue = rgb_to_hsv(*rgbValue) image.SetBrightness (hsvValue[2]) image = wx.... | def getButtonImage (self, item, mouseOverFlag): """ The rules for naming icons are complicated, which is a reflection of complexity of our sidebar design, so here is a summary of the rules: |
mainFrame.SetFocus() | def onQuitEvent (self, event): mainFrame = wx.GetApp().mainFrame mainFrame.SetFocus() # Force any in-progress edit to save its value. mainFrame.Close() windows = wx.GetTopLevelWindows() for window in windows: window.Close() | |
self.finishDetailViewChanges() self.itsView.commit() self.setStatusMessage ('') def finishDetailViewChanges(self): | def RepositoryCommitWithStatus (self): """ Do a repository commit with notice posted in the Status bar. """ self.setStatusMessage (_(u"committing changes to the repository...")) | |
self.itsView.commit() self.setStatusMessage ('') | def RepositoryCommitWithStatus (self): """ Do a repository commit with notice posted in the Status bar. """ self.setStatusMessage (_(u"committing changes to the repository...")) | |
allDayCanvas.widget.OnSelectItem(canvasItem) | allDayCanvas.widget.OnSelectItem(canvasItem.GetItem()) | def SelectItem(self): """ Select the item in chandler (summary view or calendar view selection) """ #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 buttonState: App_ns.summary.select(self.item) #if... |
timedCanvas.widget.OnSelectItem(canvasItem) | timedCanvas.widget.OnSelectItem(canvasItem.GetItem()) | def SelectItem(self): """ Select the item in chandler (summary view or calendar view selection) """ #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 buttonState: App_ns.summary.select(self.item) #if... |
def _verifyCalendarItems(calendar, location, recurrence, reminder): | def _verifyCalendarItems(calendar, location, recurrence): | def _verifyCalendarItems(calendar, location, recurrence, reminder): self.assertEqual(calendar.displayName, "simple calendar") self.assertEqual(calendar.getAttributeValue('displayName'), "simple calendar") |
self.assertEqual(Calendar.CalendarParcel.getReminderKind(), self.rep.find(Path(calendarPath, 'Reminder'))) | def _verifyCalendarItems(calendar, location, recurrence, reminder): self.assertEqual(calendar.displayName, "simple calendar") self.assertEqual(calendar.getAttributeValue('displayName'), "simple calendar") | |
reminderItem = Calendar.Reminder("reminderItem") | def _verifyCalendarItems(calendar, location, recurrence, reminder): self.assertEqual(calendar.displayName, "simple calendar") self.assertEqual(calendar.getAttributeValue('displayName'), "simple calendar") | |
recurrenceItem, reminderItem) | recurrenceItem) | def _verifyCalendarItems(calendar, location, recurrence, reminder): self.assertEqual(calendar.displayName, "simple calendar") self.assertEqual(calendar.getAttributeValue('displayName'), "simple calendar") |
reminderItem = contentItemParent.getItemChild("reminderItem") | def _verifyCalendarItems(calendar, location, recurrence, reminder): self.assertEqual(calendar.displayName, "simple calendar") self.assertEqual(calendar.getAttributeValue('displayName'), "simple calendar") | |
item = getattr(item, 'proxiedItem', item) | def SetAttributeValue(self, item, attributeName, value): """ Set the value of the attribute given by the value. """ assert value != RecurrenceAttributeEditor.customIndex # Changing the recurrence period on a non-master item could delete # this very 'item'; we'll try to select the "same" occurrence # afterwards ... asse... | |
else: oldIndex = self.GetAttributeValue(event, attributeName) if oldIndex == value: return | itemToSelect = None if not master.itsItem.isDeleted(): itemToSelect = master.itsItem elif not firstOccurrence.itsItem.isDeleted(): itemToSelect = firstOccurrence.itsItem else: if (recurrenceID == master.recurrenceID and event.modificationFor is None): newMaster = master else: newMaster = event | def SetAttributeValue(self, item, attributeName, value): """ Set the value of the attribute given by the value. """ assert value != RecurrenceAttributeEditor.customIndex # Changing the recurrence period on a non-master item could delete # this very 'item'; we'll try to select the "same" occurrence # afterwards ... asse... |
itemToSelect = item if master.itsItem.isDeleted() or not item.isDeleted(): master = itemToSelect = event.getMaster().itsItem | def SetAttributeValue(self, item, attributeName, value): """ Set the value of the attribute given by the value. """ assert value != RecurrenceAttributeEditor.customIndex # Changing the recurrence period on a non-master item could delete # this very 'item'; we'll try to select the "same" occurrence # afterwards ... asse... | |
if item.isDeleted(): itemToSelect = master.getRecurrenceID(recurrenceID) or master itemToSelect = itemToSelect.itsItem | assert not newMaster.itsItem.isDeleted() occurrence = newMaster.getRecurrenceID(newMaster.recurrenceID) itemToSelect = occurrence.itsItem | def SetAttributeValue(self, item, attributeName, value): """ Set the value of the attribute given by the value. """ assert value != RecurrenceAttributeEditor.customIndex # Changing the recurrence period on a non-master item could delete # this very 'item'; we'll try to select the "same" occurrence # afterwards ... asse... |
item = getattr(item, 'proxiedItem', item) | def SetAttributeValue(self, item, attributeName, value): """ Set the value of the attribute given by the value. """ assert value != RecurrenceAttributeEditor.customIndex # Changing the recurrence period on a non-master item could delete # this very 'item'; we'll try to select the "same" occurrence # afterwards ... asse... | |
sidebarBPB = Block.Block.findBlockByName("SidebarBranchPointBlock") sidebarBPB.childrenBlocks.first().postEventByName( 'SelectItemsBroadcast', {'items':[itemToSelect]} ) | BroadcastSelect(itemToSelect) | def SetAttributeValue(self, item, attributeName, value): """ Set the value of the attribute given by the value. """ assert value != RecurrenceAttributeEditor.customIndex # Changing the recurrence period on a non-master item could delete # this very 'item'; we'll try to select the "same" occurrence # afterwards ... asse... |
item.untilIsDate = True item.until = value | if event.itsItem.isDeleted(): return changed = False if not getattr(item, 'untilIsDate', False): item.untilIsDate = True changed = True if getattr(item, 'until', None) != newEndValue: item.until = newEndValue changed = True if changed: selection = master.getRecurrenceID(recurrenceID) if selection is not None: sel... | def changeRecurrenceEnd(self, item, newEndValue): item.untilIsDate = True item.until = value |
self._getDisplayNameForShare(cvSelf.share) | cvSelf.share.displayName | def _get(self, contentView, updateCallback=None, getPhrase=None): |
def Layout(self, *a, **k): return super(wxSplitterWindow, self).__init__(*a, **k) | def Layout(self, *arguments, **keywords): return super(wxSplitterWindow, self).Layout(*arguments, **keywords) | def Layout(self, *a, **k): return super(wxSplitterWindow, self).__init__(*a, **k) |
self.Fit() | def __init__(self, parent, proxy, cancelCallbacks): self.proxy = proxy self.cancelCallbacks = cancelCallbacks self._init_ctrls(parent) | |
keys.sort() latest = latestUpdate[keys[2]] | keys.reverse() latest = latestUpdate[keys[0]] | def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runtime) ] }}}} |
def get(self, updateCallback=None): self._get(updateCallback=updateCallback) def _get(self, previousView=None, updateCallback=None): | def _get(self, contentView, updateCallback=None): | def get(self, updateCallback=None): self._get(updateCallback=updateCallback) |
self.share.format.importProcess(text, item=self.share, updateCallback=updateCallback) | cvSelf = contentView.findUUID(self.itsUUID) self.share.format.importProcess(contentView, text, item=cvSelf.share, updateCallback=updateCallback) | def _get(self, previousView=None, updateCallback=None): |
for item in self.share.contents: self.share.items.append(item) | for item in cvSelf.share.contents: cvSelf.share.items.append(item) | def _get(self, previousView=None, updateCallback=None): |
self.item = itemOrEvent.itsItem | self.event = EventStamp(itemOrEvent) | def __init__(self, bounds, itemOrEvent): """ @param bounds: the bounds of the item as drawn on the canvas. @type bounds: wx.Rect @param item: the item drawn on the canvas in these bounds @type itemOrEvent: C{Item} or C{EventStamp} """ # @@@ scaffolding: resize bounds is the lower 5 pixels self._bounds = bounds if isin... |
self.item = itemOrEvent | self.event = itemOrEvent.itsItem | def __init__(self, bounds, itemOrEvent): """ @param bounds: the bounds of the item as drawn on the canvas. @type bounds: wx.Rect @param item: the item drawn on the canvas in these bounds @type itemOrEvent: C{Item} or C{EventStamp} """ # @@@ scaffolding: resize bounds is the lower 5 pixels self._bounds = bounds if isin... |
def event(self): return EventStamp(self.item) | def item(self): return self.event.itsItem | def event(self): return EventStamp(self.item) |
enableBusyBars = schema.One(schema.Boolean, initialValue = True) | enableBusyBars = schema.One(schema.Boolean, initialValue = False) | def isMainCalendarVisible(): # Heuristic: is the appbar calendar button selected (depressed)? calendarButton = Block.Block.findBlockByName("ApplicationBarEventButton") try: return calendarButton.selected except AttributeError: # Toolbar isn't rendered yet return False |
def __noopSubst(func, name): return '$(%s)' % name | try: utils.checkBakefileVersion('0.1.5') def __noopSubst(name, func, caller): return '$(%s)' % name except AttributeError: def __noopSubst(func, name): return '$(%s)' % name | def __noopSubst(func, name): return '$(%s)' % name |
"""Creates wxWindows library identifier from bakefile target ID that | """Creates wxWidgets library identifier from bakefile target ID that | def mk_wxid(id): """Creates wxWindows library identifier from bakefile target ID that follows this convention: DLLs end with 'dll', static libraries end with 'lib'. If withPrefix=1, then _wxid is returned instead of wxid.""" if id.endswith('dll') or id.endswith('lib'): wxid = id[:-3] else: wxid = id return wxid |
"TestTableSelection.py", | def run_tests(tests): for filename in tests: try: execfile(os.path.join(functional_dir, filename)) except: import traceback print "%s failed due to exception" % fileName type, value, stack = sys.exc_info() traceback.print_exception(type, value, stack, None, sys.stderr) | |
s = s.strip('None').strip('\n') | s.replace('None', '') s.replace('\n') | def stripStuff(s): if s == None: return '' if 'Traceback' not in s: s = s.strip('None').strip('\n') return s |
self._write('\tTEST %s FAILED\n ' % stripStuff(test_dict['name'])) | self._write('\tTEST %s failed\n ' % stripStuff(test_dict['name'])) | def stripStuff(s): if s == None: return '' if 'Traceback' not in s: s = s.strip('None').strip('\n') return s |
self.endAction(result=False, comment='Action Failure due to traceback') | self.endAction(result=False, comment='Action failed due to traceback') | def traceback(self): """Method to handle python traceback exception.""" import sys, traceback type, value, stack = sys.exc_info() #Print the exception if self.f is not None: traceback.print_exception(type, value, stack, None, self.f) if self.stdout is not None: traceback.print_exception(type, value, stack, None, self.... |
self.endTest(comment='Test Failure due to traceback\n' + traceback.format_exc()) | self.endTest(comment='Test failed due to traceback\n' + traceback.format_exc()) | def traceback(self): """Method to handle python traceback exception.""" import sys, traceback type, value, stack = sys.exc_info() #Print the exception if self.f is not None: traceback.print_exception(type, value, stack, None, self.f) if self.stdout is not None: traceback.print_exception(type, value, stack, None, self.... |
self._write('%s*failed*\n' % test_dict['name'].ljust(30,'_')) | self._write('%s*FAILED*\n' % test_dict['name'].ljust(30,'_')) | def simpleSummary(self): #write simple summary self._write("\n*********** TEST RESULTS ************\n*************************************\n") for suite_dict in self.suiteList: for test_dict in suite_dict['testlist']: if test_dict['result'] == False: self._write('%s*failed*\n' % test_dict['name'].ljust(30,'_')) else: s... |
dc.SetPen(wx.Pen(wx.Colour(204, 204, 204))) | dc.SetPen(wx.Pen(wx.Colour(179, 179, 179))) | def DrawBackground(self, dc): self._doDrawingCalculations(dc) |
if item is not None and item.isMutating(): | if item is not None and item.isDeleting(): | def onWatchNotification(cls, op, uuid, names): """ When an item someone's watching has changed, we need to synchronize. """ # Ignore notifications for items being stamped. (We get a lot then, # but the items really aren't consistent. Anyone who cares about an # item kind change should have another way to hear about it:... |
otherItem = Dav.DAV(nodes[0].content).get() | otherItem = Dav.DAV(node.content).get() | def syncFromServer(item, davItem): kind = davItem.itsKind for (name, attr) in kind.iterAttributes(True): value = davItem.getAttribute(attr) if not value: continue log.info('Getting: %s (%s)' % (name, attr.type.itsName)) # see if its an ItemRef or not if isinstance(attr.type, Kind): # time for some xml parsing! yum!... |
if not mainFrame.IsShown(): | if createDialog and not mainFrame.IsShown(): | def primeReminderTimer(self, createDialog=False): """ Prime the reminder timer and maybe show or hide the dialog """ mainFrame = wx.GetApp().mainFrame if not mainFrame.IsShown(): # The main window isn't up yet; this happens on Mac when # Chandler is started with a reminder already due. Wait a couple # of seconds and tr... |
if self.subject.run(): if self.running: reactor.callFromThread(self.reschedule) | if self.subject.run(): reactor.callFromThread(self.reschedule_if_running) | def _run(self): """This should only be called from a pool thread""" self.runlock.acquire() try: if self.subject.run(): # can stop by returning false if self.running: reactor.callFromThread(self.reschedule) else: self.stop() finally: self.runlock.release() |
self.stop() | reactor.callFromThread(self.stop) | def _run(self): """This should only be called from a pool thread""" self.runlock.acquire() try: if self.subject.run(): # can stop by returning false if self.running: reactor.callFromThread(self.reschedule) else: self.stop() finally: self.runlock.release() |
self._changeTextQuietly(control, currentText, False, True) | self._changeTextQuietly(control, currentText, False, alreadyChanged) | def onTextChanged(self, event): if not getattr(self, "ignoreTextChanged", False): control = event.GetEventObject() if getattr(self, 'sampleText', None) is not None: currentText = control.GetValue() #logger.debug("StringAE.onTextChanged: not ignoring; value is '%s'" % currentText) if self.showingSample: if currentText !... |
(attributeName, reference, None) | (attributeName, str(reference.itsUUID), None) | def completeAssignments(self, item, assignments): """ Perform all the delayed attribute assignments for an item """ |
(attributeName, reference.itsUUID, None) | (attributeName, str(reference.itsUUID), None) | def completeAssignments(self, item, assignments): """ Perform all the delayed attribute assignments for an item """ |
value = repr(value) | def assignmentExists(self, (attrName, value, key)): """ Returns True if the ValueSet has this assignment in it. False otherwise. """ value = repr(value) # makes it easier to compare non-strings | |
value = repr(value) | def removeAssignment(self, (attrName, value, key)): """ Remove an assignment from the ValueSet. """ value = repr(value) # makes it easier to compare non-strings | |
value = repr(value) | def addAssignment(self, (attrName, value, key)): """ Add an assignment to the ValueSet. """ value = repr(value) # makes it easier to compare non-strings card = self.item.getAttributeAspect(attrName, "cardinality") | |
if repr(listValue) == value: list.remove(listValue) | if isinstance(listValue, repository.item.Item.Item): if str(listValue.itsUUID) == value: list.remove(listValue) print "Reload: item %s, unassigning %s = '%s'" % \ (self.item.itsPath, attrName, listValue.itsPath) else: if str(listValue) == value: list.remove(listValue) print "Reload: item %s, unassigning %s = '%s'" % \ ... | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.