rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
"While loading %s.%s, %s" | __doc__ = "While loading %s.%s, %s" | def __str__(self): return self.__doc__ %(self.args[0]) |
"While saving %s, %s" | __doc__ = "While saving %s, %s" | def __str__(self): return self.__doc__ %(self.args[0], self.args[1], self.args[2]) |
"While saving value for '%s' on %s: %s" | __doc__ = "While saving value for '%s' on %s: %s" | def __str__(self): return self.__doc__ %(self.args[0], self.args[1]) |
"While importing %s into %s, %s" | __doc__ = "While importing %s into %s, %s" | def __str__(self): return self.__doc__ %(self.args[1], self.args[0]._repr_(), self.args[2]) |
"No matching import parent %s for %s found" | __doc__ = "No matching import parent %s for %s found" | def __str__(self): return self.__doc__ %(self.args[0], self.args[1], self.args[2]) |
"No matching import kind %s for %s found" | __doc__ = "No matching import kind %s for %s found" | def __str__(self): return self.__doc__ %(self.args[0].itsPath, self.args[1]._repr_()) |
indexName = column.attributeName blockItem.contents.setCollectionIndex(indexName, toggleDescending=True, attributes=column.indexAttributes) self.wxSynchronizeWidget() | if column.valueType != 'kind': indexName = column.attributeName blockItem.contents.setCollectionIndex(indexName, toggleDescending=True, attributes=column.indexAttributes) self.wxSynchronizeWidget() | def OnLabelLeftClicked (self, event): assert (event.GetRow() == -1) # Currently Table only supports column headers blockItem = self.blockItem column = blockItem.columns[event.GetCol()] self.SetUseColSortArrows(column.useSortArrows) indexName = column.attributeName blockItem.contents.setCollectionIndex(indexName, toggle... |
for share in Share.iterItems(view): if share.active: syncShare(share) | for collection in pim.AbstractCollection.iterItems(view): for share in collection.shares: if share.active: syncShare(share) | def syncAll(view): """ Synchronize all active shares. @param view: The repository view object @type view: L{repository.persistence.RepositoryView} """ for share in Share.iterItems(view): if share.active: syncShare(share) |
raise NotFound() | raise NotFound(message="%s does not exist" % location) | def get(self): |
raise NotFound() | raise Misconfigured(message="Share path is not set, or path doesn't exist") | def create(self): super(FileSystemConduit, self).create() |
raise NotFound() path = self.getLocation() | raise NotFound(message="%s does not exist" % path) | def destroy(self): super(FileSystemConduit, self).destroy() |
raise NotFound() | raise NotFound(message="%s does not exist" % path) | def open(self): super(FileSystemConduit, self).open() |
""" @@@MOR In progress | def syncShare(share): """ @@@MOR In progress try: share.sync() except WebDAV.ConnectionError, err: """ | |
except WebDAV.ConnectionError, err: """ | except SharingError, err: msg = "Error syncing the '%s' collection\n" % share.contents.getItemDisplayName() msg += "using the '%s' account:\n\n" % share.conduit.account.getItemDisplayName() msg += err.message application.dialogs.Util.ok(wx.GetApp().mainFrame, "Synchronization Error", msg) | def syncShare(share): """ @@@MOR In progress try: share.sync() except WebDAV.ConnectionError, err: """ |
share.sync() | syncShare(share) | def syncAll(view): """ Synchronize all active shares. @param view: The repository view object @type view: L{repository.persistence.RepositoryView} """ shareKind = view.findPath("//parcels/osaf/framework/sharing/Share") for share in KindQuery().run([shareKind]): if share.active: share.sync() |
displayName=_(u'Welcome to Chandler 0.5'), | displayName=_(u'Welcome to Chandler 0.6'), | def installParcel(parcel, oldVersion=None): from osaf import sharing, startup from osaf.framework import scripting curDav = Reference.update(parcel, 'currentWebDAVAccount') curMail = Reference.update(parcel, 'currentMailAccount') curSmtp = Reference.update(parcel, 'currentSMTPAccount') curCon = Reference.update(parce... |
body = _(u"""Welcome to the Chandler 0.5 Release! Chandler 0.5 contains support for early adopter developers who want to start building parcels. For example, developers now can create form-based parcels extending the kinds of information that Chandler manages. This release also brings significant improvements to infra... | body = _(u"""Welcome to the Chandler 0.6 Release! For a wealth of information for end-users and developers, point your browser to: http://chandler.osafoundation.org There you can see presentations on the Vision of Chandler, details about this release, screenshots and screencast demos, documentation and tutorials for ... | def installParcel(parcel, oldVersion=None): from osaf import sharing, startup from osaf.framework import scripting curDav = Reference.update(parcel, 'currentWebDAVAccount') curMail = Reference.update(parcel, 'currentMailAccount') curSmtp = Reference.update(parcel, 'currentSMTPAccount') curCon = Reference.update(parce... |
def getImageVariation(self, item, attributeName, isReadOnly, isDown, isSelected, isOver): | def getImageVariation(self, item, attributeName, isReadOnly, isDown, isSelected, isOver, justClicked): | def getImageVariation(self, item, attributeName, isReadOnly, isDown, isSelected, isOver): """ Pick the right variation """ readOnly = isReadOnly and IconAttributeEditor.readOnlyBit or 0 selected = isSelected and IconAttributeEditor.selectedBit or 0 mouseDown = isDown and IconAttributeEditor.mouseDownBit or 0 rolledOver... |
rolledOver = isOver and IconAttributeEditor.rolledOverBit or 0 | rolledOver = (not justClicked and isOver) and IconAttributeEditor.rolledOverBit or 0 | def getImageVariation(self, item, attributeName, isReadOnly, isDown, isSelected, isOver): """ Pick the right variation """ readOnly = isReadOnly and IconAttributeEditor.readOnlyBit or 0 selected = isSelected and IconAttributeEditor.selectedBit or 0 mouseDown = isDown and IconAttributeEditor.mouseDownBit or 0 rolledOver... |
isDown, isInSelection, isOver) | isDown, isInSelection, isOver, justClicked) | def Draw (self, grid, dc, rect, (item, attributeName), isInSelection=False): """ Draw the appropriate variation from the set of icons for this state. """ proxyItem = RecurrenceDialog.getProxy(u'ui', item, createNew=False) dc.SetPen (wx.TRANSPARENT_PEN) dc.DrawRectangleRect(rect) # always draw the background isDown = g... |
justClicked = True; | justClicked = True | def OnMouseChange(self, event): """ Handle live changes of mouse state related to our cell; return True if we want the mouse captured for future updates. """ # Note whether the item we were over changed item, attributeName = event.getCellValue() isIn = event.isInCell rolledOverItem = getattr(self, 'rolledOverItem', Non... |
trunkUUID = self.keyUUIDToTrunkUUID[keyUUID] | trunk = self.keyUUIDToTrunkUUID[keyUUID] | def getTrunkForKeyItem(self, keyItem): """ Given an item, return the view to be used to display it. |
self.keyUUIDToTrunkUUID[keyUUID] = trunk.itsUUID else: trunk = self.findUUID(trunkUUID) | self.keyUUIDToTrunkUUID[keyUUID] = trunk | def getTrunkForKeyItem(self, keyItem): """ Given an item, return the view to be used to display it. |
wx.LaunchDefaultBrowser(link.GetHref()) | webbrowser.open(link.GetHref()) | def OnLinkClicked(self, link): """ Called whenever a link on the splash screen is clicked. Opens that url in the user's default web browser. """ self.linked = True wx.LaunchDefaultBrowser(link.GetHref()) |
__CHANDLER_STARTED_UP = False | def _mergeFunction(code, item, attribute, value): if code == MergeError.DELETE: return True # Let the item delete # in the other view win return getattr(item, attribute, Nil) # Let changes from # other views win # return value # Let changes from the # m... | |
self.Bind(wx.EVT_IDLE, self.OnIdle) | def _displayHook(obj): if obj is not None: print repr(obj) | |
self.__CHANDLER_STARTED_UP = True | self.Bind(wx.EVT_IDLE, self.OnIdle) | def _displayHook(obj): if obj is not None: print repr(obj) |
if not self.__CHANDLER_STARTED_UP: return | def OnIdle(self, event): # Adding a handler for catching a set focus event doesn't catch # every change to the focus. It's difficult to preprocess every event # so we check for focus changes in OnIdle. Also call UpdateUI when # focus changes. | |
isGenerated, modificationsFor = view.findValues(uuid, ('isGenerated', False), ('modificationsFor', None)) return not (isGenerated or modificationsFor) | isGenerated, modificationFor = view.findValues(uuid, ('isGenerated', False), ('modificationFor', None)) return not (isGenerated or modificationFor) | def isNonRecurring(self, view, uuid): |
dc.DrawLines(((x+w, y), (x,y), (x,y+h), (x+w,y+h))) | dc.DrawLines(((x+w, y), (x+1,y), (x+1,y+h-1), (x+w,y+h-1))) | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item |
dc.DrawRectangle(x,y+1,w,h-1) | dc.DrawRectangle(x,y+1,w,h-2) | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item |
try: share.put(updateCallback=callback) except: raise | share.put(updateCallback=callback) | def publish(collection, account, classesToInclude=None, publishType = 'collection', attrsToExclude=None, displayName=None, updateCallback=None): """ Publish a collection, automatically determining which conduits/formats to use, and how many @type collection: pim.ContentCollection @param collection: The collection to p... |
try: share.put(updateCallback=callback) except: share.destroy() raise | share.put(updateCallback=callback) | def publish(collection, account, classesToInclude=None, publishType = 'collection', attrsToExclude=None, displayName=None, updateCallback=None): """ Publish a collection, automatically determining which conduits/formats to use, and how many @type collection: pim.ContentCollection @param collection: The collection to p... |
pass raise | pass raise e | def publish(collection, account, classesToInclude=None, publishType = 'collection', attrsToExclude=None, displayName=None, updateCallback=None): """ Publish a collection, automatically determining which conduits/formats to use, and how many @type collection: pim.ContentCollection @param collection: The collection to p... |
typ.fields = dict.fromkeys(cls.__slots__) | typ.fields = dict((k,{}) for k in cls.__slots__) | def _init_schema_item(cls,typ): typ.fields = dict.fromkeys(cls.__slots__) typ.implementationTypes = {'python': cls} |
references[name] = ItemRef(copyItem, name, self._other(item), | references[name] = ItemRef(copyItem, name, self.other(item), | def _copy(self, references, item, copyItem, name, policy, copies): |
menu = mainMenuBar.GetMenu (menuIndex) | menu = mainMenuBar.Remove(menuIndex) | def FindNameReturnIndex (menu, name): """ Searches a menu for a name (possibly translated) and returns an index to the item. """ index = 0 translatedName = _(name) for item in menu.GetMenuItems(): if item.GetLabel() == translatedName: return index index += 1 return wxNOT_FOUND |
_colBorderSize = wx.SystemSettings_GetMetric(wx.SYS_BORDER_X) * 2 | self._colBorderSize = wx.SystemSettings_GetMetric(wx.SYS_BORDER_X) * 2 | def __init__(self, *arguments, **keywords): """ the borders of the column headers are not being counted towards the width of a column, so need to remember to add the left/right borders when doing certain column width calculations """ _colBorderSize = wx.SystemSettings_GetMetric(wx.SYS_BORDER_X) * 2 """ Giant hack. Ca... |
c.body = lob.makeValue("test", mimetype="plain/text") | c.body = lob.makeValue("test", mimetype="text/plain") | def PrepareTestData(self): |
item0.body = lob0.makeValue("view0 change", mimetype="plain/text") item1.body = lob1.makeValue("view1 change", mimetype="plain/text") | item0.body = lob0.makeValue("view0 change", mimetype="text/plain") item1.body = lob1.makeValue("view1 change", mimetype="text/plain") | def Modify(self): |
for value in osAvgs['win'].itervalues(): | for value in osAvgs['linux'].itervalues(): | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
for i in range(random.randint(1, 2)): event.participants.append(GenerateCalendarParticipant()) | def GenerateCalendarEvent(days): event = Calendar.CalendarEvent() event.displayName = random.choice(HEADLINES) for i in range(random.randint(1, 2)): event.participants.append(GenerateCalendarParticipant()) # Choose random days, hours startDelta = DateTime.DateTimeDelta(random.randint(0, days), random.randint(0, 24)) ... | |
elif value._isRefs(): | elif value is not None and value._isRefs(): | def _collectChanges(self, view, flag, dirties, newChanges, changes, indexChanges, version, newVersion): |
pageLocation = "parcels" + os.sep + "calendar" + os.sep + "AboutCalendar.html" | pageLocation = "parcels" + os.sep + "OSAF" + os.sep + "calendar" + os.sep + "AboutCalendar.html" | def OnAboutCalendar(self, event): pageLocation = "parcels" + os.sep + "calendar" + os.sep + "AboutCalendar.html" infoPage = SplashScreen(self, _("About Calendar"), pageLocation, false) if infoPage.ShowModal(): infoPage.Destroy() |
wxMessageBox(_("There is an authentication proglem. We can't log into the jabber server. Perhaps your password is incorrect.")) self.Logout() | wxMessageBox(_("There is an authentication problem. We can't log into the jabber server. Perhaps your password is incorrect.")) | def Login(self): if self.loggedIn or not self.HasLoginInfo(): return username = self.GetUsername() servername = self.GetServername() |
self.connected = FALSE | self.connected = false | def Logout(self): if self.connected: self.connection.disconnect() self.connected = FALSE self.connection = None self.loggedIn = FALSE # cancel the idle calls EVT_IDLE(self.viewer, None) |
self.loggedIn = FALSE | self.loggedIn = false | def Logout(self): if self.connected: self.connection.disconnect() self.connected = FALSE self.connection = None self.loggedIn = FALSE # cancel the idle calls EVT_IDLE(self.viewer, None) |
return self.accessible_views[strippedID] | return self.accessibleViews[strippedID] | def GetAccessibleViews(self, jabberID): strippedID = jabberID.getStripped() if self.accessibleViews.has_key(strippedID): return self.accessible_views[strippedID] |
self.HandleViewRequest(jabber_id) | self.HandleViewRequest(jabberID) | def PermissionsChanged(self, view): for jabberID in self.openPeers.keys(): if self.openPeers[jabberID] == 1: self.HandleViewRequest(jabber_id) |
mappedResponse = response_body.encode('ascii') | mappedResponse = responseBody.encode('ascii') | def HandleViewResponse(self, fromAddress, responseBody): mappedResponse = response_body.encode('ascii') mappedResponse = self.FixExtraBlanks(mappedResponse) newViews = cPickle.loads(mappedResponse) self.setAccessibleViews(fromAddress, newViews) |
xRequest = message_element.getX() | xRequest = messageElement.getX() print "message ", type, xRequest, fromAddress, subject | def HandleMessage(self, messageElement): type = messageElement.getType() body = messageElement.getBody() fromAddress = messageElement.getFrom() toAddress = messageElement.getTo() subject = messageElement.getSubject() xRequest = message_element.getX() if xRequest != None: if xRequest == 'chandler:shimmer-request': self... |
message = _("Message from ") + fromAddress + _(" about ") + subject + ". Cant handle yet..." | message = _("Message from ") + str(fromAddress) + _(" about ") + str(subject) + ". Cant handle yet..." | def HandleMessage(self, messageElement): type = messageElement.getType() body = messageElement.getBody() fromAddress = messageElement.getFrom() toAddress = messageElement.getTo() subject = messageElement.getSubject() xRequest = message_element.getX() if xRequest != None: if xRequest == 'chandler:shimmer-request': self... |
print "presence element of type", type, "from", from_address, "status", status | print "presence element of type", type, "from", fromAddress, "status", status | def HandlePresence(self, presenceElement): type = presenceElement.getType() fromAddress = presenceElement.getFrom() who = fromAddress.getStripped() status = presenceElement.getStatus() if type == None: type = 'available' resource = fromAddress.getResource() self.resourceMap[who] = resource |
print "iq callback ", type, from_address, query, error | print "iq callback ", type, fromAddress, query, error | def HandleIq(self, iqElement): type = iqElement.getType() fromAddress = iqElement.getFrom() query = iqElement.getQuery() error = iqElement.getError() if query == 'jabber:iq:roster': self.NotifyPresenceChanged(fromAddress) print "iq callback ", type, from_address, query, error |
message = '%s wishes to %s to your presence information. Do you approve?' % (who, subscription_type) | message = '%s wishes to %s to your presence information. Do you approve?' % (who, subscriptionType) | def ConfirmSubscription(self, subscriptionType, who): message = '%s wishes to %s to your presence information. Do you approve?' % (who, subscription_type) result = tkMessageBox.askquestion('Subscription Request', message) if result == 'yes': if subscriptionType == 'subscribe': self.connection.send(Presence(to=who, ty... |
delta_height = 1 | deltaHeight = 1 | def MakeRectForRange(self, startTime, endTime): """ Turn a datetime range into a single rectangle that can be drawn on the screen """ startX, startY, width = self.getPositionFromDateTime(startTime) delta_height = 1 if IS_MAC: startY -= 1 deltaHeight = 0 height = int(self.hourHeight * (endTime.hour + endTime.minute/60.0... |
pass | def synchronizeItemDetail(self, item): super(DetailSynchronizedAttributeEditorBlock, self).synchronizeItemDetail(item) if self.isShown: self.synchronizeWidget() | def shouldShow (self, item): return not (item is None or item.isItemOf (Contacts.Contact.getKind (self.itsView))) |
menu.InsertItem (insertAtIndex, parcelMenuItems [menuItemIndex]) | item = parcelMenu.RemoveItem(parcelMenuItems[menuItemIndex]) menu.InsertItem (insertAtIndex, item) | def CopyMenuItem(source, destination): """ Delete all the items in the destinations, then copy all the source items over to the destination. We do this instead of just replacing the destination menu with the source menu, because replacing the help menu on Macintosh fails (since it's owned by the system and can't be del... |
parcelMenu.Destroy() | def CopyMenuItem(source, destination): """ Delete all the items in the destinations, then copy all the source items over to the destination. We do this instead of just replacing the destination menu with the source menu, because replacing the help menu on Macintosh fails (since it's owned by the system and can't be del... | |
wx.Size(300,-1), | wx.Size(250,-1), | def getBitmaps (self): bitmap = theApp.GetImage (self.bitmap) disabledBitmap = getattr (self, 'disabledBitmap', wx.NullBitmap) if disabledBitmap is not wx.NullBitmap: disabledBitmap = app.GetImage (disabledBitmap) return bitmap, disabledBitmap |
handle.blockUntil(resource.setDisplayName, name) | try: handle.blockUntil(resource.setDisplayName, name) except zanshin.http.HTTPError: pass | def setDisplayName(self, name): handle = self._getServerHandle() location = self.getLocation() if not location.endswith("/"): location += "/" resource = handle.getResource(location) handle.blockUntil(resource.setDisplayName, name) |
serverHandle.blockUntil(resource.setDisplayName, displayName) | def _putItem(self, item): result = super(CalDAVConduit, self)._putItem(item) | |
if '__WXGTK__' in wx.PlatformInfo: def afterInit(): self.mainFrame.GetChildren()[0].SetFocus() self.mainFrame.UpdateWindowUI(wx.UPDATE_UI_RECURSE) wx.CallAfter(afterInit) | def _setStatusMessageCallback(*args, **kwds): if kwds.get('msg', None) is not None: self.PostAsyncEvent(setStatusMessage, kwds['msg']) | |
default='<Loading...>') | default='<Untitled>') | def GetElementCellValues(element): if element == RSSData.ZaoBaoParcel.getRSSChannelKind(): return ['',''] displayName = element.getAttributeValue('displayName', default='<Loading...>') date = element.getAttributeValue('date', default=None) if not date: date = element.getAttributeValue('lastModified', default='') if da... |
displayName = item.getAttributeValue('displayName', default='<Loading...>') | displayName = item.getAttributeValue('displayName', default='<Untitled>') | def getHTMLText(self, item): if item == Globals.repository.view: return if item: displayName = item.getAttributeValue('displayName', default='<Loading...>') |
for item in self: yield item.itsUUID | for key in self._iterSourceKeys(self._left): yield key left = self._getSource(self._left) for key in self._iterSourceKeys(self._right): if key not in left: yield key | def _iterkeys(self): |
for item in self: yield item.itsUUID | right = self._getSource(self._right) for key in self._iterSourceKeys(self._left): if key in right: yield key | def _iterkeys(self): |
for item in self: yield item.itsUUID | right = self._getSource(self._right) for key in self._iterSourceKeys(self._left): if key not in right: yield key | def _iterkeys(self): |
self.OnPaint(None) | self.Refresh() | def OnDClick(self, event): item = self._getItem(event) self._avoidDrawing = True # Select the calendar filter self.blockItem.postEventByName ('ApplicationBarEvent', {}) |
self.OnPaint(None) | self.Refresh() | def OnClick(self, event): item = self._getItem(event) if self.selectedItem != item: self.selectedItem = item sidebarBPB = Block.Block.findBlockByName("SidebarBranchPointBlock") sidebarBPB.childrenBlocks.first().postEventByName ( 'SelectItemsBroadcast', {'items':[item]} ) self.OnPaint(None) |
wx.Log.SetActiveTarget(wx.LogStderr()) | if not Globals.options.stderr: class _stderr(object): def __init__(self, stderr): self.stderr = stderr self.output = [] self.logger = logging.getLogger('stderr') def __getattr__(self, name): return getattr(self.stderr, name) def write(self, string): self.stderr.write(string) if string.endswith('\n'): self.output.appen... | def OnInit(self): """ Main application initialization. """ |
return certificate.importCertificateDialog(self.itsView) | theCertificate = certificate.importCertificateDialog(self.itsView) if theCertificate is not None: menuBlock = schema.ns(__name__, self.itsView).CertificateView menuBlock.post (menuBlock.event, {}) return theCertificate | def onNewItem (self): """ Called to create a new Item. """ return certificate.importCertificateDialog(self.itsView) |
def testAppendBZ2(self): self.appended('bz2') | def testAppendBZ2(self): | |
self.loadParcel("http://osafoundation.org/examples/zaobao") | self.loadParcel("http://osafoundation.org/parcels/osaf/examples/zaobao") | def setUp(self): |
self.SetRepository (app.repository) | def __init__(self, **args): """ Create instances of other objects that belong to the application. Here are all the public attributes: | |
from OSAF.AppSchema.DocumentSchema.Block import Block topDocument = app.repository.find('//Parcels/OSAF/templates/top/TopDocument') if topDocument: assert isinstance (topDocument, Block) topDocument.Render (self.model.mainFrame) | def loadClass(moduleName, className): return getattr(__import__(moduleName, {}, {}, className), className) | |
self._ranges.unselectRange(range) | self._ranges.unSelectRange(range) | def removeRange(self, range): |
MAX_POOL_SIZE = 15 | def receiveWakeupCall(self): raise NotImplementedError | |
size = self.wakeupCallies.__len__() if size > self.MAX_POOL_SIZE: size = self.MAX_POOL_SIZE reactor.suggestThreadPoolSize(size) | def __startup(self, callOnStartup=True): self.__populate() size = self.wakeupCallies.__len__() | |
reactor.callInThread(wakeupCall.receiveWakeupCall) | self.threadPool.callInThread(self.__proxy, wakeupCall.callback.receiveWakeupCall, wakeupCall.itsUUID) | def __startup(self, callOnStartup=True): self.__populate() size = self.wakeupCallies.__len__() |
reactor.callInThread(wakeupCall.receiveWakeupCall) | self.threadPool.callInThread(self.__proxy, wakeupCall.callback.receiveWakeupCall, wakeupCall.itsUUID) | def __triggerEvent(self, uuid): wakeupCall = self.wakeupCallies[uuid] assert wakeupCall is not None |
wakeupCallKind = Globals.repository.findPath('//parcels/osaf/framework/wakeup/WakeupCall') | wakeupCallKind = self.__getKind() | def __populate(self): wakeupCallKind = Globals.repository.findPath('//parcels/osaf/framework/wakeup/WakeupCall') |
error += "The WakeupCall must specify and Item Class and have a delay value greater than 0" | error += "The WakeupCall must specify a WakeupCall.py sub-class and have a delay value greater than 0" | def __populate(self): wakeupCallKind = Globals.repository.findPath('//parcels/osaf/framework/wakeup/WakeupCall') |
try: wakeupCall.receiveWakeupCall | callback = wakeupCall.wakeupCallClass() | def __isValid(self, wakeupCall): if wakeupCall is None or wakeupCall.delay.seconds <= 0: return False |
except ItemError.NoSuchAttributeError: | if not isinstance(callback, WakeupCall): | def __isValid(self, wakeupCall): if wakeupCall is None or wakeupCall.delay.seconds <= 0: return False |
else: return True | wakeupCall.callback = callback return True | def __isValid(self, wakeupCall): if wakeupCall is None or wakeupCall.delay.seconds <= 0: return False |
block = self.blockItem return block.post(toolbarItem.event, {}) | return toolbarItem.post(toolbarItem.event, {}) | def press (self, toolbarItem = None, name=''): # post the event for the toolbarItem, or toolbarItem located by name if toolbarItem is None: toolbarItem = self._item_named (name) block = self.blockItem return block.post(toolbarItem.event, {}) |
collection.add(self) | collection.add(self.proxiedItem.getMaster()) | def addToCollection(self, collection): """ Add self to the given collection, or queue the add. """ if self.proxiedItem.rruleset is None: collection.add(self) else: self.changeBuffer.append((ADDTOCOLLECTION, collection)) if not self.dialogUp: # [Bug 4110] Put the dialog on-screen asynchronously self.dialogUp = True wx.G... |
collection.remove(self) | collection.remove(self.proxiedItem.getMaster()) | def removeFromCollection(self, collection): """ Remove self from the given collection, or queue the removal. """ if self.proxiedItem.rruleset is None: collection.remove(self) else: self.changeBuffer.append((DELETE, collection)) if not self.dialogUp: # [Bug 4110] Put the dialog on-screen asynchronously self.dialogUp = T... |
'all' : lambda: collection.remove(self)} | 'all' : lambda: collection.remove( self.proxiedItem.getMaster()) } | def propagateDelete(self, collection): table = {'this' : self.proxiedItem.deleteThis, 'thisandfuture' : self.proxiedItem.deleteThisAndFuture, 'all' : lambda: collection.remove(self)} table[self.currentlyModifying]() |
@type key: C{immutable}, typically C{String} | @type key: C{immutable}, typically C{String} or C{int} | def _index(self, key): """ returns a tuple with the item refered to by the key, and the collection @param key: the key used for lookup into the ref collection. @type key: C{immutable}, typically C{String} @return: a C{Tuple} containing C{(item, collection)} or raises an exception if not found. """ coll = self.getAttrib... |
i = coll.getByAlias(key) | if isinstance (key, int): if key >= 0: i = coll.first () next = coll.next else: i = coll.last () next = coll.previous key = -key for index in xrange (key): i = next (i) else: i = coll.getByAlias(key) | def _index(self, key): """ returns a tuple with the item refered to by the key, and the collection @param key: the key used for lookup into the ref collection. @type key: C{immutable}, typically C{String} @return: a C{Tuple} containing C{(item, collection)} or raises an exception if not found. """ coll = self.getAttrib... |
""" wxWindows doesn't implement convenient menthods for dealing | def __cmp__ (self, other): """ CPIA and wxWidgets have different ideas about how submenus work. In CPIA a menu can appear in the menu bar, or inside another menu. In wxWidgets, only a MenuItem can appear in a Menu, and you have to get the "subMenu" out of the MenuItem to deal with it as a Menu. This method lets us comp... | def wxSynchronizeWidget(self): self.blockItem.synchronizeItems() |
if index < itemsInMenu: | if oldItem is not None: assert index < itemsInMenu, "index out of range replacing menu item" | def setMenuItem (self, newItem, oldItem, index): # now set the menu item itemsInMenu = self.GetMenuItemCount() assert (index <= itemsInMenu) if index < itemsInMenu: self.removeItem (index, oldItem) if isinstance (newItem.widget, wxMenuItem): success = self.InsertItem (index, newItem.widget) assert success """ Disable m... |
assert success | assert success, "error inserting menu item" | def setMenuItem (self, newItem, oldItem, index): # now set the menu item itemsInMenu = self.GetMenuItemCount() assert (index <= itemsInMenu) if index < itemsInMenu: self.removeItem (index, oldItem) if isinstance (newItem.widget, wxMenuItem): success = self.InsertItem (index, newItem.widget) assert success """ Disable m... |
be enabled by an UpdateUIEvent or out command dispatch in Application.py | be enabled by an UpdateUIEvent or our command dispatch in Application.py | def setMenuItem (self, newItem, oldItem, index): # now set the menu item itemsInMenu = self.GetMenuItemCount() assert (index <= itemsInMenu) if index < itemsInMenu: self.removeItem (index, oldItem) if isinstance (newItem.widget, wxMenuItem): success = self.InsertItem (index, newItem.widget) assert success """ Disable m... |
oldMenu = self.Replace (index, newItem.widget, title) assert oldMenu == oldItem | if newItem.widget in self.getMenuItems (): self.removeItem (index, newItem.widget) if oldItem is not None: oldMenu = self.Replace (index, newItem.widget, title) assert oldMenu is oldItem else: self.Insert (index, newItem.widget, title) | def setMenuItem (self, newItem, oldItem, index): itemsInMenu = self.GetMenuCount() assert (index <= itemsInMenu) title = newItem.title if index < itemsInMenu: oldMenu = self.Replace (index, newItem.widget, title) assert oldMenu == oldItem else: success = self.Append (newItem.widget, title) assert success |
""" oldMenuList = self.widget.getMenuItems () index = 0 | Used for both Menus and MenuBars. """ menuList = self.widget.getMenuItems () index = 0 | def synchronizeItems(self): """ Install the menus into supplied menu list, and submenus into their menu items. """ oldMenuList = self.widget.getMenuItems () index = 0 for menuItem in self.dynamicChildren: # ensure that the menuItem has been instantiated if not hasattr (menuItem, "widget"): menuItem.widget = menuItem.i... |
oldItem = oldMenuList.pop(0) | curItem = menuList.pop(0) | def synchronizeItems(self): """ Install the menus into supplied menu list, and submenus into their menu items. """ oldMenuList = self.widget.getMenuItems () index = 0 for menuItem in self.dynamicChildren: # ensure that the menuItem has been instantiated if not hasattr (menuItem, "widget"): menuItem.widget = menuItem.i... |
oldItem = None if oldItem is None or menuItem.widget.this is not oldItem.this: self.widget.setMenuItem (menuItem, oldItem, index) | curItem = None if curItem is None or menuItem.widget != curItem: if menuItem.widget in menuList: while menuItem.widget != curItem: self.widget.removeItem (index, curItem) curItem = menuList.pop(0) else: self.widget.setMenuItem (menuItem, None, index) if curItem is not None: menuList.insert (0, curItem) | def synchronizeItems(self): """ Install the menus into supplied menu list, and submenus into their menu items. """ oldMenuList = self.widget.getMenuItems () index = 0 for menuItem in self.dynamicChildren: # ensure that the menuItem has been instantiated if not hasattr (menuItem, "widget"): menuItem.widget = menuItem.i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.