rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
date = self.lastModified
date = self.getAttributeValue('lastModified',default=None)
def getModifiedDateTuple(self): date = self.lastModified if (date): return date.localtime().tuple() else: return None
sys.path.append(os.path.join(self.testdir, 'testparcels'))
def testCopying(self):
dc.SetFont(self.eventFont) dc.DrawText(_(u"%(numberOfEvents)d more confirmed...") % {'numberOfEvents': (len(self.currentDaysItems) - i)}, self.hMargin, y + self.eventFontOffset) y += self.lineHeight break
numEventsLeft = (len(self.currentDaysItems) - i) if numEventsLeft > 1: dc.SetFont(self.eventFont) dc.DrawText(_(u"%(numberOfEvents)d more confirmed...") % {'numberOfEvents': numEventsLeft}, self.hMargin, y + self.eventFontOffset) y += self.lineHeight break
def Draw(self, dc): """ Draw all the items, based on what's in self.currentDaysItems @return the height of all the text drawn """ # Set up drawing & clipping dc.Clear() dc.SetBackground(wx.WHITE_BRUSH) dc.SetBrush(wx.WHITE_BRUSH) dc.SetPen(wx.WHITE_PEN) dc.DrawRectangle(*iter(self.GetRect())) dc.SetTextBackground( (25...
doUploadToStaging(releaseMode, workingDir, cvsVintage, log)
for releaseMode in releaseModes: doUploadToStaging(releaseMode, workingDir, cvsVintage, log)
def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log, skipTests=False, upload=False): global buildenv, changes try: buildenv = hardhatlib.defaults buildenv['root'] = workingDir buildenv['hardhatroot'] = whereAmI hardhatlib.init(buildenv) except hardhatlib.HardHatMissingCompilerError: print "Co...
fKeyScript.execute()
wx.CallAfter(fKeyScript.execute)
def startsWithScriptNumber(candidateString, numberedStringToMatch): # returns True if the candidate starts with the # numberedStringToMatch. Checks that the candidate # isn't really a larger number by checking for # following digits. if candidateString.startswith(numberedStringToMatch): # make sure it's not a longer n...
aScript.execute()
wx.CallAfter(aScript.execute)
def startsWithScriptNumber(candidateString, numberedStringToMatch): # returns True if the candidate starts with the # numberedStringToMatch. Checks that the candidate # isn't really a larger number by checking for # following digits. if candidateString.startswith(numberedStringToMatch): # make sure it's not a longer n...
'ItemCollection' : { 'kind' : '//parcels/osaf/contentmodel/ItemCollection', 'fingerprint' : (), },
def exportProcess(self, item, depth=0): # item is the whole collection pass
'share' : self.itsUUID,
'share' : self.share.itsUUID,
def _put(self, updateCallback=None): """ Transfer entire 'contents', transformed, to server. """
'share' : self.itsUUID,
'share' : self.share.itsUUID,
def _get(self, updateCallback=None):
height = dc.GetTextExtent('M')
_, height = dc.GetTextExtent('M')
def DrawWrappedText(dc, text, rect): """ Simple wordwrap - draws the text into the current DC returns the height of the text that was written """ result = [] #what's this supposed to do? is unused -brendano lines = text.splitlines() y = rect.y totalHeight = 0 for line in lines: x = rect.x wrap = 0 height = dc.GetTex...
event = self.CreateEmptyEvent(startTime=newTime, allDay=True, anyTime=False)
event = self.CreateEmptyEvent(startTime=newTime, allDay=True, anyTime=True)
def OnCreateItem(self, unscrolledPosition): view = self.blockItem.itsView newTime = self.getDateTimeFromPosition(unscrolledPosition) event = self.CreateEmptyEvent(startTime=newTime, allDay=True, anyTime=False)
self.allDayBlankArrowImage = app.GetImage("AllDayBlankArrow_whitebg.png")
def __init__(self, parent, id, tzCharacterStyle, *arguments, **keywords): super(wxCalendarControl, self).__init__(parent, id, *arguments, **keywords) app = wx.GetApp() self.allDayCloseArrowImage = app.GetImage("AllDayCloseArrow_whitebg.png") self.allDayOpenArrowImage = app.GetImage("AllDayOpenArrow_whitebg.png") self....
weekColumnHeader.SetBitmapRef(expandoColumn, self.allDayBlankArrowImage)
def __init__(self, parent, id, tzCharacterStyle, *arguments, **keywords): super(wxCalendarControl, self).__init__(parent, id, *arguments, **keywords) app = wx.GetApp() self.allDayCloseArrowImage = app.GetImage("AllDayCloseArrow_whitebg.png") self.allDayOpenArrowImage = app.GetImage("AllDayOpenArrow_whitebg.png") self....
def generateItemsInRange(date, nextDate):
def generateItemsInRange(self, date, nextDate):
def generateItemsInRange(date, nextDate):
generateUIDs.append(icalUID)
generatedUIDs.append(icalUID)
def generateItemsInRange(date, nextDate):
chooserBox = wx.BoxSizer(wx.HORIZONTAL) self.chooserLabel = wx.StaticText(self, -1, _(u"Import events into:")) chooserBox.Add(self.chooserLabel, 0, wx.ALL, 3)
def __init__(self, parent, dialogTitle, view):
chooserBox.Add(self.chooser, 0, wx.LEFT, 10) self.box.Insert(1, chooserBox, 0, wx.LEFT, 16)
gs.Add(self.chooser, 0, wx.ALIGN_LEFT, 0) self.tzchooserLabel = wx.StaticText(self, -1, _(u"Change timezones to:")) gs.Add(self.tzchooserLabel, 0, wx.ALL, 3) info = TimeZoneInfo.get(view) tzdisplayChoices, self.tzchoices = map(list, (zip(*info.iterTimeZones()))) self.tzchoices.insert(0, None) tzdisplayChoices.inse...
def __init__(self, parent, dialogTitle, view):
targetCollection = self.choices[self.chooser.GetSelection()]
tzinfo = self.tzchoices[self.tzchooser.GetSelection()] coll = targetCollection = self.choices[self.chooser.GetSelection()] if tzinfo is not None and targetCollection is not None: coll = None
def importFile(self): fullpath = self.filechooser.GetValue() if not os.path.isfile(fullpath): self.fail(_(u"File does not exist, import cancelled.")) return False (dir, filename) = os.path.split(fullpath) prefs = schema.ns("osaf.sharing", self.view).prefs prefs.import_dir = dir targetCollection = self.choices[self.ch...
contents = targetCollection
contents = coll
def importFile(self): fullpath = self.filechooser.GetValue() if not os.path.isfile(fullpath): self.fail(_(u"File does not exist, import cancelled.")) return False (dir, filename) = os.path.split(fullpath) prefs = schema.ns("osaf.sharing", self.view).prefs prefs.import_dir = dir targetCollection = self.choices[self.ch...
shortMessage = u"".join([line1, line2, u"\n"] + unicode(backtrace[-frames:], "UTF-8", "ignore"))
shortMessage = u"".join([line1, line2, u"\n"]) shortMessage += unicode("".join(backtrace[-frames:]), "UTF-8", "ignore")
def realMain(): Utility.initProfileDir(Globals.options)
if indexName is None: nextKey = self.nextKey(key) else: nextKey = self._indexes[indexName].getNextKey(key)
try: if indexName is None: nextKey = self.nextKey(key) else: nextKey = self._indexes[indexName].getNextKey(key) except KeyError: if key in self: raise else: raise ValueError, '%s not in collection %s' %(previous, self)
def next(self, previous, indexName=None): """ Get the next referenced item relative to previous.
if indexName is None: previousKey = self.previousKey(key) else: previousKey = self._indexes[indexName].getPreviousKey(key)
try: if indexName is None: previousKey = self.previousKey(key) else: previousKey = self._indexes[indexName].getPreviousKey(key) except KeyError: if key in self: raise else: raise ValueError, '%s not in collection %s' %(next, self)
def previous(self, next, indexName=None): """ Get the previous referenced item relative to next.
if parcel.displayName == 'Calendar':
if parcel.displayName == _('Calendar'):
def OnTest1 (self, event): for parcel in self.model.URLTree: """ Each parcel must have an attribute which is the displayName. """ assert (hasattr (parcel, 'displayName')) if parcel.displayName == 'Calendar': parcel.SynchronizeView () return
if parcel.displayName == 'Contacts':
if parcel.displayName == _('Contacts'):
def OnTest2 (self, event): for parcel in self.model.URLTree: """ Each parcel must have an attribute which is the displayName. """ assert (hasattr (parcel, 'displayName')) if parcel.displayName == 'Contacts': parcel.SynchronizeView () return
if parcel.displayName == 'Test':
if parcel.displayName == _('Test'):
def OnTest3 (self, event): for parcel in self.model.URLTree: """ Each parcel must have an attribute which is the displayName. """ assert (hasattr (parcel, 'displayName')) if parcel.displayName == 'Test': parcel.SynchronizeView () return
self.__CHANDLER_STARTED_UP = True
def _displayHook(obj): if obj is not None: print repr(obj)
self.addEventsToEventNameToItemUUID (subscribeAlwaysEnts)
self.addEventsToEventNameToItemUUID (subscribeAlwaysEvents)
def render (self): try: instantiateWidgetMethod = getattr (type (self), "instantiateWidget") except AttributeError: pass else: oldIgnoreSynchronizeWidget = Globals.wxApplication.ignoreSynchronizeWidget Globals.wxApplication.ignoreSynchronizeWidget = True try: widget = instantiateWidgetMethod (self) finally: Globals.wxA...
selectedOccurrences = schema.Many(schema.Item, defaultValue=[])
selectedOccurrences = schema.Many(schema.Item, defaultValue=set())
def demangledTupleGetter(self): return tuple([val.fget(self) for val in args])
self.selectedOccurrences = [item]
self.selectedOccurrences = set((item,))
def setSelectionToItem(self, item): if item.hasTrueAttributeValue('recurrenceID'): self.itsItem.clearSelection() self.selectedOccurrences = [item] else: self.selectedOccurrences = [] self.itsItem.setSelectionToItem(item)
self.selectedOccurrences = []
self.selectedOccurrences = set()
def setSelectionToItem(self, item): if item.hasTrueAttributeValue('recurrenceID'): self.itsItem.clearSelection() self.selectedOccurrences = [item] else: self.selectedOccurrences = [] self.itsItem.setSelectionToItem(item)
self.selectedOccurrences = []
self.selectedOccurrences = set()
def clearSelection(self): self.itsItem.clearSelection() self.selectedOccurrences = []
tupleList.append (filterKind)
tupleList.append (filterKind.itsUUID)
def _mapItemToCacheKeyItem(self, item): key = item if isinstance (item, ItemCollection.ItemCollection): sidebar = Block.Block.findBlockByName ("Sidebar") collectionList = [theItem for theItem in sidebar.checkedItems] if item not in collectionList: collectionList.insert (0, item) tupleList = [theItem.itsUUID for theItem...
cb3 = wx.CheckBox( self, -1, "Visible Selection", (self.colStartX, miscControlsY + 50), (200, 20), wx.NO_BORDER )
cb3 = wx.CheckBox( self, -1, "Visible Selection", (self.colStartX, miscControlsY + 50), (150, 20), wx.NO_BORDER )
def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log
unittest.main()
pass
def testLocal(self):
self.FinishDrag() self.StopDragTimer()
e = None try: self.FinishDrag() finally: self.StopDragTimer()
def OnEndDragItem(self): self.FinishDrag() self.StopDragTimer() self.RebuildCanvasItems() self.Refresh()
assert row < grid.GetElementCount() if (not grid.blockItem.columnReadOnly[column] and
if ((row < grid.GetElementCount()) and not grid.blockItem.columnReadOnly[column] and
def GetAttr (self, row, column, kind): attribute = self.base_GetAttr (row, column, kind) if attribute is None: type = self.GetTypeName (row, column) delegate = AttributeEditors.getSingleton (type) attribute = self.defaultROAttribute """ An apparent bug in table asks for an attribute even when there are no entries in th...
status = "Pass"
status = "PASSED"
def Report(self,description="Unknown"): ''' Report the current action states''' self.nbVerif = self.nbVerif + 1 self.Print("") self.Print("%s checking report : " %description) for failure in self.failureList: self.Print(" - Error : %s" % failure) for passed in self.passedList: self.Print(" - Ok : %s" % pa...
status = "Fail"
status = "FAILED"
def Report(self,description="Unknown"): ''' Report the current action states''' self.nbVerif = self.nbVerif + 1 self.Print("") self.Print("%s checking report : " %description) for failure in self.failureList: self.Print(" - Error : %s" % failure) for passed in self.passedList: self.Print(" - Ok : %s" % pa...
return cls.hueList[lastHueIndex]
return cls.hueList[cls.lastHueIndex]
def getNextHue(cls): """ returns the next hue following the one passed in For example, f.hue = nextHue(f.hue) """ cls.lastHueIndex += 1 cls.lastHueIndex %= len(cls.hueList) return cls.hueList[lastHueIndex]
link = PersistentRefs._removeRef_(self, other.itsUUID, link)
if link is not None: link = PersistentRefs._removeRef_(self, other.itsUUID, link)
def _removeRef_(self, other):
def doTests(testDir, workingDir, mode)
def doTests(testDir, workingDir, mode):
def doTests(testDir, workingDir, mode) os.chdir(testDir) if mode == "debug": dashT = '-dt' else: dashT = '-rt' try: # test print "Testing " + mode log.write("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n") log.write("Testing " + mode + " ...\n") outputList = hardhatutil.executeCommandReturnOutput( ...
[scriptName, scriptOption, nsisScriptPath, "chandler.nsi"],
[scriptName, scriptOption, nsisScriptPath, "chandler.nsi", buildenv['makensis']],
def makeInstaller(buildenv, directories, fileRoot, majorVersion='0', minorVersion='0', releaseVersion='1'): """ This assumes that directory is an immediate child of the current dir """ # TODO: OS X (dmg?) support if buildenv['os'] == 'win': if not buildenv['makensis']: raise hardhatutil.CommandNotFound, 'makensis' nsis...
self.assert_(len(itemChildren) == 1)
self.assert_(len(itemChildren) == 2)
def testAnonymousItem(self): """ Test to ensure an anonymous item (i.e. one without an itsName parameter specified in parcel.xml) can be set up correctly. """ item = self.manager.lookup("http://testparcels.org/anonymous", "itemWithSubItem") self.assert_(item) itemChildren = [child for child in item.iterChildren()] se...
kind = item._kind
kind = item.itsKind
def call(uuid, version, status, parentId, dirties): item = self.find(uuid) if item is not None: values = [] references = [] kind = item._kind if kind is not None: for name, attr, k in kind.iterAttributes(): if name in dirties: if kind.getOtherName(name, default=None) is not None: references.append(name) else: values.ap...
if kind.getOtherName(name, default=None) is not None:
if kind.getOtherName(name, item, None) is not None:
def call(uuid, version, status, parentId, dirties): item = self.find(uuid) if item is not None: values = [] references = [] kind = item._kind if kind is not None: for name, attr, k in kind.iterAttributes(): if name in dirties: if kind.getOtherName(name, default=None) is not None: references.append(name) else: values.ap...
if cellRect.InsideXY (x, y): if not hasattr (self, 'hoverImageRow') and not self.IsCellEditControlEnabled():
if (cellRect.InsideXY (x, y) and not hasattr (self, 'hoverImageRow') and not self.IsCellEditControlEnabled() and isinstance (item, ItemCollection.ItemCollection)):
def OnMouseEvents (self, event): """ This code is tricky, tread with care -- DJA """ event.Skip() #Let the grid also handle the event by default
panel = HTMLPanel(self, pageLocation, size=(700, -1))
defaultWindowWidth = 700 maxWindowHeight = 600 panel = HTMLPanel(self, pageLocation, size=(defaultWindowWidth, -1))
def __init__(self, parent, title="", pageLocation="", useTimer=true, timerLength=10000): """ Sets up the splash screen and starts its timer. """ wxDialog.__init__(self, parent, -1, title, style=wxFRAME_FLOAT_ON_PARENT|\ wxDEFAULT_FRAME_STYLE) panel = HTMLPanel(self, pageLocation, size=(700, -1)) internalRep = panel.Get...
panel.SetSize((internalRep.GetWidth(), internalRep.GetHeight()))
width = internalRep.GetWidth() height = internalRep.GetHeight() if height > maxWindowHeight: height = maxWindowHeight panel.SetSize((width, height))
def __init__(self, parent, title="", pageLocation="", useTimer=true, timerLength=10000): """ Sets up the splash screen and starts its timer. """ wxDialog.__init__(self, parent, -1, title, style=wxFRAME_FLOAT_ON_PARENT|\ wxDEFAULT_FRAME_STYLE) panel = HTMLPanel(self, pageLocation, size=(700, -1)) internalRep = panel.Get...
style=wxHW_SCROLLBAR_NEVER)
style=wxHW_SCROLLBAR_AUTO)
def __init__(self, parent, pageLocation, size): """ Sets up the wxHtmlWindow and loads the proper page to be displayed. """ wxHtmlWindow.__init__(self, parent, size=size, style=wxHW_SCROLLBAR_NEVER) self.parent = parent self.LoadPage(pageLocation)
text = self.share.format.exportProcess(item)
try: text = self.share.format.exportProcess(item) except Exception, e: raise TransformationFailed(message=str(e))
def _putItem(self, item): # must implement path = self._getItemPath(item) text = self.share.format.exportProcess(item) if text is None: return None out = file(path, 'w') out.write(text) out.close stat = os.stat(path) return stat.st_mtime
item = self.share.format.importProcess(text, extension=extension, item=into)
try: item = self.share.format.importProcess(text, extension=extension, item=into) except Exception, e: raise TransformationFailed(message=str(e))
def _getItem(self, itemPath, into=None): # must implement # logger.info("Getting item: %s" % itemPath) extension = os.path.splitext(itemPath)[1].strip(os.path.extsep) text = file(itemPath).read() item = self.share.format.importProcess(text, extension=extension, item=into) stat = os.stat(itemPath) return (item, stat.st_...
text = self.share.format.exportProcess(item)
try: text = self.share.format.exportProcess(item) except Exception, e: raise TransformationFailed(message=str(e))
def _putItem(self, item): # must implement """ putItem should publish an item and return etag/date, etc. """ url = self.__getItemURL(item) text = self.share.format.exportProcess(item) if text is None: return None
item = self.share.format.importProcess(text, item=into)
try: item = self.share.format.importProcess(text, item=into) except Exception, e: raise TransformationFailed(message=str(e))
def _getItem(self, itemPath, into=None): itemURL = self.__URLFromPath(itemPath)
self.share.format.importProcess(text, item=self.share)
try: self.share.format.importProcess(text, item=self.share) except Exception, e: raise TransformationFailed(message=str(e))
def get(self): self.connect()
Main application termination. """ if __debug__: wx.GetApp().UIRepositoryView.check() Globals.mailService.shutdown() Utility.stopWakeup() Utility.stopTwisted() Utility.stopRepository(wx.GetApp().UIRepositoryView) Utility.stopCrypto(Globals.options.profileDir)
Main application termination. Called after the window is torn down. """ self.UIRepositoryView.repository.close()
def OnExit(self): """ Main application termination. """ if __debug__: wx.GetApp().UIRepositoryView.check()
"Item is stale"
__doc__ = "Item is stale"
def str(self, arg): if isitem(arg): return arg._repr_() else: return str(arg)
"Item %s has changed, cannot be unloaded"
__doc__ = "Item %s has changed, cannot be unloaded"
def __str__(self): return self.getItem()._repr_()
'%s not a child of %s'
__doc__ = '%s not a child of %s'
def __str__(self): return self.getItem().itsPath
"%s already has a child named '%s'"
__doc__ = "%s already has a child named '%s'"
def __str__(self): return self.__doc__ %(self.args[1].itsPath, self.getItem().itsPath)
'repository root %s may not be anonymous'
__doc__ = 'repository root %s may not be anonymous'
def __str__(self): return self.__doc__ %(self.getItem().itsPath, self.args[1])
"Value %s is already owned by item %s on attribute '%s'"
__doc__ = "Value %s is already owned by item %s on attribute '%s'"
def __str__(self): return self.__doc__ %(self.getItem()._repr_())
'Item %s has children, delete must be recursive'
__doc__ = 'Item %s has children, delete must be recursive'
def __str__(self): return self.__doc__ %(self.args[2], self.getItem()._repr_(), self.args[1])
"Item %s: no item %s in collection on attribute '%s'"
__doc__ = "Item %s: no item %s in collection on attribute '%s'"
def __str__(self): return self.__doc__ %(self.getItem()._repr_())
"Kind %s has no definition for attribute '%s'"
__doc__ = "Kind %s has no definition for attribute '%s'"
def __str__(self): return self.__doc__ %(self.getItem().itsPath, self.str(self.args[2]), self.getAttribute())
"Indirect values on item %s, attribute '%s' via '%s' are not supported"
__doc__ = "Indirect values on item %s, attribute '%s' via '%s' are not supported"
def __str__(self): return self.__doc__ %(self.getItem().itsPath, self.args[1])
"%s (Kind: %s) has no value for '%s'"
__doc__ = "%s (Kind: %s) has no value for '%s'"
def __str__(self): return self.__doc__ %(self.getItem().itsPath, self.args[1], self.args[2])
"%s (Kind: %s) has no local value for '%s'"
__doc__ = "%s (Kind: %s) has no local value for '%s'"
def __str__(self): return self.__doc__ %(self.getItem().itsPath, self.getItem()._kind, self.getAttribute())
'Item %s: value for %s is read-only'
__doc__ = 'Item %s: value for %s is read-only'
def __str__(self): return self.__doc__ %(self.getItem().itsPath, self.getItem()._kind, self.getAttribute())
"Item is kindless"
__doc__ = "Item is kindless"
def __str__(self): return self.__doc__ %(self.getItem().itsPath, self.args[1])
"Item %s (kind: %s), attribute '%s' is not %s"
__doc__ = "Item %s (kind: %s), attribute '%s' is not %s"
def __str__(self): return self.getItem()._repr_()
"Item %s, attribute '%s': ref is: %s, but should be: %s"
__doc__ = "Item %s, attribute '%s': ref is: %s, but should be: %s"
def __str__(self): return self.__doc__ %(self.args[1], self.getItem().itsPath, self.getItem()._kind, self.args[2])
"Item %s, attribute '%s': referred item %s not found"
__doc__ = "Item %s, attribute '%s': referred item %s not found"
def __str__(self): return self.__doc__ %(self.getItem().itsPath, self.args[1], self.str(self.args[2]), self.str(self.args[3]))
"Error establishing bidirectional ref, item views don't match: %s is in %s but %s is in %s"
__doc__ = "Error establishing bidirectional ref, item views don't match: %s is in %s but %s is in %s"
def __str__(self): return self.__doc__ %(self.getItem().itsPath, self.args[1], self.str(self.args[2]))
"Item %s: no index named '%s' on attribute '%s'"
__doc__ = "Item %s: no index named '%s' on attribute '%s'"
def getIndexName(self): return self.args[2]
"Item %s: an index named '%s' already exists on attribute '%s'"
__doc__ = "Item %s: an index named '%s' already exists on attribute '%s'"
def __str__(self): return self.__doc__ %(self.getItem().itsPath, self.getIndexName(), self.getCollection())
ap.TypeValue("email", "demo1@osaofundation.org")
ap.TypeValue("email", "demo1@osafoundation.org")
def startTest(self): # action -- Setup mail accounts #execfile(os.path.join(functional_dir,"TestCreateAccounts.py")) ## Create Accounts for Mail ap = QAUITestAppLib.UITestAccounts(self.logger) # action self.logger.startAction("Setup email account") ap.Open() # first, open the accounts dialog window ap.CreateAccount...
def Draw(self, dc, boundingRect, styles, selected):
def Draw(self, dc, boundingRect, styles, brushOffset, selected):
def Draw(self, dc, boundingRect, styles, selected): item = self._item
brush = styles.brushes.GetGradientBrush(itemRect.x, itemRect.width,
brush = styles.brushes.GetGradientBrush(itemRect.x + brushOffset, itemRect.width,
def Draw(self, dc, boundingRect, styles, selected): item = self._item
def Draw(self, dc, styles, selected):
def Draw(self, dc, styles, brushOffset, selected):
def Draw(self, dc, styles, selected): item = self._item itemRect = self._bounds eventColors = styles.blockItem.getEventColors(item) if selected: brush = styles.brushes.GetGradientBrush(itemRect.x, itemRect.width, eventColors.selectedGradientLeft, eventColors.selectedGradientRight) pen = wx.Pen(eventColors.selectedOutl...
brush = styles.brushes.GetGradientBrush(itemRect.x, itemRect.width,
brush = styles.brushes.GetGradientBrush(itemRect.x + brushOffset, itemRect.width,
def Draw(self, dc, styles, selected): item = self._item itemRect = self._bounds eventColors = styles.blockItem.getEventColors(item) if selected: brush = styles.brushes.GetGradientBrush(itemRect.x, itemRect.width, eventColors.selectedGradientLeft, eventColors.selectedGradientRight) pen = wx.Pen(eventColors.selectedOutl...
canvasItem.Draw(dc, styles, False)
canvasItem.Draw(dc, styles, brushOffset, False)
def DrawCells(self, dc): styles = self.parent
selectedBox.Draw(dc, styles, True)
selectedBox.Draw(dc, styles, brushOffset, True)
def DrawCells(self, dc): styles = self.parent
canvasItem.Draw(dc, boundingRect, styles, False)
canvasItem.Draw(dc, boundingRect, styles, brushOffset, False)
def DrawCells(self, dc): styles = self.parent # Set up fonts and brushes for drawing the events dc.SetTextForeground(wx.BLACK) dc.SetBrush(wx.WHITE_BRUSH)
selectedBox.Draw(dc, boundingRect, styles, True)
selectedBox.Draw(dc, boundingRect, styles, brushOffset, True)
def DrawCells(self, dc): styles = self.parent # Set up fonts and brushes for drawing the events dc.SetTextForeground(wx.BLACK) dc.SetBrush(wx.WHITE_BRUSH)
allDay = item.allDay if item.anyTime:
if item.allDay: dtstartLine.value = dateForVObject(item.startTime, True) elif item.anyTime:
def populate(comp, item): """Populate the given vobject vevent with data from item.""" if item.getAttributeValue('icalUID', default=None) is None: item.icalUID = unicode(item.itsUUID) comp.add('uid').value = item.icalUID
allDay = True dtstartLine.value = dateForVObject(item.startTime, allDay)
dtstartLine.value = dateForVObject(item.startTime, True) else: dtstartLine.value = dateForVObject(item.startTime, False)
def populate(comp, item): """Populate the given vobject vevent with data from item.""" if item.getAttributeValue('icalUID', default=None) is None: item.icalUID = unicode(item.itsUUID) comp.add('uid').value = item.icalUID
allDay = item.allDay if item.anyTime:
if item.allDay: dtendLine.value = dateForVObject(item.endTime, True) + \ datetime.timedelta(days=1) elif item.anyTime:
def populate(comp, item): """Populate the given vobject vevent with data from item.""" if item.getAttributeValue('icalUID', default=None) is None: item.icalUID = unicode(item.itsUUID) comp.add('uid').value = item.icalUID
allDay = True if allDay: dtendLine.value = dateForVObject(item.endTime, allDay) + \ datetime.timedelta(days=1)
dtendLine.value = dateForVObject(item.endTime, True)
def populate(comp, item): """Populate the given vobject vevent with data from item.""" if item.getAttributeValue('icalUID', default=None) is None: item.icalUID = unicode(item.itsUUID) comp.add('uid').value = item.icalUID
dtendLine.value = dateForVObject(item.endTime, allDay)
dtendLine.value = dateForVObject(item.endTime, False)
def populate(comp, item): """Populate the given vobject vevent with data from item.""" if item.getAttributeValue('icalUID', default=None) is None: item.icalUID = unicode(item.itsUUID) comp.add('uid').value = item.icalUID
change('anyTime', False)
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.
if isDate: change('allDay', True) else: change('allDay', False)
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.
method(*args, **kwds)
result = method(*args, **kwds)
def profile_me(*args, **kwds): if self.profiler_active: method(*args, **kwds) else: self.profiler_active = True self.profiler.runcall(method, *args, **kwds) self.profiler_active = False
self.profiler.runcall(method, *args, **kwds)
result = self.profiler.runcall(method, *args, **kwds)
def profile_me(*args, **kwds): if self.profiler_active: method(*args, **kwds) else: self.profiler_active = True self.profiler.runcall(method, *args, **kwds) self.profiler_active = False
reminderTime = string.split(args[7],'/') event.reminderTime = datetime(month=string.atoi(reminderTime[0]),day=string.atoi(reminderTime[1]),year=string.atoi(reminderTime[2]))
reminderInterval = string.atoi(args[7]) event.reminderTime = event.startTime - timedelta(minutes=reminderInterval)
def GenerateCalendarEvent(view, mainView, args): """ Generate one calendarEvent item """ event = Calendar.CalendarEvent(view=view) # displayName if args[0]=='*': # semi-random data event.displayName = random.choice(HEADLINES) elif not args[0]=='': event.displayName = args[0] else: event.displayName = 'untitled' #star...
class LinkDetail(Detail.StaticRedirectAttribute): def staticTextLabelValue(self, item): theLabel = unicode(item.getAttributeValue(Detail.GetRedirectAttribute(item, self.whichAttribute()))) return theLabel class DateDetail(Detail.StaticRedirectAttribute): def staticTextLabelValue(self, item): try: value = item.getAttr...
def getHTMLText(self, item): if item == item.itsView: return if item is not None: displayName = item.getAttributeValue('displayName', default=u'<' + messages.UNTITLED + u'>')
def field(name, title, stretchFactor=0.0): return detail.StaticRedirectAttribute.update( parcel, name, title=title, characterStyle=blocks.LabelStyle, stretchFactor=stretchFactor, textAlignmentEnum = "Left", )
detail.makeArea(parcel, "CategoryArea", position=0.2, childrenBlocks = [ detail.makeLabel(parcel, _(u"category"), borderTop=2), detail.makeSpacer(parcel, width=8), detail.makeEditor(parcel, 'category', viewAttribute=u'category', border=RectType(0,2,2,2), readOnly=True), ] ).install(parcel),
def label(name, title): return detail.StaticRedirectAttributeLabel.update( parcel, name, title=title, characterStyle = blocks.LabelStyle, stretchFactor = 0.0, textAlignmentEnum = "Right", minimumSize = SizeType(60, 24), border = RectType(0, 0, 0, 5), )
def pair(name, **kw): return detail.DetailSynchronizedLabeledTextAttributeBlock.update( parcel, name, stretchFactor = 0.0, border = RectType(5, 0, 0, 5), **kw )
detail.makeArea(parcel, "LinkArea", position=0.3, childrenBlocks = [ detail.makeLabel(parcel, _(u'link'), borderTop=2), detail.makeSpacer(parcel, width=8), detail.makeEditor(parcel, 'link', viewAttribute=u'link', border=RectType(0,2,2,2), readOnly=True), ], ).install(parcel),
def field(name, title, stretchFactor=0.0): return detail.StaticRedirectAttribute.update( parcel, name, title=title, characterStyle=blocks.LabelStyle, stretchFactor=stretchFactor, textAlignmentEnum = "Left", )
rootBlocks = [ detail.MarkupBar, FeedItemDetail.update(parcel, "ItemBodyArea", blockName = "articletext", size = SizeType(100,50), minimumSize = SizeType(100,50), ), pair("LinkArea", viewAttribute=u"link", position=0.3, childrenBlocks = [ label("LinkLabel", title=u"link"), LinkDetail.update(parcel, "LinkAttribute", ...
rootBlocks = feedItemRootBlocks,
def pair(name, **kw): return detail.DetailSynchronizedLabeledTextAttributeBlock.update( parcel, name, stretchFactor = 0.0, border = RectType(5, 0, 0, 5), **kw )
def repositoryCallback(uuid, notification, reason, **kwds):
def repositoryCallback(changes, notification, **kwds):
def repositoryCallback(uuid, notification, reason, **kwds): if notification == 'History': eventPath = '//parcels/osaf/framework/item_' + reason else: return event = Globals.repository.findPath(eventPath) from osaf.framework.notifications.Notification import Notification note = Notification(event) note.threadid = id(t...
eventPath = '//parcels/osaf/framework/item_' + reason
eventPath = '//parcels/osaf/framework/commit_history'
def repositoryCallback(uuid, notification, reason, **kwds): if notification == 'History': eventPath = '//parcels/osaf/framework/item_' + reason else: return event = Globals.repository.findPath(eventPath) from osaf.framework.notifications.Notification import Notification note = Notification(event) note.threadid = id(t...