rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
createNewRepository = createNewRepository or hasattr (self, 'CreateNewRepository') if createNewRepository:
createNewRepository = hasattr (self, 'CreateNewRepository') else: createNewRepository = 0 if self.version != Application.VERSION or createNewRepository:
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 ...
self.dragState.originalDragBox.ResetResizeMode()
canvasItem.ResetResizeMode()
def OnEndResizeItem(self): self.FinishDrag() self.StopDragTimer() self.dragState.originalDragBox.ResetResizeMode()
event.ControlDown())
event.ControlDown() or event.CmdDown())
def OnMouseEvent(self, event): """ Handles mouse events, calls overridable methods related to: 1. Selecting an item 2. Dragging/moving an item 3. Resizing an item """
self.synchronizeWidget()
self.blockItem.synchronizeWidget()
def OnAddToSelection(self, item): self.blockItem.selection.append(item) self.blockItem.postSelectItemsBroadcast() self.synchronizeWidget()
self.SummaryTestNames = { 'switching_to_all_view_for_performance': 'Switching Views', 'perf_stamp_as_event': 'Stamping', 'new_event_from_file_menu_for_performance': 'New event creation (file menu)', 'new_event_by_double_clicking_in_the_cal_view_for_performance': 'New event creation (in-place)', ...
self.SummaryTestNames = { 'new_event_from_file_menu_for_performance': ' 'new_event_by_double_clicking_in_the_cal_view_for_performance': ' 'test_new_calendar_for_performance': ' 'importing_3000_event_calendar': ' 'Creating_new_event_from...
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...
try:
if theDate is not None:
def saveAttributeFromWidget(self, item, widget, validate): """" Update the attribute from the user edited string in the widget. """ if validate: dateString = widget.GetValue().strip('?') (theDate, dateOnly) = self.parseDateTime (dateString) try: # save the new Date/Time into the startTime attribute item.ChangeStart (th...
except:
format = (item.allDay or item.anyTime) and self.dateFormat or self.dateTimeFormat dateString = theDate.strftime (format) else:
def saveAttributeFromWidget(self, item, widget, validate): """" Update the attribute from the user edited string in the widget. """ if validate: dateString = widget.GetValue().strip('?') (theDate, dateOnly) = self.parseDateTime (dateString) try: # save the new Date/Time into the startTime attribute item.ChangeStart (th...
else: format = (item.allDay or item.anyTime) and self.dateFormat or self.dateTimeFormat dateString = theDate.strftime (format)
def saveAttributeFromWidget(self, item, widget, validate): """" Update the attribute from the user edited string in the widget. """ if validate: dateString = widget.GetValue().strip('?') (theDate, dateOnly) = self.parseDateTime (dateString) try: # save the new Date/Time into the startTime attribute item.ChangeStart (th...
self.twoPane = wxSplitterWindow(self, -1)
self.twoPane = wxSplitterWindow(self, -1,style=wxSP_LIVE_UPDATE|wxNO_FULL_REPAINT_ON_RESIZE)
def OnInit(self): self.titleFont = wxFont(16, wxSWISS, wxNORMAL, wxNORMAL, false, "Arial")
self.filterClasses = share.filterClasses
self.originalFilterClasses = self.filterClasses = share.filterClasses
def ShowManagePanel(self): # "Manage" mode -- i.e., the collection has already been shared
trashFor = schema.Many('InclusionExclusionCollection', otherName='trash', initialValue=[])
trashFor = schema.Sequence('InclusionExclusionCollection', otherName='trash', initialValue=[])
def installParcel(parcel, old_version = None): """ Parcel install time hook """ # create the global KindCollectionDirectory item. KindCollectionDirectory.update(parcel, "kind_collections")
button = wxButton(parentWidget,
button = wx.Button(parentWidget,
def instantiateWidget(self): try: id = Block.getWidgetID(self) except AttributeError: id = 0
h,w = self.GetSize() self.SetSize ((h+1, w)) self.SetSize ((h, w))
w,h = self.GetSize() self.SetSize ((w+1, h)) self.SetSize ((w, h))
def Reset(self): """ A Grid can't easily redisplay its contents, so we write the following helper function to readjust everything after the contents change """ #Trim/extend the control's rows and update all values self.BeginBatch() """ Hack to work around Stuarts bug #1568 -- DJA """ self.blockItem.contents._ItemCollec...
for start,end in self.getSelectionRanges():
for start,end in reversed(self.getSelectionRanges()):
def setCollectionIndex(self, newIndexName, toggleDescending=False): """ Switches to a different index, bringing over the selection to the new index.
event.Skip()
def OnMouseEvents (self, event): """ This code is tricky, tred with care -- DJA """ gridWindow = self.GetGridWindow()
self.onRemoveEventUpdateUI(event)
def onDeleteEventUpdateUI(self, event): self.onRemoveEventUpdateUI(event) event.arguments['Text'] = _('Delete Collection') """ this is enabled if any user item is selected in the sidebar """ if (self.selectedItemToView and getattr(self.selectedItemToView, 'renameable', True)): event.arguments['Enable'] = True else: eve...
def onRemoveEventUpdateUI(self, event): event.arguments['Enabled'] = False
def onDeleteEventUpdateUI(self, event): self.onRemoveEventUpdateUI(event) event.arguments['Text'] = _('Delete Collection') """ this is enabled if any user item is selected in the sidebar """ if (self.selectedItemToView and getattr(self.selectedItemToView, 'renameable', True)): event.arguments['Enable'] = True else: eve...
result = False
result = True
def _checkIterateIndex(self, logger, name, value, item, attribute):
pending = self.getPendingReminders() closeIt = False reminderDialog = self.getReminderDialog(False) if reminderDialog is not None: (nextReminderTime, closeIt) = reminderDialog.UpdateList(pending) if closeIt: self.closeReminderDialog(); self.setFiringTimeIfRemindersExist()
self.primeReminderTimer()
def synchronizeWidget (self, **hints): # logger.debug("*** Synchronizing ReminderTimer widget!") super(ReminderTimer, self).synchronizeWidget(**hints) if not wx.GetApp().ignoreSynchronizeWidget: pending = self.getPendingReminders() closeIt = False reminderDialog = self.getReminderDialog(False) if reminderDialog is not ...
pending = self.getPendingReminders() reminderDialog = self.getReminderDialog(True) assert reminderDialog is not None (nextReminderTime, closeIt) = reminderDialog.UpdateList(pending)
self.primeReminderTimer(True) def primeReminderTimer(self, createDialog=False): """ Prime the reminder timer and maybe show or hide the dialog """ reminderDialog = self.getReminderDialog(createDialog) if reminderDialog is not None: pending = self.getPendingReminders() (nextReminderTime, closeIt) = reminderDialog....
def onReminderTimeEvent(self, event): # Run the reminders dialog and re-queue our timer if necessary # logger.debug("*** Got reminders time event!") pending = self.getPendingReminders() reminderDialog = self.getReminderDialog(True) assert reminderDialog is not None (nextReminderTime, closeIt) = reminderDialog.UpdateLis...
self.setFiringTimeIfRemindersExist() def setFiringTimeIfRemindersExist(self): events = schema.ns('osaf.app', self.itsView).eventsWithReminders.rep firstReminder = events.firstInIndex('reminderTime') if firstReminder is not None: self.setFiringTime(firstReminder.reminderFireTime)
self.setFiringTime(nextReminderTime)
def onReminderTimeEvent(self, event): # Run the reminders dialog and re-queue our timer if necessary # logger.debug("*** Got reminders time event!") pending = self.getPendingReminders() reminderDialog = self.getReminderDialog(True) assert reminderDialog is not None (nextReminderTime, closeIt) = reminderDialog.UpdateLis...
index += '<h3>Compressed Install Images</h3>\n' +\ '<p>The End-User and Developer compressed images contain a snapshot of Chandler.\n' +\ 'Use these if you cannot or do not want to use the installers.</p>\n' if userTarball: index += '<p>End-Users: <a href="%s">%s</a> (%s): %s<br/>\n' % \ (userTarball[0], userTarball[0...
if userTarball or devTarball: index += '<h3>Compressed Install Images</h3>\n' +\ '<p>The End-User and Developer compressed images contain a snapshot of Chandler.\n' +\ 'Use these if you cannot or do not want to use the installers.</p>\n' if userTarball: index += '<p>End-Users: <a href="%s">%s</a> (%s): %s<br/>\n' % \ ...
def CreateIndex(outputDir, newDirName, nowString, buildName): """ Generates HTML files that contain links and hash information for downloadable files. """ newPrefix = outputDir + os.sep + newDirName + os.sep head1 = '<html>\n<head>\n' +\ '<META HTTP-EQUIV="Pragma" CONTENT="no-cache">\n' +\ '<title>Download Chandler '...
mainView.postEventByName ("AddToSidebarWithoutCopyingAndSelect", {'items':[collection]})
mainView.postEventByName ("AddToSidebarWithoutCopyingAndSelectFirst", {'items':[collection]})
def onAcceptShareEvent(self, event): url, collectionName = MailSharing.getSharingHeaderInfo(self.selectedItem()) wx.Yield() share = Sharing.newInboundShare(self.itsView, url) share.get() # @@@ Remove this when the sidebar autodetects new collections collection = share.contents mainView = application.Globals.views[0] m...
view.contents.removeFilterKind (None) if kindParameter: view.contents.addFilterKind (kindParameter)
try: contents = view.contents except AttributeError: pass else: contents.removeFilterKind (None) if kindParameter: contents.addFilterKind (kindParameter)
def onKindParameterizedEvent (self, notification): kindParameter = notification.event.kindParameter
'verify': options.verify }
'verify': options.verify or __debug__ }
def initRepository(directory, options): repository = DBRepository(directory) kwds = { 'stderr': options.stderr, 'ramdb': options.ramdb, 'create': True, 'recover': options.recover, 'exclusive': True, 'refcounted': True, 'logged': not not options.logging, 'verify': options.verify } if options.restore: kwds['restore'] ...
self._lockEnv = None
def _create(self, **kwds):
if refCounted or item.isPinned(): if item.isSchema(): self.find(item.itsUUID)
if (refCounted or item.isPinned()) and item.isSchema(): oldVersion = item.itsVersion item = self.find(item.itsUUID) if item is not None and item.itsVersion < oldVersion: if isinstance(item, Kind): item.flushCaches(None)
def _refreshItems(self, items):
wx.OPEN | wx.HIDE_READONLY, options
wx.OPEN, options
def __init__(self, parent, dialogTitle, view):
newAmazonCollection = AmazonCollection(view=repView, keywords=keywords) return cpiaView.postEventByName('AddToSidebarWithoutCopying', {'items' : [newAmazonCollection]})
if isEmpty(keywords): """The user did not enter any text to search on or hit the cancel button""" return try: results = amazon.searchByKeyword(keywords) newAmazonCollection = AmazonCollection(results, view=repView, keywords=keywords) return cpiaView.postEventByName('AddToSidebarWithoutCopying', {'items' : [newAmazonCo...
def CreateCollection(repView, cpiaView): keywords = application.dialogs.Util.promptUser(wx.GetApp().mainFrame, _(u"New Amazon Collection"), _(u"Enter your Amazon search keywords:"), u"Theodore Leung") newAmazonCollection = AmazonCollection(view=repView, keywords=keywords) return cpiaView.postEventByName('AddToSidebarW...
if emailAddr is not None: newAmazonCollection = AmazonCollection(view=repView, email=emailAddr)
if isEmpty(emailAddr): return try: results = amazon.searchWishListByEmail(emailAddr) newAmazonCollection = AmazonCollection(results, view=repView, email=emailAddr)
def CreateWishListCollection(repView, cpiaView): emailAddr = application.dialogs.Util.promptUser(wx.GetApp().mainFrame, _(u"New Amazon Wish List"), _(u"What is the Amazon email address of the wish list?"), u"") if emailAddr is not None: newAmazonCollection = AmazonCollection(view=repView, email=emailAddr) return cpiaV...
def NewCollectionFromKeywords(view, keywords, update = True): collection = AmazonCollection(keywords=keywords,view=view) if update: print "updating new amazon collection" return collection
except (AmazonError, AttributeError), e: log.exception(e) showError(_(u"No Amazon Wishlist was found for email address '%(emailAddress)s'") \ % {'emailAddress': emailAddr})
def NewCollectionFromKeywords(view, keywords, update = True): collection = AmazonCollection(keywords=keywords,view=view) if update: print "updating new amazon collection" return collection
def __init__(self,keywords=None,email=None, name=None, parent=None, kind=None, view=None):
def __init__(self, results, keywords=None,email=None, name=None, parent=None, kind=None, view=None):
def NewCollectionFromKeywords(view, keywords, update = True): collection = AmazonCollection(keywords=keywords,view=view) if update: print "updating new amazon collection" return collection
bags = amazon.searchByKeyword(keywords)
def __init__(self,keywords=None,email=None, name=None, parent=None, kind=None, view=None): super(AmazonCollection, self).__init__(name, parent, kind, view) if keywords: bags = amazon.searchByKeyword(keywords) self.displayName = u'Amzn: ' + keywords elif email: try: results = amazon.searchWishListByEmail(email) except A...
try: results = amazon.searchWishListByEmail(email) except AttributeError: application.dialogs.Util.ok(wx.GetApp().mainFrame, _(u"Amazon Error"), _(u"No Amazon Wishlist was found for email address '%(emailAddress)s'") % {'emailAddress': email}) self.displayName = u'Amzn: Failed' return
def __init__(self,keywords=None,email=None, name=None, parent=None, kind=None, view=None): super(AmazonCollection, self).__init__(name, parent, kind, view) if keywords: bags = amazon.searchByKeyword(keywords) self.displayName = u'Amzn: ' + keywords elif email: try: results = amazon.searchWishListByEmail(email) except A...
print "Doing make " + dbgStr + " " + clean + " all binaries install\n" log.write("Doing make " + dbgStr + " " + clean + " all binaries install\n") outputList = hardhatutil.executeCommandReturnOutput( [buildenv['make'], dbgStr, clean, "all binaries install" ])
buildCmds = ' all binaries install' print "Doing make " + dbgStr + " " + clean + buildCmds + "\n" log.write("Doing make " + dbgStr + " " + clean + buildCmds + "\n") outputList = hardhatutil.executeCommandReturnOutput( [buildenv['make'], dbgStr, clean, buildCmds ])
def doBuild(buildmode, workingDir, log, cvsChanges, clean='realclean'): # We only build external if there were changes in it # We build internal if external or internal were changed # We never build in chandler, because there is nothing to build if buildmode == "debug": dbgStr = "DEBUG=1" else: dbgStr = "" buildRoot =...
try: return self.__getitem__(key) except: raise AttributeError, "object has no attribute '%s'" % key
if key[:1]<>'_': try: return self.__getitem__(key) except: pass raise AttributeError, "object has no attribute '%s'" % key
def __getattr__(self, key): try: return self.__dict__[key] except KeyError: pass try: return self.__getitem__(key) except: raise AttributeError, "object has no attribute '%s'" % key
return self.synchronizeLabel(self.staticTextLabelValue(item))
hasChanged = super(StaticTextLabel, self).synchronizeItemDetail(item) if self.isShown: labelChanged = self.synchronizeLabel(self.staticTextLabelValue(item)) hasChanged = hasChanged or labelChanged return hasChanged
def synchronizeItemDetail (self, item): return self.synchronizeLabel(self.staticTextLabelValue(item))
bar = tool.dynamicParent item = bar.selectedItem()
item = self.selectedItem()
def onButtonPressed (self, notification): # Rekind the item by adding or removing the associated Mixin Kind tool = notification.data['sender'] # DLDTBD - use self instead of bar here, once block copy problem is fixed. bar = tool.dynamicParent item = bar.selectedItem() # DLDTBD - once block copy problem is fixed, we won...
if bar.widget.GetToolState(tool.toolID):
if self.widget.GetToolState(tool.toolID):
def onButtonPressed (self, notification): # Rekind the item by adding or removing the associated Mixin Kind tool = notification.data['sender'] # DLDTBD - use self instead of bar here, once block copy problem is fixed. bar = tool.dynamicParent item = bar.selectedItem() # DLDTBD - once block copy problem is fixed, we won...
block = bar
block = self
def onButtonPressed (self, notification): # Rekind the item by adding or removing the associated Mixin Kind tool = notification.data['sender'] # DLDTBD - use self instead of bar here, once block copy problem is fixed. bar = tool.dynamicParent item = bar.selectedItem() # DLDTBD - once block copy problem is fixed, we won...
enable = True
def onButtonPressedUpdateUI (self, notification): item = self.selectedItem() # DLDTBD - fix the line below to False when the block copy problem is fixed. enable = True if item is not None: enable = item.itsKind.isKindOf(ContentModel.ContentModel.getNoteKind()) notification.data ['Enable'] = enable
enable = item.itsKind.isKindOf(ContentModel.ContentModel.getNoteKind())
enable = item.itsKind.isKindOf(ContentModel.ContentModel.getNoteKind()) else: enable = False
def onButtonPressedUpdateUI (self, notification): item = self.selectedItem() # DLDTBD - fix the line below to False when the block copy problem is fixed. enable = True if item is not None: enable = item.itsKind.isKindOf(ContentModel.ContentModel.getNoteKind()) notification.data ['Enable'] = enable
errorMessage = _("An unknown error occurred.")
errorMessage = constants.UNKNOWN_ERROR
def displaySMTPSendError (self, mailMessage): """ Called when the SMTP Send generated an error. """ if mailMessage is not None and mailMessage.isOutbound: """ Maybe we should select the message in CPIA? """ errorStrings = [] for error in mailMessage.deliveryExtension.deliveryErrors: errorStrings.append(error.errorStr...
if len (errorStrings) == 1: str = _("error") else: str = _("errors") errorMessage = _("The following %s occurred. %s") % (str, ', '.join(errorStrings)) errorMessage = errorMessage.encode ('utf-8') self.setStatusMessage (errorMessage, alert=True)
errorMessage = constants.UPLOAD_ERROR % (', '.join(errorStrings)) """Clear the status message""" self.setStatusMessage('') self.displayMailError (errorMessage, mailMessage.parentAccount)
def displaySMTPSendError (self, mailMessage): """ Called when the SMTP Send generated an error. """ if mailMessage is not None and mailMessage.isOutbound: """ Maybe we should select the message in CPIA? """ errorStrings = [] for error in mailMessage.deliveryExtension.deliveryErrors: errorStrings.append(error.errorStr...
assert len(selectedCanvasItems) == 1
def SelectedCanvasItem(self): """ Use the selection to find the currently selected canvas item, returning None if there isn't any """ selection = self.SelectedItems() # try our best to avoid iterating the entire selection try: selectedItem = selection.next() except StopIteration: return None # no items ...
if not ret: return False
if ret == "no_changes" or ret =="build_failed" or ret == "test_failed": return ret
def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log): # make sure workingDir is absolute, remove it, and create it workingDir = os.path.abspath(workingDir) if not os.path.exists(workingDir): os.mkdir(workingDir) os.chdir(workingDir) # remove outputDir and create it outputDir = os.path.join(wor...
sidebar = pim.KindCollection(view=repView) sidebar.displayName = 'Certificate Store' sidebar.kind = repView.findPath('//parcels/osaf/framework/certstore/Certificate')
sidebar = schema.ns('osaf.views.main', repView).sidebarItemCollection for item in sidebar: if isinstance(item, CertificateStore): return certstore = CertificateStore(view=repView) certstore.displayName = 'Certificate Store' certstore.kind = repView.findPath('//parcels/osaf/framework/certstore/Certificate')
def CreateSidebarView(repView, cpiaView): sidebar = pim.KindCollection(view=repView) sidebar.displayName = 'Certificate Store' sidebar.kind = repView.findPath('//parcels/osaf/framework/certstore/Certificate') # @@@MOR -- Transitioning to new Collection world. Does specifying # the kind above automatically populate th...
{'items': [sidebar]})
{'items': [certstore]})
def CreateSidebarView(repView, cpiaView): sidebar = pim.KindCollection(view=repView) sidebar.displayName = 'Certificate Store' sidebar.kind = repView.findPath('//parcels/osaf/framework/certstore/Certificate') # @@@MOR -- Transitioning to new Collection world. Does specifying # the kind above automatically populate th...
return ''
viewStr = cPickle.dumps(objectList) return base64.encodestring(viewStr)
def EncodeObjectList(self, objectList): return ''
def DecodeObjectList(self, objectList): return []
def DecodeObjectList(self, objectStr): pickledStr = base64.decodestring(objectStr) objectList = cPickle.loads(pickledStr)
def DecodeObjectList(self, objectList): return []
result = self.Copy() getattr(self, 'DeleteSelection', lambda: None)()
result = self.onCopyEvent(event) getattr(type(self), 'DeleteSelection', lambda s: None)(self)
def onCutEvent(self, event): result = self.Copy() # call self.DeleteSelection() if it is defined getattr(self, 'DeleteSelection', lambda: None)() return result
source=scripts
source=scripts, displayName='Scripts'
def installParcel(parcel, oldVersion=None): scripts = pim.KindCollection.update(parcel, 'scripts', kind=Script.getKind(parcel.itsView) ) scriptsCollection = \ pim.SmartCollection.update(parcel, 'scriptsCollection', renameable = False, private = False, source=scripts ) userScripts = UserCollection(scriptsCollection) u...
view.commit()
self.RepositoryCommitWithStatus ()
def onSyncAllEvent (self, event): """ Synchronize Mail and all sharing. The "File | Sync | All" menu item, and the Sync All Toolbar button. """
self.Refresh()
def insertInSortedList(eventList, newElement): # Could binary search here, but hopefully we're never # displaying that many events ... ? insertIndex = 0 for event in eventList: if event is newElement: return False if self.sortByStartTime(event, newElement) > 0: break insertIndex += 1
if parcelname.find('@') > -1:
if parcelname.find('@') > -1 and len(fields) > 1:
def ParseURL(self, url): if url.startswith('/'): url = url[1:] if url.endswith('/'): url = url[:-1] fields = url.split('/') remoteaddress = None parcelname = fields[0] localurl = url if parcelname.find('@') > -1: remoteaddress = fields[0] parcelname = fields[1] localurl = string.join(fields[1:], '/') return (parceln...
self.warm_init()
self._warm_init()
def onItemCopy(self, original): self.warm_init()
widget.NeedsUpdate (notification)
NeedsUpdateMethod = getattr (widget, 'NeedsUpdate')
def onItemChanges (self, notification): if self.queryEnum == "ContainerSearch": assert False, "This code isn't written"
an_item = app.repository.getRoots()[0] item = an_item.find(uri) self.DisplayItem(item)
app.wxMainFrame.GoToURL(uri, true)
def OnLinkClicked(self, wx_linkinfo): uri = wx_linkinfo.GetHref() an_item = app.repository.getRoots()[0] item = an_item.find(uri) self.DisplayItem(item)
kind = "(Kind not found)"
kind = "(kindless)"
def _formatReference(self, ref): """ formats the a reference attribute to be clickable, etcetera """ url = ref.getItemPath() if ref.hasAttributeValue('kind'): kind = ref.kind.getItemName() else: kind = "(Kind not found)" # Originally I was masking the fallback to itemName here just like in # the listview, but that does...
return "<a href=\"%(url)s\">%(kind)s: %(dn)s</a>" % locals()
return "<a href=\"Repository Viewer%(url)s\">%(kind)s: %(dn)s</a>" % locals()
def _formatReference(self, ref): """ formats the a reference attribute to be clickable, etcetera """ url = ref.getItemPath() if ref.hasAttributeValue('kind'): kind = ref.kind.getItemName() else: kind = "(Kind not found)" # Originally I was masking the fallback to itemName here just like in # the listview, but that does...
kind = "Kind not found"
kind = "(kindless)"
def DisplayItem(self, item): """Display the given Item's details in an HTML window. """ displayName = item.getItemDisplayName() if item.hasAttributeValue('kind'): kind = item.kind.getItemName() else: kind = "Kind not found" htmlString = "<html><body><h5>%s: %s</h5><ul>" % (kind, displayName) htmlString = htmlString +...
self.detail.SetPage("<html><body><h5>Item Viewer</h5></body></html>") else: self.DisplayItem(item) def DisplayItem(self, item): """Display the given Item's details in an HTML window. """
item == "" else: item = item.getItemPath() app.wxMainFrame.GoToURL("Repository Viewer%s" % (item,), true) def UpdateDisplay(self): item = self.model.GetDetailItem()
def OnSelChanged(self, event): """Display the selected Item. """ itemId = event.GetItem() item = self.treeCtrl.GetItemData(itemId).GetData()
kind = "Kind not found"
kind = "(kindless)"
def LoadItem(self, item, node): """Populates the tree's table with details of this particular item. """
self.treeCtrl.SetItemText(node, str(item.getUUID()), 3)
u = str(item.getUUID()) self.treeCtrl.SetItemText(node, u, 3) self.treeItemsByUUID[u] = node
def LoadItem(self, item, node): """Populates the tree's table with details of this particular item. """
self.monthButton = CollectionCanvas.CanvasTextButton(self, " September 8888 ",
self.monthButton = CollectionCanvas.CanvasTextButton(self, "",
def OnInit(self): # Setup the navigation buttons today = DateTime.today() self.prevButton = CollectionCanvas.CanvasBitmapButton(self, "application/images/backarrow.png") self.nextButton = CollectionCanvas.CanvasBitmapButton(self, "application/images/forwardarrow.png") self.todayButton = CollectionCanvas.CanvasTextButt...
box.Add(self.prevButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5)
def OnInit(self): # Setup the navigation buttons today = DateTime.today() self.prevButton = CollectionCanvas.CanvasBitmapButton(self, "application/images/backarrow.png") self.nextButton = CollectionCanvas.CanvasBitmapButton(self, "application/images/forwardarrow.png") self.todayButton = CollectionCanvas.CanvasTextButt...
box.Add(self.nextButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5)
def OnInit(self): # Setup the navigation buttons today = DateTime.today() self.prevButton = CollectionCanvas.CanvasBitmapButton(self, "application/images/backarrow.png") self.nextButton = CollectionCanvas.CanvasBitmapButton(self, "application/images/forwardarrow.png") self.todayButton = CollectionCanvas.CanvasTextButt...
self.monthButton = CollectionCanvas.CanvasTextButton(self, " September 8888 ",
self.monthButton = CollectionCanvas.CanvasTextButton(self, "",
def OnInit(self):
box.Add(self.prevButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5)
def OnInit(self):
box.Add(self.nextButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5)
def OnInit(self):
if isinstance(item, Mail.MailMessageMixin): item.whoFrom = item.getCurrentMeEmailAddress()
type = item.getAttributeAspect('whoFrom', 'type') contactKind = \ item.findPath("//parcels/osaf/contentmodel/contacts/Contact") if type is contactKind: item.whoFrom = item.getCurrentMeContact()
def loadAttributeIntoWidget(self, item, widget): """ Load the widget based on the attribute associated with whoFrom. """ try: whoFrom = item.whoFrom except AttributeError: whoFrom = None
item.whoFrom = item.getCurrentMeContact()
emailAddressKind = \ item.findPath("//parcels/osaf/contentmodel/mail/EmailAddress") if type is emailAddressKind: item.whoFrom = item.getCurrentMeEmailAddress()
def loadAttributeIntoWidget(self, item, widget): """ Load the widget based on the attribute associated with whoFrom. """ try: whoFrom = item.whoFrom except AttributeError: whoFrom = None
self.synchronizeWidget ()
widget = getattr (self, 'widget', None) if widget is not None: widget.wxSynchronizeWidget ()
def onSelectItemsEvent (self, event): # for the moment, multiple selection means, "select nothing" # i.e. multiple selection in the summary view means selecting # nothing in the detail view
reactor.addSystemEventTrigger('before', 'startup', limbo.pop)
reactor.addSystemEventTrigger('after', 'startup', limbo.pop)
def _del_pool(): reactor.threadpool = None
"Ready to add Clouds and/or other metadata, then remove from parcel.xml",
"Ready to add optional metadata, then remove from parcel.xml",
def report_details(clsname): for name, items in details[clsname].items(): report( "Inconsistent %s for %s:" % (name,clsname), items ) bad.add(clsname) del details[clsname]
def _setUUIDs(self):
def _setUUIDs(self, parent): ZaoBaoParcel.RSSItemParentID = parent.getUUID()
def _setUUIDs(self): ZaoBaoParcel.RSSChannelKindID = self.find('RSSChannel').getUUID() ZaoBaoParcel.RSSItemKindID = self.find('RSSItem').getUUID()
self._setUUIDs()
repository = self.getRepository() parent = repository.find('//userdata/zaobaoitems') self._setUUIDs(parent)
def onItemLoad(self): super(ZaoBaoParcel, self).onItemLoad() self._setUUIDs()
self._setUUIDs()
repository = self.getRepository() parent = repository.find('//userdata/zaobaoitems') if not parent: itemKind = repository.find('//Schema/Core/Item') userdata = repository.find('//userdata') if not userdata: userdata = itemKind.newItem('userdata', repository) parent = itemKind.newItem('zaobaoitems', userdata) self._set...
def startupParcel(self): super(ZaoBaoParcel, self).startupParcel() self._setUUIDs()
if line.find("IDE Scripts"):
if line.find("IDE Scripts") != -1:
def NeedsUpdate(outputList): for line in outputList: if line.find("IDE Scripts"): # this hack is for skipping some Mac-specific files that # under Windows always appear to be needing an update continue if line[0] == "U": return 1 if line[0] == "P": return 1 if line[0] == "A": return 1 if line[0] == "R": return 1
getItemTitle, and setMenuItem
and setMenuItem
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 getItemTitle (self, index, item): id = item.GetId() title = self.GetLabel (id) return title
def getMenuItems (self): return self.GetMenuItems()
getItemTitle, and setMenuItem
and setMenuItem
def wxSynchronizeWidget(self, **hints): self.blockItem.synchronizeItems()
def getItemTitle (self, index, item): title = wxMenuObject.GetLabelTop (index) return title
def getItemTitle (self, index, item): # @@@DLD - wxMenuObject needs to be set up here! title = wxMenuObject.GetLabelTop (index) return title
items = {} tree = {} base = view.findPath("//Schema/Core/Kind") for child in base.iterItems(): items[child.itsPath] = child _insertItem(tree, child.itsPath[1:], child)
items = {} tree = {} for item in ofKind('Kind'): items[item.itsPath] = item _insertItem(tree, item.itsPath[1:], item)
def RenderKinds(view, urlRoot): result = "" items = {} tree = {} #for item in view.findPath("//Schema/Core/Kind").iterItems(view): # print item # items[item.itsPath] = item # _insertItem(tree, item.itsPath[1:], item) base = view.findPath("//Schema/Core/Kind") for child in base.iterItems(): #print child.itsName...
application.Application.app.model.mainFrame = self.model;
application.Application.app.model.mainFrame = self.model event.Skip()
def OnActivate(self, event): """ The Application keeps a copy of the last persistent window openn so that the next time we run the application we can open the same window """ application.Application.app.model.mainFrame = self.model;
EVT_MENU (self, toggleDebugMenuId, self.OnToggleDebugMenu);
EVT_MENU (self, toggleDebugMenuId, self.OnToggleDebugMenu)
def OnInit(self, model): """ There's a tricky problem here. We need to postpone wiring up OnMove, OnSize, etc. after __init__, otherwise OnMove, etc. will get called before we've had a chance to set the windows size using the value in our model. """ self.model = model
print "Rsyncing..." outputList = hardhatutil.executeCommandReturnOutputRetry( [rsyncProgram, "-e", "ssh", "-avzp", "--delete", outputDir + os.sep, options.rsyncServer + ":continuous/" + buildNameNoSpaces]) hardhatutil.dumpOutputList(outputList, log)
if skipRsync: print "skipping rsync" else: print "Rsyncing..." outputList = hardhatutil.executeCommandReturnOutputRetry( [rsyncProgram, "-e", "ssh", "-avzp", "--delete", outputDir + os.sep, options.rsyncServer + ":continuous/" + buildNameNoSpaces]) hardhatutil.dumpOutputList(outputList, log)
def main(): global buildscriptFile, fromAddr, mailtoAddr, alertAddr, adminAddr, defaultDomain, defaultRsyncServer parser = OptionParser(usage="%prog [options] buildName", version="%prog 1.2") parser.add_option("-t", "--toAddr", action="store", type="string", dest="toAddr", default=mailtoAddr, help="Where to mail scrip...
import osaf.framework.wakeup.WakeupCallerParcel as WakeupCallerParcel
def run(self): logger.info("receiveWakeupCall()")
gridWindow.CaptureMouse()
def callHandler(cell, isInCell, oldnew): if cell is None or -1 in cell: return False renderer = self.GetCellRenderer(cell[1], cell[0]) try: # See if it's renderer with an attribute editor that wants # mouse events handler = renderer.delegate.OnMouseChange except AttributeError: # See if it's a section renderer that wa...
if gridWindow.HasCapture(): gridWindow.ReleaseMouse()
def callHandler(cell, isInCell, oldnew): if cell is None or -1 in cell: return False renderer = self.GetCellRenderer(cell[1], cell[0]) try: # See if it's renderer with an attribute editor that wants # mouse events handler = renderer.delegate.OnMouseChange except AttributeError: # See if it's a section renderer that wa...
if getattr(self, 'mouseCaptured', False): delattr(self, 'mouseCaptured')
def onDestroyWidget(self, *args, **kwds): view = self.itsView prefs = schema.ns('osaf.views.main', view).dashboardPrefs view.unwatchItem(self, prefs, 'onEnableSectionsPref') if getattr(self, 'mouseCaptured', False): delattr(self, 'mouseCaptured') # @@@ Temporarily commented out to workaround bug 7526 #self.widget.GetG...
wordWithSpace = word + ' ' dc.DrawText(wordWithSpace, x, y) x += width + spaceWidth
availableWidth = rectRight - x if width > availableWidth: DrawClippedText(dc, word, x, y, availableWidth, width) x += width else: wordWithSpace = word + ' ' dc.DrawText(wordWithSpace, x, y) x += width + spaceWidth
def DrawWrappedText(dc, text, rect): """ Simple wordwrap - draws the text into the current DC returns the height of the text that was written """ ignored, lineHeight = dc.GetTextExtent('M') #in case there are no words in the line spaceWidth, ignored = dc.GetTextExtent(' ') (rectX, rectY, rectWidth, rectHeight) = rect...
result = None try: view = self.itsView view.commit() view.repository.notifyIndexer(True) searchResults = view.searchItems(query) result = pim.SmartCollection (itsView=view, displayName=_(u"Search: %(query)s") % {'query' : query}) schema.ns("osaf.pim", self.itsView).mine.addSource(result) for item in search.processR...
self.arguments['sender'].widget.SetValue('') if (query != None) and (self.parseCommand(query) is False) and (query != ''): if not (query.startswith('/search') or query.startswith('/Search')): self.arguments['sender'].widget.SetValue(query + ' ?') wx.GetApp().CallItemMethodAsync("MainView", 'setStatusMessage', _(u"C...
def onNewItem (self): """ Create a new collection with the results of the search to be added to the sidebar """ query = self.arguments['sender'].widget.GetValue() result = None try: view = self.itsView
except PyLucene.JavaError, error: result.delete(recursive=True) result = None message = unicode (error) prefix = u"org.apache.lucene.queryParser.ParseException: " if message.startswith (prefix): message = message [len(prefix):] message = _(u"An error occured during search.\n\nThe search engine reported the following e...
message = unicode (error) prefix = u"org.apache.lucene.queryParser.ParseException: " if message.startswith (prefix): message = message [len(prefix):] message = _(u"An error occured during search.\n\nThe search engine reported the following error:\n\n" ) + message Util.ok (None, _(u"Search Error"), message) return re...
def onNewItem (self): """ Create a new collection with the results of the search to be added to the sidebar """ query = self.arguments['sender'].widget.GetValue() result = None try: view = self.itsView
otherItem = dav.DAV(nodes[0].content).get()
otherItem = Dav.DAV(nodes[0].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 item == draggedOutItem:
if item == draggedOutItem or item.isStale():
def drawCanvasItems(canvasItems, selected): for canvasItem in canvasItems: canvasItem.Draw(dc, styles, selected)
if item in self.orderLast: self.orderLast.remove(item) self.orderLast.append(item)
def OnSelectItem(self, item): if item: # clear background selection when an existing item is selected self._bgSelectionStartTime = self._bgSelectionEndTime = None super(wxTimedEventsCanvas, self).OnSelectItem(item)
tzinfo = self.canonicalTimeZone(self.default) if tzinfo is not None: PyICU.TimeZone.setDefault(tzinfo.timezone)
default = self.default canonicalDefault = self.canonicalTimeZone(default) if (canonicalDefault is not None and canonicalDefault is not PyICU.ICUtzinfo.floating): PyICU.ICUtzinfo.default = canonicalDefault if canonicalDefault is not default: self.default = canonicalDefault
def onValueChanged(self, name): # Repository hook for attribute changes. if name == 'default': tzinfo = self.canonicalTimeZone(self.default) if tzinfo is not None: PyICU.TimeZone.setDefault(tzinfo.timezone)
if rruleset is None and recurrenceID is None:
if rruleset is None and recurrenceID is None \ and eventItem.rruleset is not None:
def importProcess(self, text, extension=None, item=None, changes=None, previousView=None, updateCallback=None): # the item parameter is so that a share item can be passed in for us # to populate.
share.sync(updateCallback=updateCallback)
share.sync(updateCallback=updateCallback, modeOverride='get')
def subscribe(view, url, accountInfoCallback=None, updateCallback=None, username=None, password=None): (useSSL, host, port, path, query, fragment) = splitUrl(url) ticket = "" if query: for part in query.split('&'): (arg, value) = part.split('=') if arg == 'ticket': ticket = value.encode('utf8') break if ticket: acco...