rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
return (fontHeight+6) * 2
return (fontHeight+8) * 2
def getHourHeight(self, windowHeight, fontHeight): if self.hourHeightMode == "visibleHours": return windowHeight/self.visibleHours elif self.hourHeightMode == "pixelSize": return self.hourPixelSize else: return (fontHeight+6) * 2
Globals.notificationManager.Subscribe (events, self.subscriptionUUID, self.NeedsUpdate)
def ExpandContainer (self, openedContainers, id): try: expand = openedContainers [self.GetPyData(id)] except KeyError: return
schema.reset(self.UIRepositoryView)
def _displayHook(obj): if obj is not None: print repr(obj)
if not item.anyTime: item.anyTime = True self.AttributeChanged() return oldValue = getattr(item, attributeName) try: time = DateTimeAttributeEditor.shortTimeFormat.parse( newValueString, referenceDate=oldValue) except ICUError, ValueError: self._changeTextQuietly(self.control, "%s ?" % newValueString) return value...
if iAmStart: if not item.anyTime: item.anyTime = True changed = True else: zeroTime = timedelta() if item.duration != zeroTime: item.duration = zeroTime changed = True forceReload = True else: oldValue = getattr(item, attributeName) try: time = DateTimeAttributeEditor.shortTimeFormat.parse( newValueString, reference...
def SetAttributeValue(self, item, attributeName, valueString): newValueString = valueString.replace('?','').strip() if len(newValueString) == 0: # Clearing an event's start or end time (removing the value in it, causing # it to show "HH:MM") will remove both time values (making it an # anytime event). if not item.anyTi...
item.startTime = value - timedelta(hours=1) item.duration = timedelta(hours=1) else: if not iAmStart: if value < item.startTime: item.startTime = value setattr (item, attributeName, value) item.anyTime = False
if not iAmStart: if value < item.startTime: item.startTime = value setattr (item, attributeName, value) item.anyTime = False changed = True
def SetAttributeValue(self, item, attributeName, valueString): newValueString = valueString.replace('?','').strip() if len(newValueString) == 0: # Clearing an event's start or end time (removing the value in it, causing # it to show "HH:MM") will remove both time values (making it an # anytime event). if not item.anyTi...
self.SetControlValue(self.control, self.GetAttributeValue(item, attributeName))
if changed or forceReload: self.SetControlValue(self.control, self.GetAttributeValue(item, attributeName))
def SetAttributeValue(self, item, attributeName, valueString): newValueString = valueString.replace('?','').strip() if len(newValueString) == 0: # Clearing an event's start or end time (removing the value in it, causing # it to show "HH:MM") will remove both time values (making it an # anytime event). if not item.anyTi...
userAgent = "Chandler/%s" % version.version
platformName = Utility.getPlatformName() userAgent = "Chandler/%s (%s)" % (version.version, platformName)
def __init__(self, host=None, port=None, username=None, password=None, useSSL=False, repositoryView=None): self.resourcesByPath = {} # Caches resources indexed by path
import photos
def installParcel(parcel, oldVersion=None): from osaf import sharing, startup from osaf.framework import scripting import photos curDav = Reference.update(parcel, 'currentWebDAVAccount') curMail = Reference.update(parcel, 'currentMailAccount') curSmtp = Reference.update(parcel, 'currentSMTPAccount') curCon = Referenc...
welcome = photos.Photo.update(parcel, 'WelcomePhoto',
welcome = pim.CalendarEvent.update(parcel, 'WelcomeEvent',
def installParcel(parcel, oldVersion=None): from osaf import sharing, startup from osaf.framework import scripting import photos curDav = Reference.update(parcel, 'currentWebDAVAccount') curMail = Reference.update(parcel, 'currentMailAccount') curSmtp = Reference.update(parcel, 'currentSMTPAccount') curCon = Referenc...
dateTaken=datetime.datetime.now(), creator=osafDev ) welcome.importFromFile(os.path.join(os.path.dirname(__file__), "TeamOSAF.jpg"))
startTime=datetime.datetime.combine(datetime.date.today(), datetime.time(12)), duration=datetime.timedelta(minutes=120), anyTime=False, creator=osafDev, location=pim.Location.update(parcel, "OSAFLocation", displayName="Open Source Applications Foundation" ) )
def installParcel(parcel, oldVersion=None): from osaf import sharing, startup from osaf.framework import scripting import photos curDav = Reference.update(parcel, 'currentWebDAVAccount') curMail = Reference.update(parcel, 'currentMailAccount') curSmtp = Reference.update(parcel, 'currentSMTPAccount') curCon = Referenc...
EVT_MAIN_THREAD_CALLBACK(self, self.OnMainThreadCallbackEvent)
def _displayHook(obj): if obj is not None: print repr(obj)
for index in range (self.GetColumnCount()):
columnIndexes = range(self.GetColumnCount()) columnIndexes.reverse() for index in columnIndexes:
def ExpandContainer (self, openedContainers, id): try: expand = openedContainers [self.GetPyData(id)] except KeyError: return
Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup
Lookup or create an EmailAddress based on the supplied string. If a matching EmailAddress object is found in the repository, it is returned. If there is no match, then a new item is created and returned. There are two ways to call this method: 1) with something the user typed in nameOrAddressString, which will be pars...
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName:...
@param fullName: explict fullName to use when a new item is created
@param fullName: optional explict fullName when not using the "name <address>" form of the nameOrAddressString parameter
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName:...
if fullName == '':
if fullName != '': name = fullName else:
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName:...
pass
name = address
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName:...
fullName, address = address.split ('<')
name, address = address.split ('<')
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName:...
fullName = fullName.strip ()
name = name.strip () if name == 'me': name = ''
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName:...
if not isValidAddress: address = None """ At this point we should have: name - the name to search for, or '' address - the address to search for, or None If the user specified a single word which could also be a valid email address, we could have that word in both the address and name variables. """
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName:...
where i.emailAddress =="$0" or i.fullName =="$0"'
where i.emailAddress =="$0" or i.fullName =="$1"'
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName:...
addrQuery.args = [ address ]
addrQuery.args = [ address, name ]
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName:...
elif address != '' and address == candidate.fullName:
elif name != '' and name == candidate.fullName:
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName:...
if fullName != '': candidate.fullName = fullName return candidate elif address == candidate.fullName:
addressMatch = candidate if name != '' and name == candidate.fullName:
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName:...
return candidate
nameMatch = candidate if addressMatch is not None: return addressMatch
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName:...
newAddress.fullName = fullName
newAddress.fullName = name
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName:...
os.chdir(buildenv['root']) compFile = hardhatlib.compressDirectory(buildenv, ["debug", "Chandler"],
distName = 'Chandler_win_debug_' + buildVersionShort distDir = buildenv['root'] + os.sep + distName buildenv['distdir'] = distDir if os.access(distDir, os.F_OK): hardhatlib.rmdir_recursive(distDir) os.mkdir(distDir) manifestFile = "distrib" + os.sep + "win" + os.sep + \ "manifest.debug.win" hardhatlib.handleManifest(b...
def distribute(buildenv): _CreateVersionFile(buildenv) buildVersionShort = \ hardhatutil.RemovePunctuation(buildenv['buildVersion']) # When the build version string is based on one of our CVS tags # (which usually begin with "CHANDLER_") let's remove the "CHANDLER_" # prefix from the string so it doesn't end up in t...
self.EndBatch() message = wx.grid.GridTableMessage (gridTable, wx.grid.GRIDTABLE_REQUEST_VIEW_GET_VALUES) self.ProcessTableMessage (message) self.ForceRefresh ()
def wxSynchronizeWidget(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.blockItem.selectedItemToView = row
self.blockItem.selectedItemToView = item
def GoToItem(self, item): if item: try: row = self.blockItem.contents.index (item) except ValueError: item = None if item: self.blockItem.selection.append ([row, row, True]) self.blockItem.selectedItemToView = row self.SelectBlock (row, 0, row, self.GetColumnCount() - 1) self.MakeCellVisible (row, 0) else: self.blockIt...
Does a repository commit to get the changes across from the other thread. """ Globals.repository.commit ()
Does a repository refresh to get the changes across from the other thread. """ Globals.repository.refresh ()
def _DispatchItemMethod (self, transportItem, methodName, transportArgs, keyArgs): """ Private dispatcher for a method call on an item done between threads. See CallItemMethodAsync() below for calling details. Does a repository commit to get the changes across from the other thread. """ Globals.repository.commit () # b...
m = importIcalendarPayload(mimePart.get_payload())
m = importIcalendarPayload(mimePart)
def importIcalendarPayload(mailobj): if mailobj.get_content_type() == "text/calendar": import osaf.sharing.ICalendar as ICalendar try: items = ICalendar.itemsFromVObject(view, mailobj.get_payload(), filters=('reminders',))[0] except: # ignore parts we can't parse pass else: if len(items) > 0: # We got something - stamp...
eventColors = styles.blockItem.getEventColors(item) if selected: penColor = eventColors.selectedOutlineColor gradientLeft = eventColors.selectedGradientLeft gradientRight = eventColors.selectedGradientRight textColor = eventColors.selectedTextColor else: penColor = eventColors.outlineColor gradientLeft = eventColors.gr...
gradientLeft, gradientRight, outlineColor, textColor = \ styles.blockItem.getEventColors(item, selected)
def Draw(self, dc, boundingRect, styles, brushOffset, selected): item = self._item
dc.SetPen(wx.Pen(penColor))
def Draw(self, dc, boundingRect, styles, brushOffset, selected): item = self._item
pen = self.GetStatusPen(penColor)
pen = self.GetStatusPen(outlineColor)
def Draw(self, dc, boundingRect, styles, brushOffset, selected): item = self._item
eventColors = styles.blockItem.getEventColors(item)
gradientLeft, gradientRight, outlineColor, textColor = \ styles.blockItem.getEventColors(item, selected)
def Draw(self, dc, styles, brushOffset, selected): item = self._item itemRect = self._bounds eventColors = styles.blockItem.getEventColors(item) if selected: brush = styles.brushes.GetGradientBrush(itemRect.x + brushOffset, itemRect.width, eventColors.selectedGradientLeft, eventColors.selectedGradientRight) pen = wx.P...
eventColors.selectedGradientLeft, eventColors.selectedGradientRight) pen = wx.Pen(eventColors.selectedOutlineColor)
gradientLeft, gradientRight) pen = wx.Pen(outlineColor)
def Draw(self, dc, styles, brushOffset, selected): item = self._item itemRect = self._bounds eventColors = styles.blockItem.getEventColors(item) if selected: brush = styles.brushes.GetGradientBrush(itemRect.x + brushOffset, itemRect.width, eventColors.selectedGradientLeft, eventColors.selectedGradientRight) pen = wx.P...
dc.SetTextForeground(eventColors.textColor)
dc.SetTextForeground(textColor)
def Draw(self, dc, styles, brushOffset, selected): item = self._item itemRect = self._bounds eventColors = styles.blockItem.getEventColors(item) if selected: brush = styles.brushes.GetGradientBrush(itemRect.x + brushOffset, itemRect.width, eventColors.selectedGradientLeft, eventColors.selectedGradientRight) pen = wx.P...
def getCalendarData(self): """ Lazily stamp the data """ caldata = self.contents.source.first() if not isinstance(caldata, CalendarData): caldata.StampKind('add', CalendarData.getKind(view=caldata.itsView))
def StampedCalendarData(self, collection): if not isinstance(collection, CalendarData): collection.StampKind('add', CalendarData.getKind(view=collection.itsView))
def GetCurrentDateRange(self): if self.dayMode: startDay = self.selectedDate endDay = startDay + DateTime.RelativeDateTime(days = 1) else: startDay = self.rangeStart endDay = startDay + self.rangeIncrement return (startDay, endDay)
caldata.calendarColor = colorstyle
collection.calendarColor = colorstyle
def getCalendarData(self): """ Lazily stamp the data """ caldata = self.contents.source.first() if not isinstance(caldata, CalendarData): caldata.StampKind('add', CalendarData.getKind(view=caldata.itsView)) # XXX really, the object should be lazily creating this. colorstyle = Styles.ColorStyle(view=self.itsView) # ma...
return caldata
return collection def getCalendarData(self): """ Returns a CalendarData object that can be used to persistently store calendar color data, and associate it with the collection. At the moment, this stamps the current itemcollection as a CalendarData """ return self.StampedCalendarData(self.contents.source.first())
def getCalendarData(self): """ Lazily stamp the data """ caldata = self.contents.source.first() if not isinstance(caldata, CalendarData): caldata.StampKind('add', CalendarData.getKind(view=caldata.itsView)) # XXX really, the object should be lazily creating this. colorstyle = Styles.ColorStyle(view=self.itsView) # ma...
def getEventColors(self, event):
def getEventColors(self, event, selected): calData = self.getEventCalendarData(event) if selected: return calData.selectedColors elif calData == self.contents.source.first(): return calData.defaultColors return calData.visibleColors def getEventCalendarData(self, event):
def getEventColors(self, event): """ Get the eventColors object which contains all the right color tints for the given event. If the given event doesn't have color data, then we return the default one associated with the view """ containingCollections = event.itemCollectionInclusions calDataKind = CalendarData.getKind(...
for coll in containingCollections:
for coll in collections:
def getEventColors(self, event): """ Get the eventColors object which contains all the right color tints for the given event. If the given event doesn't have color data, then we return the default one associated with the view """ containingCollections = event.itemCollectionInclusions calDataKind = CalendarData.getKind(...
if (not getattr(coll, 'renameable', False)) and \ coll.isItemOf(calDataKind): return coll
if (event in coll): if getattr(coll, 'renameable', True): return self.StampedCalendarData(coll) else: firstSpecialCollection = self.StampedCalendarData(coll) if firstSpecialCollection: return firstSpecialCollection
def getEventColors(self, event): """ Get the eventColors object which contains all the right color tints for the given event. If the given event doesn't have color data, then we return the default one associated with the view """ containingCollections = event.itemCollectionInclusions calDataKind = CalendarData.getKind(...
(filenameChanged, changesAtAll) = NeedsUpdate(outputList, filename) if changesAtAll:
(filenameChangedInMod, changesAtAllInMod) = NeedsUpdate(outputList, filename) if filenameChangedInMod: filenameChanged = True if changesAtAllInMod: changesAtAll = True
def changesInCVS(moduleDir, workingDir, cvsVintage, log, filename): changesAtAll = False filenameChanged = False
return ((not filename or line[2:-1] == filename), True)
filenameChanged = not filename or line[2:-1] == filename anyfileChanged = True
def NeedsUpdate(outputList, filename): """ @return: Returns a tuple of booleans. The first is true if filename is empty and there were some changes or the filename was changed. The second is true if there were any changes. """ for line in outputList: if line.lower().find("ide scripts") != -1: # this hack is for skippin...
return ((not filename or line[2:-1] == filename), True) return (False, False)
filenameChanged = not filename or line[2:-1] == filename anyfileChanged = True return (filenameChanged, anyfileChanged)
def NeedsUpdate(outputList, filename): """ @return: Returns a tuple of booleans. The first is true if filename is empty and there were some changes or the filename was changed. The second is true if there were any changes. """ for line in outputList: if line.lower().find("ide scripts") != -1: # this hack is for skippin...
self.LoadChildren(event.GetItem())
if not Globals.wxApplication.ignoreSynchronizeWidget: self.LoadChildren(event.GetItem())
def OnExpanding(self, event): self.LoadChildren(event.GetItem())
try: del block.openedContainers [self.GetItemData(id).GetData()] except AttributeError: pass self.CollapseAndReset (id)
del block.openedContainers [self.GetItemData(id).GetData()] self.DeleteChildren (id)
def OnCollapsing(self, event): block = Globals.repository.find (self.blockUUID) id = event.GetItem() """ if the data passed in has a UUID we'll keep track of the state of the opened tree """ try: del block.openedContainers [self.GetItemData(id).GetData()] except AttributeError: pass self.CollapseAndReset (id)
return self.LoadChildren(id) if self.IsVisible(id):
pass else: self.LoadChildren(id)
def ExpandContainer (self, openedContainers, id): try: expand = openedContainers [self.GetItemData(id).GetData()] except KeyError: return
self.LoadChildren(rootNodeId) ExpandContainer (self, block.openedContainers, self.GetRootItem ())
self.LoadChildren (rootNodeId) ExpandContainer (self, block.openedContainers, rootNodeId)
def ExpandContainer (self, openedContainers, id): try: expand = openedContainers [self.GetItemData(id).GetData()] except KeyError: return
getMasterMethod = getattr(pim.EventStamp(item), 'getMaster', None) if getMasterMethod is not None: item = getMasterMethod()
item = pim.EventStamp(item).getMaster().itsItem
def getAppearsInNames(item): # Only a recurrence master appears 'in' the collection (for 0.6, anyway) # so if this item lets us get its master, do so and use that instead. if pim.has_stamp(item, pim.EventStamp): getMasterMethod = getattr(pim.EventStamp(item), 'getMaster', None) if getMasterMethod is not None: item = ge...
[cvsProgram, "-q", "checkout", cvsVintage, "chandler"])
[cvsProgram, "-q -z3", "checkout", cvsVintage, "chandler"])
def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log): global buildenv, changes try: buildenv = hardhatlib.defaults buildenv['root'] = workingDir buildenv['hardhatroot'] = whereAmI hardhatlib.init(buildenv) except hardhatlib.HardHatMissingCompilerError: print "Could not locate compiler. Exiti...
[cvsProgram, "-qn", "update", "-d", cvsVintage])
[cvsProgram, "-qn -z3", "update", "-d", cvsVintage])
def changesInCVS(moduleDir, workingDir, cvsVintage, log, filename): changesAtAll = False filenameChanged = False
[cvsProgram, "-q", "update", "-Ad"])
[cvsProgram, "-q -z3", "update", "-dP", cvsVintage])
def changesInCVS(moduleDir, workingDir, cvsVintage, log, filename): changesAtAll = False filenameChanged = False
sideBarURLTree is the subset of the app.model.URLTree visible in ChandlerWindow with some added information as to whether or not each node is expanded.
sideBarURLTree is a dict mapping what this instance of SideBar has visible to the application's full URLTree. The dict is a tree of dicts that contain extra data specific to this instance of SideBar (like which levels are expanded).
def __init__(self): """ sideBarURLTree is the subset of the app.model.URLTree visible in ChandlerWindow with some added information as to whether or not each node is expanded. """ self.sideBarURLTree = PersistentDict.PersistentDict()
self.__UpdateURLTree(self.sideBarURLTree, app.model.URLTree)
if not hasattr(wxWindow, 'root'): wxWindow.root = wxWindow.AddRoot('Root')
def SynchronizeView(self): """ Notifies the window's wxPython counterpart that they need to synchronize themselves to match their peristent model counterpart. Whenever the application's URLTree is changed, the sidebar is notified with the SynchronizeView to update the sideBarURLTree to reflect changes """ if not app.as...
def __UpdateURLTree(self, sideBarURLTree, appURLTree):
self.__UpdateURLTree(self.sideBarURLTree, app.model.URLTree, wxWindow.root) def __UpdateURLTree(self, sideBarURLTree, appURLTree, parent):
def __UpdateURLTree(self, sideBarURLTree, appURLTree): """ Synchronizes the sidebar's URLTree with the application's URLTree. The sidebar only stores a dict mapping visible items in the sidebar to their instances in the application. """ for item in appURLTree: instance = item[0] name = item[1] childrenList = item[2] i...
childrenList = item[2] instanceId = id(instance) if not sideBarURLTree.has_key(id(instance)): childrenDict = {} for child in childrenList: childrenDict[id(child)] = child sideBarURLTree[instanceId] = [instance, false, 0, childrenDict, false]
children = item[2] hasChildren = len(children) > 0 if not sideBarURLTree.has_key(instanceId): itemId = app.association[id(self)].AppendItem(parent, name) app.association[id(self)].SetItemHasChildren(itemId, hasChildren) sideBarURLTree[instanceId] = [instance, false, itemId, {}, false]
def __UpdateURLTree(self, sideBarURLTree, appURLTree): """ Synchronizes the sidebar's URLTree with the application's URLTree. The sidebar only stores a dict mapping visible items in the sidebar to their instances in the application. """ for item in appURLTree: instance = item[0] name = item[1] childrenList = item[2] i...
itemId = sideBarURLTree[instanceId][2] app.association[id(self)].SetItemHasChildren(itemId, hasChildren)
def __UpdateURLTree(self, sideBarURLTree, appURLTree): """ Synchronizes the sidebar's URLTree with the application's URLTree. The sidebar only stores a dict mapping visible items in the sidebar to their instances in the application. """ for item in appURLTree: instance = item[0] name = item[1] childrenList = item[2] i...
self.UpdateURLTree(sideBarURLTree[instanceId][3], children)
self.__UpdateURLTree(sideBarURLTree[instanceId][3], item[2], itemId)
def __UpdateURLTree(self, sideBarURLTree, appURLTree): """ Synchronizes the sidebar's URLTree with the application's URLTree. The sidebar only stores a dict mapping visible items in the sidebar to their instances in the application. """ for item in appURLTree: instance = item[0] name = item[1] childrenList = item[2] i...
app.association[id(self)].UpdateView()
def __UpdateURLTree(self, sideBarURLTree, appURLTree): """ Synchronizes the sidebar's URLTree with the application's URLTree. The sidebar only stores a dict mapping visible items in the sidebar to their instances in the application. """ for item in appURLTree: instance = item[0] name = item[1] childrenList = item[2] i...
def UpdateView(self): """ Updates the wxTreeCtrl to match the model's version of the Sidebar. Right now, it only displays the first level parcel names, but it should recursively display all of the available uri's. """ if not hasattr(self, 'root'): self.root = self.AddRoot("Root") for item in app.model.URLTree: instanc...
def UpdateView(self): """ Updates the wxTreeCtrl to match the model's version of the Sidebar. Right now, it only displays the first level parcel names, but it should recursively display all of the available uri's. """ if not hasattr(self, 'root'): self.root = self.AddRoot("Root") for item in app.model.URLTree: instanc...
def OnItemExpanding(self, event): item = event.GetItem() text = self.GetItemText(item) for item in app.model.URLTree: parcel = item[0] """ Each parcel must have an attribute which is the displayName. """ assert (hasattr (parcel, 'displayName')) if parcel.displayName == text: instanceId = id(parcel) self.model.sideBarUR...
def OnSelChanged(self, event): """ Whenever the selection changes in the sidebar we must update the current view to visit the proper uri. Right now, it only allows you to select parcels, and not visit specific uri's, but that is only temporary. """ clickedItem = event.GetItem() text = self.GetItemText(clickedItem) for...
if not share.filterClasses: filterMatches = True else: filterMatches = False
if share.filterClasses: partial = "Partial"
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:
filterMatches = True if ((filterKind is None) or filterMatches): if (sharing.isSharedByMe(share)): shared = "Upload" else: shared = "Download" if filterKind is None and len (share.filterClasses) != 0: partial = "Partial"
partial = "" if (sharing.isSharedByMe(share)): shared = "Upload" else: shared = "Download"
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:
index += '<h3>Developer Installer</h3>\n' +\
index += '<h3>Debug Installer</h3>\n' +\
def CreateIndex(treeName, 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 ...
'<p>The Developer compressed images contain a snapshot of Cosmo.</p>\n'
'<p>The Debug compressed images contain a snapshot of Cosmo.</p>\n'
def CreateIndex(treeName, 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 ...
'<p>The End-User and Developer compressed images contain a snapshot of Chandler.\n' +\
'<p>The End-User and Debug compressed images contain a snapshot of Chandler.\n' +\
def CreateIndex(treeName, 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 ...
index += '<p>Developers: <a href="%s">%s</a> (%s): %s<br/>\n' % \
index += '<p>Debug: <a href="%s">%s</a> (%s): %s<br/>\n' % \
def CreateIndex(treeName, 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 ...
shouldClearCollection = \ promptYesNoCancel(_(u'Do you also want to delete the items in this collection?'), viewsmain.clearCollectionPref) if shouldClearCollection is None: return
shouldClearCollection = True notMine = schema.ns('osaf.pim', self.itsView).notMine for collection in self.contents.iterSelection(): if collection not in notMine.sources: shouldClearCollection = \ promptYesNoCancel(_(u'Do you also want to delete the items in this collection?'), viewsmain.clearCollectionPref) if should...
def onRemoveEvent(self, event): """ Permanently remove the collection - we eventually need a user confirmation here """
if (shouldClearCollection):
if shouldClearCollection:
def deleteItem(collection):
itemsForRemoval = [] itemsForDeletion = []
def ClearCollectionContents(self, collection): """ Remove items that should be removed, delete items that should be deleted. Note that we're not doing any proxy-aware code here, because we're dealing with the actual items that are in the collection. """ itemsForRemoval = [] itemsForDeletion = []
self.widget.displayItems() self.widget.Refresh()
self.widget.renderDateChanged()
def onSelectedDateChangedEvent(self, notification): self.updateRange(notification.data['start']) self.widget.displayItems() self.widget.Refresh()
if (eventItem.occurrenceFor is None and eventItem.occurrences is None): eventItem.occurrenceFor = eventItem
def itemsFromVObject(view, text, coerceTzinfo = None, filters = None, monolithic = True, updateCallback=None, stats=None): """ Take a string, create or update items from that stream. The filters argument is an optional sequence of attributes to not populate. monolithic is True for calendars that may contain multiple ...
if share.exists(): share.destroy()
try: if share.exists(): share.destroy() except CouldNotConnect, e: pass
def unpublish(collection): """ Remove a share from the server, and delete all associated Share objects @type collection: pim.AbstractCollection @param collection: The shared collection to unpublish """ for share in collection.shares: # Remove from server (or disk, etc.) if share.exists(): share.destroy() # Clean up...
callNamedMethod(block, methodName, event)
return callNamedMethod(block, methodName, event)
def callMethod(block, methodName, event): """ wrapper for callNamedMethod that optionally invokes the profiler """
return "<html><body><h5>%s</h5></body></html>" % item.getAbout()
HTMLText = "<html><body>" kind = item.kind if kind is Calendar.CalendarParcel.getCalendarEventKind(): HTMLText += "<b>Headline: </b> %s<br>" % item.getAbout() HTMLText += "<b>Attendees: </b> %s<br>" % item.getWho() HTMLText += "<b>Date: </b> %s<br>" % item.getDate() HTMLText += "<b>Duration: </b> %s<br>" % item.durati...
def getHTMLText(self, item): return "<html><body><h5>%s</h5></body></html>" % item.getAbout()
if element is self.GetRootKind(): return True else: return False
return (element is self.GetRootKind())
def ElementHasChildren(self, element): if element is self.GetRootKind(): return True else: return False
pass
item = Globals.repository.find(notification.data['uuid']) if item.kind is self.GetRootKind(): self.scheduleUpdate = True
def NeedsUpdate(self, notification): # @@@ Need observable queries! pass
logger.warning ("Couldn't find suitable candidates for stamping %s with %s." \
logger.debug ("Couldn't find suitable candidates for stamping %s with %s." \
def _findStampedKind (self, operation, stampKind): """ Return the new Kind that results from self being stamped with the Mixin Kind specified. @param self: an Item that will be stamped @type self: C{Item} @param operation: 'add' to add the Mixin, 'remove' to remove @type operation: C{String} @param mixinKind: the Mixin...
logger.warning ("Exact matches: %s" % exactMatches) logger.warning ("Close matches: %s" % closeMatches)
logger.debug ("Exact matches: %s" % exactMatches) logger.debug ("Close matches: %s" % closeMatches)
def _findStampedKind (self, operation, stampKind): """ Return the new Kind that results from self being stamped with the Mixin Kind specified. @param self: an Item that will be stamped @type self: C{Item} @param operation: 'add' to add the Mixin, 'remove' to remove @type operation: C{String} @param mixinKind: the Mixin...
def __init__(self, *args, **kwds): super(ReminderTimer, self).__init__(*args, **kwds) self.reminderDialog = None
def __init__(self, *args, **kwds): super(ReminderTimer, self).__init__(*args, **kwds) self.reminderDialog = None
if self.reminderDialog is not None: (nextReminderTime, closeIt) = self.reminderDialog.UpdateList(pending)
reminderDialog = self.getReminderDialog(False) if reminderDialog is not None: (nextReminderTime, closeIt) = reminderDialog.UpdateList(pending)
def onCollectionChanged(self, notification): # print "*** Got reminders collection changed!" pending = self.getPendingReminders() closeIt = False if self.reminderDialog is not None: (nextReminderTime, closeIt) = self.reminderDialog.UpdateList(pending) elif len(pending) > 0: nextReminderTime = pending[0].reminderTime el...
self.reminderDialog.Destroy() self.reminderDialog = None
self.closeReminderDialog();
def onCollectionChanged(self, notification): # print "*** Got reminders collection changed!" pending = self.getPendingReminders() closeIt = False if self.reminderDialog is not None: (nextReminderTime, closeIt) = self.reminderDialog.UpdateList(pending) elif len(pending) > 0: nextReminderTime = pending[0].reminderTime el...
event=buttonPressed)
event=buttonPressed, stretchFactor=0.0, minimumSize=SizeType(30, 17))
def makeMarkupBar(parcel, oldVersion): """ Build the markup bar. """ # Each button just sends this event to itself. buttonPressed = BlockEvent.template('ButtonPressed', 'SendToSender').install(parcel) # The buttons. mailMessageButton = \ MailMessageButtonBlock.template('MailMessageButton', title=messages.STAMP_MAIL, ...
event=buttonPressed)
event=buttonPressed, stretchFactor=0.0, minimumSize=SizeType(30, 17)) markupSpacer1 = ControlBlocks.StaticText.template('MarkupSpacer1', title=u'', stretchFactor=0.0, minimumSize=SizeType(30, 17))
def makeMarkupBar(parcel, oldVersion): """ Build the markup bar. """ # Each button just sends this event to itself. buttonPressed = BlockEvent.template('ButtonPressed', 'SendToSender').install(parcel) # The buttons. mailMessageButton = \ MailMessageButtonBlock.template('MailMessageButton', title=messages.STAMP_MAIL, ...
event=buttonPressed)
event=buttonPressed, stretchFactor=0.0, minimumSize=SizeType(30, 17)) markupSpacer2 = ControlBlocks.StaticText.template('MarkupSpacer2', title=u'', stretchFactor=1.0)
def makeMarkupBar(parcel, oldVersion): """ Build the markup bar. """ # Each button just sends this event to itself. buttonPressed = BlockEvent.template('ButtonPressed', 'SendToSender').install(parcel) # The buttons. mailMessageButton = \ MailMessageButtonBlock.template('MailMessageButton', title=messages.STAMP_MAIL, ...
self.selection = []
for item in self.selection: if item not in self.contents: selection.remove(item)
def onSetContentsEvent (self, event): self.setContentsOnBlock (event.arguments ['item']) """ Clear the selection each time we view a new contents until we get a selection added to the contents item -- DJA """ self.selection = [] self.synchronizeWidget() self.postSelectItemsBroadcast()
method = change['method'] args = change.get('args', []) kwds = change.get('kwds', {}) method(*args, **kwds)
if change != lastChange: method = change['method'] args = change.get('args', []) kwds = change.get('kwds', {}) method(*args, **kwds) lastChange = change
def propagateBufferChanges(self): while len(self.changeBuffer) > 0: change = self.changeBuffer.pop(0)
if (isinstance(shares[0].conduit, WebDAVConduit) and
if (len(shares) > 1 and isinstance(shares[0].conduit, WebDAVConduit) and
def mergeFunction(code, item, attribute, value): # 'value' is the one from the *this* view # getattr(item, attribute) is the value from a different view
m = Mail.MailMessage(itsView=view)
m = None if messageObject.is_multipart(): for mimePart in messageObject.get_payload(): if mimePart.get_content_type() == "text/calendar": import osaf.sharing.ICalendar as ICalendar try: items = ICalendar.itemsFromVObject(view, mimePart.get_payload(), filters=('reminders',))[0] except: pass else: if len(items) > 0: m...
def messageObjectToKind(view, messageObject, messageText=None, indexText=False, compression='bz2'): """ This method converts a email message string to a Chandler C{Mail.MailMessage} object @param messageObject: A C{email.Message} object representation of a mail message @type messageObject: C{email.Message} @return: C{...
eventDescriptionLength = int(messageObject.get(createChandlerHeader(\ "EventDescriptionLength"), "0")) if eventDescriptionLength and isinstance(m, Mail.MailMessageMixin): body = body[eventDescriptionLength:]
def messageObjectToKind(view, messageObject, messageText=None, indexText=False, compression='bz2'): """ This method converts a email message string to a Chandler C{Mail.MailMessage} object @param messageObject: A C{email.Message} object representation of a mail message @type messageObject: C{email.Message} @return: C{...
location = getattr(mailMessage, 'location', None) if location is not None and len(unicode(location)) > 0:
location = unicode(getattr(mailMessage, 'location', u'')) if len(location) > 0:
def kindToMessageObject(mailMessage): """ This method converts a email message string to a Chandler C{Mail.MailMessage} object @param messageObject: A C{email.Message} object representation of a mail message @type messageObject: C{email.Message} @return: C{Message.Message} """ assert isinstance(mailMessage, Mail.Mai...
payload = _(u"%(whenLabel)s: %(whenValue)s%(locationPair)s\n\n%(body)s\n") \
eventDescription = _(u"%(whenLabel)s: %(whenValue)s%(locationPair)s\n\n") \
def kindToMessageObject(mailMessage): """ This method converts a email message string to a Chandler C{Mail.MailMessage} object @param messageObject: A C{email.Message} object representation of a mail message @type messageObject: C{email.Message} @return: C{Message.Message} """ assert isinstance(mailMessage, Mail.Mai...
'locationPair': location,
'locationPair': location } payload = _(u"%(eventDescription)s%(body)s\n") \ % { 'eventDescription': eventDescription,
def kindToMessageObject(mailMessage): """ This method converts a email message string to a Chandler C{Mail.MailMessage} object @param messageObject: A C{email.Message} object representation of a mail message @type messageObject: C{email.Message} @return: C{Message.Message} """ assert isinstance(mailMessage, Mail.Mai...
if wxPlatform != '__WXGTK__': wxWindow.SetToolBar (None)
def SynchronizeView(self): """ Notifies the window's wxPython view counterpart that they need to synchronize themselves to match their peristent model counterpart. """ app = application.Application.app if not app.association.has_key(id(self)): wxWindow = app.applicationResources.LoadFrame (None, "ChandlerWindow") asser...
if wxPlatform == '__WXGTK__': self.navigationBar = self.GetToolBar() else: self.navigationBar = self.FindWindowByName("NavigationBar")
self.navigationBar = self.FindWindowByName("NavigationBar")
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
logger = QAUITestAppLib.QALogger("PerfLargeDataScrollTable.log", "Scrolling a table")
logger = QAUITestAppLib.QALogger("PerfLargeDataScrollCalendar.log", "Scroll calendar one unit")
def processNextIdle(): wx.GetApp().Yield() ev = wx.IdleEvent() wx.GetApp().ProcessEvent(ev) wx.GetApp().Yield()
testdate = datetime(2005, 12, 14) App_ns.root.SelectedDateChanged(start=testdate)
def processNextIdle(): wx.GetApp().Yield() ev = wx.IdleEvent() wx.GetApp().ProcessEvent(ev) wx.GetApp().Yield()
tableWidget = App_ns.summary.widget
calendarWidget = App_ns.TimedEvents.widget (xStart, yStart) = calendarWidget.GetViewStart()
def processNextIdle(): wx.GetApp().Yield() ev = wx.IdleEvent() wx.GetApp().ProcessEvent(ev) wx.GetApp().Yield()
logger.Start("Scroll table 25 scroll units") tableWidget.Scroll(0, 25) tableWidget.Update()
logger.Start("Scroll calendar one unit") calendarWidget.Scroll(0, yStart + 1) calendarWidget.Update()
def processNextIdle(): wx.GetApp().Yield() ev = wx.IdleEvent() wx.GetApp().ProcessEvent(ev) wx.GetApp().Yield()