rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
rect = ColumnarCanvasItem.MakeRectForRange(calendarCanvas, boundsStartTime, boundsEndTime) rect.x += indent rect.width -= width | def GenerateBoundsRects(calendarCanvas, startTime, endTime, indent=0, width=0): """ Generate a bounds rectangle for each day period. For example, an event that goes from noon monday to noon wednesday would have three bounds rectangles: one from noon monday to midnight one for all day tuesday one from midnight wednesday... | |
newTime = self.getDateTimeFromPosition(unscrolledPosition) | def OnCreateItem(self, unscrolledPosition): view = self.parent.blockItem.itsView newTime = self.getDateTimeFromPosition(unscrolledPosition) event = Calendar.CalendarEvent(view=view) event.InitOutgoingAttributes() event.ChangeStart(DateTime.DateTime(newTime.year, newTime.month, newTime.day, event.startTime.hour, event.s... | |
if (self._bgSelectionStartTime and self._bgSelectionEndTime and self._bgSelectionStartTime >= startDay and self._bgSelectionEndTime <= endDay): | if (self._bgSelectionStartTime and self._bgSelectionEndTime): | def DrawBackground(self, dc): self._doDrawingCalculations() |
self._bgSelectionStartTime = self.getDateTimeFromPosition(unscrolledPosition) self._bgSelectionDragEnd = True self._bgSelectionEndTime = self._bgSelectionStartTime + \ DateTime.RelativeDateTime(minutes=30) | selectedTime = self.getDateTimeFromPosition(unscrolledPosition) if (not self._bgSelectionStartTime or selectedTime < self._bgSelectionStartTime or selectedTime > self._bgSelectionEndTime): self._bgSelectionStartTime = self.getDateTimeFromPosition(unscrolledPosition) self._bgSelectionDragEnd = True self._bgSelectionE... | def OnSelectNone(self, unscrolledPosition): self._bgSelectionStartTime = self.getDateTimeFromPosition(unscrolledPosition) self._bgSelectionDragEnd = True self._bgSelectionEndTime = self._bgSelectionStartTime + \ DateTime.RelativeDateTime(minutes=30) # set focus on the calendar so that we can receive key events # (as o... |
newTime = self.getDateTimeFromPosition(unscrolledPosition) | if (self._bgSelectionStartTime): newTime = self._bgSelectionStartTime duration = self._bgSelectionEndTime - self._bgSelectionStartTime else: newTime = self.getDateTimeFromPosition(unscrolledPosition) duration = None | def OnCreateItem(self, unscrolledPosition): # @@@ this code might want to live somewhere else, refactored view = self.parent.blockItem.itsView event = Calendar.CalendarEvent(view=view) newTime = self.getDateTimeFromPosition(unscrolledPosition) event.InitOutgoingAttributes() event.ChangeStart(newTime) |
os.chdir(buildenv['root']) compFile2 = hardhatlib.compressDirectory(buildenv, ["debug"], "Chandler_osx_dev_debug_" + buildVersionShort) | 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... | |
os.chdir(buildenv['root']) compFile2 = hardhatlib.compressDirectory(buildenv, ["debug"], "Chandler_linux_dev_debug_" + buildVersionShort) os.chdir(buildenv['root']) | 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... | |
os.chdir(buildenv['root']) compFile2 = hardhatlib.compressDirectory(buildenv, ["debug"], "Chandler_win_dev_debug_" + buildVersionShort) | 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... | |
os.chdir(buildenv['root']) compFile2 = hardhatlib.compressDirectory(buildenv, ["release"], "Chandler_linux_dev_release_" + buildVersionShort) os.chdir(buildenv['root']) | 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... | |
os.chdir(buildenv['root']) compFile2 = hardhatlib.compressDirectory(buildenv, ["release"], "Chandler_osx_dev_release_" + buildVersionShort) | 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... | |
os.chdir(buildenv['root']) compFile2 = hardhatlib.compressDirectory(buildenv, ["release"], "Chandler_win_dev_release_" + buildVersionShort) | 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... | |
sharingView = view workingShares = shares | if merging: syncVersion = marker.getVersion() sharingView = None for existingView in view.repository.views: if existingView.name == 'Sharing': sharingView = existingView if sharingView is None: sharingView = view.repository.createView("Sharing", syncVersion) else: sharingView.itsVersion = syncVersion workingShares =... | def sync(collectionOrShares, modeOverride=None, updateCallback=None, merging=USE_MERGING): if isinstance(collectionOrShares, list): # a list of Shares shares = collectionOrShares view = shares[0].itsView marker = shares[0].conduit.marker elif isinstance(collectionOrShares, Share): # just one Share shares = [collectio... |
view.commit() | if merging: sharingView.commit() view.refresh() else: view.commit() | def sync(collectionOrShares, modeOverride=None, updateCallback=None, merging=USE_MERGING): if isinstance(collectionOrShares, list): # a list of Shares shares = collectionOrShares view = shares[0].itsView marker = shares[0].conduit.marker elif isinstance(collectionOrShares, Share): # just one Share shares = [collectio... |
source.Refresh() | source.RefreshCanvasItems(resort=False) | def OnEnter(self, x, y, dragResult): source = self.GetDraggedFromWidget() if source not in (self, None): # On Linux, OnLeave doesn't reliably happen before OnEnter source.OnLeave() |
twistedLogFile = os.path.join(options.profileDir, 'twisted.log') | twistedLogDir = options.profileDir | def initLogging(options): global logger if logger is None: # Make PROFILEDIR available within the logging config file logging.PROFILEDIR = options.profileDir logConfFile = options.logging if os.path.isfile(logConfFile): # Replacing the standard fileConfig with our own, below # logging.config.fileConfig(options.loggin... |
twistedLogFile = os.path.join(chandlerLogDir, 'twisted.log') | twistedLogDir = chandlerLogDir | def initLogging(options): global logger if logger is None: # Make PROFILEDIR available within the logging config file logging.PROFILEDIR = options.profileDir logConfFile = options.logging if os.path.isfile(logConfFile): # Replacing the standard fileConfig with our own, below # logging.config.fileConfig(options.loggin... |
twisted.python.log.startLogging(file(twistedLogFile, 'a+'), 0) logger.info("Twisted logging output to %s" % twistedLogFile) | import twisted.python.logfile twistedlog = twisted.python.logfile.LogFile("twisted.log", twistedLogDir) twisted.python.log.startLogging(twistedlog, 0) logger.info("Twisted logging output to %s folder" % twistedLogDir) | def initLogging(options): global logger if logger is None: # Make PROFILEDIR available within the logging config file logging.PROFILEDIR = options.profileDir logConfFile = options.logging if os.path.isfile(logConfFile): # Replacing the standard fileConfig with our own, below # logging.config.fileConfig(options.loggin... |
"TestImportOverwrite.py", | def run_tests(tests): for filename in tests: try: execfile(os.path.join(functional_dir, filename)) except: import traceback print "%s failed due to exception" % fileName type, value, stack = sys.exc_info() traceback.print_exception(type, value, stack, None, sys.stderr) | |
self.SetPage(self.getNewItemsHTML()) | pageHTML = self.getNewItemsHTML() pageHTML = pageHTML.encode('latin_1','ignore') self.SetPage(pageHTML) | def SetData(self, data): """Set the RSSChannel that this content view should represent""" self.data = data self.SetPage(self.getNewItemsHTML()) |
def GetStatusPen(self, color): | def DrawStatusBar(self, dc, color, (x,y1,y2)): | def GetStatusPen(self, color): # probably should use styles to determine a good pen color item = self.item |
if (item.transparency == "confirmed"): pen = wx.Pen(color, 4) elif (item.transparency == "fyi"): pen = wx.Pen(color, 1) | if item.transparency in ("fyi", "confirmed"): pen = wx.Pen(color, 5) | def GetStatusPen(self, color): # probably should use styles to determine a good pen color item = self.item |
return pen | pen.SetCap(wx.CAP_BUTT) dc.SetPen(pen) dc.DrawLine(x, y1, x, y2) if item.transparency == "fyi": pen = wx.Pen(wx.WHITE, 2) pen.SetCap(wx.CAP_BUTT) dc.SetPen(pen) dc.DrawLine(x+1, y1, x+1, y2) | def GetStatusPen(self, color): # probably should use styles to determine a good pen color item = self.item |
if not hasLeftRounded: pen = self.GetStatusPen(outlineColor) pen.SetCap(wx.CAP_BUTT) dc.SetPen(pen) dc.DrawLine(itemRect.x+1, itemRect.y, itemRect.x+1, itemRect.y + itemRect.height) | if not hasLeftRounded: self.DrawStatusBar(dc, outlineColor, (itemRect.x+1, itemRect.y+1, itemRect.y-1 + itemRect.height)) | def Draw(self, dc, styles, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self.item # recurring items, when deleted or stamped non-Calendar, are sometimes # passed to Draw before wxSynchronize is called, ignore those items CalendarEventKind = Calendar.CalendarEventMixin.getKind(item.itsV... |
if peerCert.get_ext('subjectAltName').get_value() != 'DNS:' + self.host: raise WrongHost, 'subjectAltName does not match host' | subjectAltName = peerCert.get_ext('subjectAltName').get_value() if not self._match(self.host, subjectAltName, True): raise WrongHost, 'subjectAltName does not match host. Expected "DNS:%s", got "%s".' %(self.host, subjectAltName) | def __call__(self, peerCert, host=None): if peerCert is None: raise NoCertificate, 'peer did not return certificate' |
if peerCert.get_subject().CN != self.host: raise WrongHost, 'peer certificate commonName does not match host' | commonName = peerCert.get_subject().CN if not self._match(self.host, commonName): raise WrongHost, 'peer certificate commonName does not match host. Expected "%s", got "%s".' %(self.host, commonName) | def __call__(self, peerCert, host=None): if peerCert is None: raise NoCertificate, 'peer did not return certificate' |
if item.ItemWhoFromString() == u'': item.whoFrom = item.getCurrentMeEmailAddress() | if item.fromAddress == u'': item.fromAddress = item.getCurrentMeEmailAddress() | def onSendShareItemEvent(self, event): """ Send or share the selected items """ selectedItems = self.__getSelectedItems() if len(selectedItems) == 0: return |
value = DateTimeAttributeEditor.weekdays[wkDay] | value = unicode(DateTimeAttributeEditor.weekdays[wkDay]) | def GetAttributeValue(self, item, attributeName): itemDateTime = getattr (item, attributeName, None) # getattr will work with properties if itemDateTime is None: return u'' # [grant] This means we always display datetimes in the # user's default timezone in the summary table. if itemDateTime.tzinfo is not None: itemDa... |
for e,v in es.items(): | for k,v in es.items(): | def _checkManagerAndEmployeesDict(self, m, es): """Make sure a list of employees has the same manager""" for e,v in es.items(): self.assertEquals(v.manager, m) self.assert_(m.hasValue('employees', v)) |
emps[e] = employeeKind.newItem(e, self.rep) | emp = employeeKind.newItem(e, self.rep) emps[str(emp.getUUID())] = emp | def testPersistingPythonDict(self): """Test making a regular Python dict persistent""" kind = self.rep.find('//Schema/Core/Kind') itemKind = self.rep.find('//Schema/Core/Item') attrKind = itemKind.getAttribute('kind').kind |
emps[e] = self.rep.find('//%s' % e) | emp = self.rep.find('//%s' % e) emps[str(emp.getUUID())] = emp | def testPersistingPythonDict(self): """Test making a regular Python dict persistent""" kind = self.rep.find('//Schema/Core/Kind') itemKind = self.rep.find('//Schema/Core/Item') attrKind = itemKind.getAttribute('kind').kind |
menuTitle = _(u'Keep "%(collection)s" out of %(kidashboardnd)s') % arguments | menuTitle = _(u'Keep "%(collection)s" out of %(dashboard)s') % arguments | def onToggleMineEventUpdateUI(self, event): selectedItem = second = None iterator = self.contents.iterSelection() try: selectedItem = iterator.next() second = iterator.next() except StopIteration: pass if selectedItem is None or second is not None: event.arguments['Enable'] = False else: collectionName = selectedItem.... |
if prefs.background_syncing: event.arguments['Text'] = _(u'Disable background syncing') else: event.arguments['Text'] = _(u'Enable background syncing') | try: enabled = prefs.background_syncing except AttributeError: logger.exception('*********** Bug 5544\nprefs=%s\nprefs.itsView=%s', prefs, prefs.itsView) else: if enabled: event.arguments['Text'] = _(u'Disable background syncing') else: event.arguments['Text'] = _(u'Enable background syncing') | def onActivateBackgroundSyncingEventUpdateUI (self, event): prefs = schema.ns('osaf.sharing', self.itsView).prefs if prefs.background_syncing: event.arguments['Text'] = _(u'Disable background syncing') else: event.arguments['Text'] = _(u'Enable background syncing') |
ret = doTests(hardhatScript, chanDir, workingDir, releaseMode, log) | ret = Do(hardhatScript, releaseMode, workingDir, outputDir, cvsVintage, buildVersion, log) | def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log): global buildenv try: buildenv = hardhatlib.defaults buildenv['root'] = workingDir buildenv['hardhatroot'] = whereAmI hardhatlib.init(buildenv) except hardhatlib.HardHatMissingCompilerError: print "Could not locate compiler. Exiting." sys.... |
global buildscriptFile | global buildscriptFile, fromAddr, mailtoAddr, alertAddr, adminAddr, defaultDomain | def main(): global buildscriptFile 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 script reports\n" " [default] " + mailtoAddr + defaultDomain) parser.add_option("-p"... |
default="chandler", help="Name of script to use (without .py extension)\n" "[default] chandler") | default="newchandler", help="Name of script to use (without .py extension)\n" "[default] newchandler") | def main(): global buildscriptFile 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 script reports\n" " [default] " + mailtoAddr + defaultDomain) parser.add_option("-p"... |
dayName = currentDate.Format('%a ') + str(currentDate.day) | if currentDate == today: dayName = "Today" else: dayName = currentDate.Format('%a ') + str(currentDate.day) | def wxSynchronizeWidget(self): |
else: item = wx.GetApp().UIRepositoryView.findUUID (theUUID) | item = wx.GetApp().UIRepositoryView.findUUID(theUUID) try: return self.annotationClass(item) except (TypeError, AttributeError): | def unwrap (self): """ Unwrap the original object, using the UUID if the original was an Item. """ try: theUUID = self.itemUUID except AttributeError: return self.nonItem else: item = wx.GetApp().UIRepositoryView.findUUID (theUUID) return item |
try: | self.NotifyBlockToSaveValue() self._swapControls(self.staticControl) event.Skip() def OnEditKeyUp(self, event): if event.m_keyCode == wx.WXK_RETURN: self.NotifyBlockToSaveValue() self.Navigate() event.Skip() def NotifyBlockToSaveValue(self): """ Tell the block associated with us to save our value now. I wish there we... | def OnEditLoseFocus(self, event): # when we lose focus, check if we have a block and tell it # to save the value. try: saveMethod = self.blockItem.saveValue except AttributeError: pass else: saveMethod() self._swapControls(self.staticControl) event.Skip() |
self._swapControls(self.staticControl) event.Skip() | def OnEditLoseFocus(self, event): # when we lose focus, check if we have a block and tell it # to save the value. try: saveMethod = self.blockItem.saveValue except AttributeError: pass else: saveMethod() self._swapControls(self.staticControl) event.Skip() | |
version = versionSeq.last_value | version = self.getVersion() | def getVersionInfo(self, uuid, txn=None, open=False): |
return self._versionSeq.last_value | store = self.store if store._ramdb: return self._versionSeq.last_value txnStatus = 0 try: txnStatus = store.startTransaction(None, True) return self._versionSeq.get(store.txn) - 1 finally: store.abortTransaction(None, txnStatus) | def getVersion(self): |
SendMail(fromAddr, options.toAddr, startTime, buildName, "building", | SendMail(fromAddr, mailtoAddr, startTime, buildName, "building", | 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... |
SendMail(fromAddr, options.alertAddr, startTime, buildName, "The build failed", | SendMail(fromAddr, alertAddr, startTime, buildName, "The build failed", treeName, logContents) SendMail(fromAddr, mailtoAddr, startTime, buildName, "The build failed", | 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... |
SendMail(fromAddr, options.alertAddr, startTime, buildName, "Unit tests failed", | SendMail(fromAddr, alertAddr, startTime, buildName, "Unit tests failed", treeName, logContents) SendMail(fromAddr, mailtoAddr, startTime, buildName, "Unit tests failed", | 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... |
self.dayButtons[day].SetLabel(dayName) | if (('__WXMAC__' in wx.PlatformInfo) or ('__WXGTK__' in wx.PlatformInfo)): if (self.parent.blockItem.dayMode and (selectedDate == currentDate)): self.dayButtons[day].SetLabel(dayName, font=self.bigBoldFont, fgcolor=wx.BLUE) else: self.dayButtons[day].SetLabel(dayName, font=self.bigFont, fgcolor=self.bigFontColor) else:... | def wxSynchronizeWidget(self): |
dc.SetPen(wx.Pen(wx.BLUE)) | dc.SetPen(wx.Pen(wx.Color(153,204,255))) dc.SetBrush(wx.Brush(wx.Color(153,204,255))) | def DrawBackground(self, dc): self._doDrawingCalculations() |
if Globals.options.create: | if Globals.options.create and hasattr(dialog, 'create'): | def run(cls, exception=None): dialog = StartupOptionsDialog(exception) |
repoDir = locateRepositoryDirectory(Globals.options.profileDir) repoExists = os.path.exists(repoDir) | def __init__(self, exception=None): # Instead of calling wx.Dialog.__init__ we precreate the dialog # so we can set an extra style that must be set before # creation, and then we create the GUI dialog using the Create # method. pre = wx.PreDialog() style = wx.CAPTION pre.Create(None, -1, _(u"Startup Options for Chandle... | |
self.refreshui = wx.RadioButton(self, -1, _(u"Reset the user interface, but save my data and preferences")) sizer.Add(self.refreshui, flag=wx.ALL, border=5) self.refreshui.Bind(wx.EVT_LEFT_DCLICK, self.onButton) | if repoExists: self.refreshui = wx.RadioButton(self, -1, _(u"Do internal clean-up, but save my data and preferences")) sizer.Add(self.refreshui, flag=wx.ALL, border=5) self.refreshui.Bind(wx.EVT_LEFT_DCLICK, self.onButton) | def __init__(self, exception=None): # Instead of calling wx.Dialog.__init__ we precreate the dialog # so we can set an extra style that must be set before # creation, and then we create the GUI dialog using the Create # method. pre = wx.PreDialog() style = wx.CAPTION pre.Create(None, -1, _(u"Startup Options for Chandle... |
self.create = wx.RadioButton(self, -1, _(u"Discard all my data and start from scratch")) sizer.Add(self.create, flag=wx.ALL, border=5) self.create.Bind(wx.EVT_LEFT_DCLICK, self.onButton) | self.undocheck = wx.RadioButton(self, -1, _(u"Discard recent changes until data integrity tests pass")) sizer.Add(self.undocheck, flag=wx.ALL, border=5) self.undocheck.Bind(wx.EVT_LEFT_DCLICK, self.onButton) self.create = wx.RadioButton(self, -1, _(u"Discard all my data and start from scratch")) sizer.Add(self.create,... | def __init__(self, exception=None): # Instead of calling wx.Dialog.__init__ we precreate the dialog # so we can set an extra style that must be set before # creation, and then we create the GUI dialog using the Create # method. pre = wx.PreDialog() style = wx.CAPTION pre.Create(None, -1, _(u"Startup Options for Chandle... |
repoDir = locateRepositoryDirectory(Globals.options.profileDir) repoExists = os.path.exists(repoDir) if repoExists: sizer.AddSpacer((0,5)) if repoExists: self.snapshot = wx.RadioButton(self, -1, _(u"Make a snapshot of all data for submitting with a bug report, then exit")) sizer.Add(self.snapshot, flag=wx.ALL, border=5... | sizer.AddSpacer((0,8)) self.snapshot = wx.RadioButton(self, -1, _(u"Make a snapshot of all data for submitting with a bug report, then exit")) sizer.Add(self.snapshot, flag=wx.ALL, border=5) self.snapshot.Bind(wx.EVT_LEFT_DCLICK, self.onButton) self.restore = wx.RadioButton(self, -1, _(u"Discard all my data and restor... | def __init__(self, exception=None): # Instead of calling wx.Dialog.__init__ we precreate the dialog # so we can set an extra style that must be set before # creation, and then we create the GUI dialog using the Create # method. pre = wx.PreDialog() style = wx.CAPTION pre.Create(None, -1, _(u"Startup Options for Chandle... |
Globals.options.create = self.create.GetValue() if self.refreshui.GetValue(): | if hasattr(self, 'create'): Globals.options.create = self.create.GetValue() if hasattr(self, 'refreshui') and self.refreshui.GetValue(): | def onButton(self, event): buttonID = event.GetEventObject().GetId() Globals.options.create = self.create.GetValue() if self.refreshui.GetValue(): Globals.options.refreshui = True elif hasattr(self, 'snapshot') and self.snapshot.GetValue(): self.makeSnapshot() return # user canceled save box - keep going. elif self.res... |
oldParent = self.control.GetParent() if oldParent is not None: oldParent.RemoveChild(self.control) | def destroyControl(self): if self.control is None: return | |
tzinfo = masterEvent.startTime.tzinfo | tzinfo = masterEvent.effectiveStartTime.tzinfo | def updateBusy(event, start): # Broken out into a separate function because we're going # to call it for each non-recurring events, and for each # individual occurrence of all the recurring events. # In the case of the latter, event may be the master, or # a modification; we're trying to avoid creating all the # items ... |
wxAllDay.autoExpandMode = False | def OnSashPositionChange(self, event=None): wxAllDay = self.GetAllDayWidget() position = wxAllDay.GetParent().GetSashPosition() sashsize = wxAllDay.GetParent().GetSashSize() if event: assert position == event.GetSashPosition() | |
ld_library_path = os.environ['LD_LIBRARY_PATH'] | ld_library_path = os.environ.get('LD_LIBRARY_PATH', '') | def run(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'debug' + os.sep + 'bin' + os.pathsep + buildenv['path'] python = buildenv['python_d.run'] if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'release' + os.sep + 'bin' + os.pathsep + buildenv['path'] python... |
os.remove(self._openFile) | if os.path.exists(self._openFile): os.remove(self._openFile) | def close(self): |
options.scriptFile = "tools/cats/functional/FunctionalTestSuite.py" | options.scriptFile = "tools/cats/Functional/FunctionalTestSuite.py" | def initOptions(**kwds): """ Load and parse the command line options, with overrides in **kwds. Returns options """ #XXX i18n parcelPath, profileDir could have non-ascii paths # option name, (value, short cmd, long cmd, type flag, default, environment variable, help text) _configItems = { 'parcelPath': ('-p', '--pa... |
self.weekColumnHeader.SetBitmapRef(8, self.allDayOpenArrowImage) | if not '__WXMAC__' in wx.PlatformInfo: self.weekColumnHeader.SetBitmapRef(8, self.allDayOpenArrowImage) | def ResetSashState(self): wxAllDay = self.GetAllDayBlock().widget splitter = self.GetSplitterWidget() position = splitter.GetSashPosition() sashsize = splitter.GetSashSize() |
self.weekColumnHeader.SetBitmapRef(8, self.allDayCloseArrowImage) | if not '__WXMAC__' in wx.PlatformInfo: self.weekColumnHeader.SetBitmapRef(8, self.allDayCloseArrowImage) | def ResetSashState(self): wxAllDay = self.GetAllDayBlock().widget splitter = self.GetSplitterWidget() position = splitter.GetSashPosition() sashsize = splitter.GetSashSize() |
deltaHeight = 1 | deltaY = 0 | def MakeRectForRange(self, startTime, endTime): """ Turn a datetime range into a single rectangle that can be drawn on the screen """ startX, startY, width = self.getPositionFromDateTime(startTime) deltaHeight = 1 if IS_MAC: startY -= 1 deltaHeight = 0 height = int(self.hourHeight * (endTime.hour + endTime.minute/60.0)... |
startY -= 1 deltaHeight = 0 height = int(self.hourHeight * (endTime.hour + endTime.minute/60.0) - startY) | deltaY = -1 days = (endTime.date() - startTime.date()).days height = int(self.hourHeight * (24 * days + endTime.hour + endTime.minute/60.0) - startY) | def MakeRectForRange(self, startTime, endTime): """ Turn a datetime range into a single rectangle that can be drawn on the screen """ startX, startY, width = self.getPositionFromDateTime(startTime) deltaHeight = 1 if IS_MAC: startY -= 1 deltaHeight = 0 height = int(self.hourHeight * (endTime.hour + endTime.minute/60.0)... |
return wx.Rect(startX, startY, width+1, height+deltaHeight) | return wx.Rect(startX, startY + deltaY, width+1, height+1) | def MakeRectForRange(self, startTime, endTime): """ Turn a datetime range into a single rectangle that can be drawn on the screen """ startX, startY, width = self.getPositionFromDateTime(startTime) deltaHeight = 1 if IS_MAC: startY -= 1 deltaHeight = 0 height = int(self.hourHeight * (endTime.hour + endTime.minute/60.0)... |
lastModified=lastModified, etag=etag) | lastModified=lastModified, etag=etag, timeout=60) | def download(self): """ This method uses a HTTP conduict to download an RSS channel feed. """ url = str(self.url) etag = str(getattr(self, "etag", None)) lastModified = getattr(self, "lastModified", None) if lastModified: lastModified = lastModified.strftime("%a, %d %b %Y %H:%M:%S %Z") |
for releaseMode in ('debug', 'release'): | for releaseMode in ('release', 'debug'): | 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... |
self.postEventByName('BroadcastFinishChanges', {}) | focusBlock = self.getFocusBlock() try: focusBlock.saveTextValue (validate=True) except AttributeError: pass | def finishSelectionChanges (self): """ Need to finish any changes to the selected item that are in progress. """ self.postEventByName('BroadcastFinishChanges', {}) |
baseClass=CalendarRecurrenceCustomAreaBlock, | baseClass=CalendarRecurrenceEndAreaBlock, | def makeCalendarEventSubtree(parcel, oldVersion): blocks = schema.ns("osaf.framework.blocks", parcel.itsView) locationArea = \ CalendarLocationAreaBlock.template('CalendarLocationArea', childrenBlocks=[ makeSpacer(parcel, SizeType(0, 22)), makeEditor(parcel, 'CalendarLocation', viewAttribute=u'location', presentationS... |
methodGetParent = getattr (type(widget), 'GetParent', None) if methodGetParent is not None: parent = methodGetParent (widget) methodGetChildren = getattr (type(parent), 'GetChildren', None) if methodGetChildren is not None: numberChildren = len (methodGetChildren (parent)) | numberChildren = None method = getattr (type(widget), 'GetParent', None) if method is not None: parent = method (widget) method = getattr (type(parent), 'GetChildren', None) if method is not None: parentsChildren = method (parent) if widget in parentsChildren: numberChildren = len (parentsChildren) | def unRender (self): for child in self.childrenBlocks: child.unRender() widget = getattr (self, 'widget', None) |
if methodGetParent is not None and methodGetChildren is not None: assert numberChildren == len (methodGetChildren (parent)) + 1 | if numberChildren is not None: assert numberChildren == len (parent.GetChildren()) + 1 | def unRender (self): for child in self.childrenBlocks: child.unRender() widget = getattr (self, 'widget', None) |
self.synchronizeWidget() | self.wxSynchronizeWidget() | def OnSelectItem(self, item): """ Called when an item is hit, to select the item. |
key = item.copy (parent = self.findPath('//userdata'), cloudAlias="default") | key = ItemCollection.ItemCollection (view=self.itsView) key._rule = item._rule key._inclusions = item._inclusions key._exclusions = item._exclusions key.displayName = item.displayName + u" filtered by " + filterKind.displayName | def _mapItemToCacheKeyItem(self, item): key = item if isinstance (item, ItemCollection.ItemCollection): filterKind = Block.Block.findBlockByName ("Sidebar").filterKind if not filterKind is None: tupleKey = (item.itsUUID, filterKind.itsUUID) try: key = self.itemTupleKeyToCacheKey [tupleKey] except KeyError: """ We need ... |
def onCopyEventUpdateUI (self, event): return self._GenericEditUpdateUI (event, 'CanCopy') def onCopyEvent (self, event): return self._GenericEditEvent('Copy', changesData=False) def onCutEventUpdateUI (self, event): return self._GenericEditUpdateUI (event, 'CanCut') def onCutEvent (self, event): return self._Generi... | def onCopyEventUpdateUI(self, event): return self._GenericEditUpdateUI(event, 'CanCopy') def onCopyEvent(self, event): return self._GenericEditEvent(event, 'Copy', changesData=False) def onCutEventUpdateUI(self, event): return self._GenericEditUpdateUI(event, 'CanCut') def onCutEvent(self, event): return self._Gener... | def onCopyEventUpdateUI (self, event): return self._GenericEditUpdateUI (event, 'CanCopy') |
return self._GenericEditEvent('Clear') | return self._GenericEditEvent(event, 'Clear') | def onClearEvent(self, event): return self._GenericEditEvent('Clear') |
return self._GenericEditEvent('SelectAll', changesData=False) | return self._GenericEditEvent(event, 'SelectAll', changesData=False) | def onSelectAllEvent(self, event): return self._GenericEditEvent('SelectAll', changesData=False) |
def onRedoEventUpdateUI (self, event): return self._GenericEditUpdateUI (event, 'CanRedo') def onRedoEvent (self, event): return self._GenericEditEvent ('Redo') def onUndoEventUpdateUI (self, event): | def onRedoEventUpdateUI(self, event): return self._GenericEditUpdateUI(event, 'CanRedo') def onRedoEvent(self, event): return self._GenericEditEvent(event, 'Redo') def onUndoEventUpdateUI(self, event): | def onRedoEventUpdateUI (self, event): return self._GenericEditUpdateUI (event, 'CanRedo') |
def onUndoEvent (self, event): return self._GenericEditEvent ('Undo') def _GenericEditUpdateUI (self, event, methodName): | def onUndoEvent(self, event): return self._GenericEditEvent(event, 'Undo') def _GenericEditUpdateUI(self, event, methodName): | def onUndoEventUpdateUI (self, event): return self._GenericEditUpdateUI(event, 'CanUndo') # @@@ BJS: I've commented out this old implementation, # which customized the Undo enabling to change the text # between "Undo Command" and "Can't Undo" to match the # enabledness. This mechanism has two problems: # - It adds unn... |
return canDo = method() event.arguments ['Enable'] = canDo def _GenericEditEvent (self, methodName, changesData=True): | else: event.arguments['Enable'] = method() def _GenericEditEvent(self, event, methodName, changesData=True): | def _GenericEditUpdateUI (self, event, methodName): try: # get the method bound to the widget method = getattr (self.widget, methodName) except AttributeError: # don't know, so BubbleUp event.arguments['continueBubbleUp'] = True return canDo = method() # We know if we can, so enable or disable menu item event.arguments... |
return result = method() if changesData: try: | else: result = method() if changesData: | def _GenericEditEvent (self, methodName, changesData=True): try: method = getattr (self.widget, methodName) except AttributeError: # don't know, so BubbleUp event.arguments['continueBubbleUp'] = True return result = method() if changesData: # notify that data has changed, if we can try: # use type() to skip repository ... |
method = type(self).OnDataChanged except AttributeError: pass else: method(self) return result | method = getattr(type(self), 'OnDataChanged', None) if method is not None: method(self) return result | def _GenericEditEvent (self, methodName, changesData=True): try: method = getattr (self.widget, methodName) except AttributeError: # don't know, so BubbleUp event.arguments['continueBubbleUp'] = True return result = method() if changesData: # notify that data has changed, if we can try: # use type() to skip repository ... |
self.frame.text.AppendText('Platform: %s\n' % sys.platform) try: self.frame.text.AppendText('Windows Version: %s\n' % str(sys.getwindowsversion())) except: pass | self.frame.text.AppendText('Platform Type: %s\n' % sys.platform) self.frame.text.AppendText('Platform Details: %s\n' % platform.platform()) self.frame.text.AppendText('Architecture: %s\n' % platform.machine()) | def _fillRequiredSection(self, st): # Time since last failure try: logfile = stopRuntimeLog(Globals.options.profileDir) try: timeSinceLastError = 0 start = 0 for line in open(logfile): verb, value = line.split(':') # We may have corrupted start, start; stop, stop entries but that is ok, # we only count the time between... |
ret = ['<feedback xmlns="http://osafoundation.org/xmlns/feedback" version="0.2">'] | ret = ['<feedback xmlns="http://osafoundation.org/xmlns/feedback" version="0.3">'] | def buildXML(comments, email, optional, required): """ Given the possible fields in the error dialog, build an XML file of the data. """ ret = ['<feedback xmlns="http://osafoundation.org/xmlns/feedback" version="0.2">'] # The required field consists of field: value lines, followed by either # traceback or arbitrary ou... |
Don't redirect stdio to a file. useBestVisual, uses best screen resolutions on some old computers. See wxApp.SetUseBestVisual """ app = wxApplication(redirect=False, useBestVisual=True) | redirect stdio and stderr to a dialog if we're running the debug version. This is done to catch asserts, which otherwise will never get seen by people who run Chandler using the launchers, e.g. Aparna. If you're running release you can also set things up so that you can see stderr and stdout if you run in a shell or fr... | def realMain(): if __debug__ and application.Globals.options.wing: """ Check for -wing command line argument; if specified, try to connect to an already-running WingIDE instance. See: http://wiki.osafoundation.org/bin/view/Chandler/DebuggingChandler#wingIDE". for details. """ import wingdbstub if __debug__ and applica... |
self.postEventByName ('ApplicationBarAll', { }) | viewFilter = Block.findBlockByName ("Sidebar").filterKind if not kindParam.isKindOf(viewFilter): self.postEventByName ('ApplicationBarAll', { }) | def onNewEvent (self, event): # Create a new Content Item # Triggered from "File | New Item" menu, for any of the item kinds. try: kindParam = event.kindParameter except AttributeError: kindParam = Notes.Note.getKind(self.itsView) # default kind for "New" newItem = kindParam.newItem (None, None) newItem.InitOutgoingAtt... |
calendar.setTime(date) | system_tz = ICUtzinfo(TimeZone.createDefault()) calendar.setTime(date.replace(tzinfo=system_tz)) | def setRange(self, date): """ Sets the range to include the given date, given the current view. For week view, it will start the range at the beginning of the week. For day view, it will set the range to start at the given date |
calendar.setTime(date) | system_tz = ICUtzinfo(TimeZone.createDefault()) calendar.setTime(date.replace(tzinfo=system_tz)) | def setRange(self, date): """ We need to override CalendarBlock's because the cal ctrl always has its range over an entire week, even if a specific day is selected (and dayMode is true). """ assert self.daysPerView == 7, "daysPerView is a legacy variable, keep it at 7 plz" |
values=cls.values.items() | values=values | def _create_schema_item(cls, view): if hasattr(cls, 'constants'): return Types.ConstantEnumeration( None, view['Schema'], itemFor(Types.ConstantEnumeration, view), values=cls.values.items() ) else: return Types.Enumeration( None, view['Schema'], itemFor(Types.Enumeration, view), values=list(cls.values) ) |
return isSelected(self.index(item)) | return self.isSelected(self.index(item)) | def isItemSelected(self, item): return isSelected(self.index(item)) |
for range in self.getIndex().getRanges(): for idx in range: yield self[idx] | ranges = self.getSelectionRanges() if ranges is not None: for start,end in ranges: for idx in range(start,end+1): yield self[idx] | def iterSelection(self): for range in self.getIndex().getRanges(): for idx in range: yield self[idx] |
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 ]) | print "Doing make " + dbgStr + " " + clean + " world\n" log.write("Doing make " + dbgStr + " " + clean + " world\n") outputList = hardhatutil.executeCommandReturnOutput( [buildenv['make'], dbgStr, clean, "world"]) | def doBuild(buildmode, workingDir, log, svnChanges, 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 =... |
widget = wxStatusBar (Globals.association [self.parentBlock.itsUUID], | widget = wxStatusBar (frame, | def instantiateWidget (self, parent, parentWindow): frame = Globals.wxApplication.mainFrame assert frame.GetStatusBar() == None widget = wxStatusBar (Globals.association [self.parentBlock.itsUUID], Block.getWidgetID(self)) frame.SetStatusBar (widget) return widget, None, None |
if hoverRow is not None: | if hoverRow not in (None, wx.NOT_FOUND): | def OnLeave (self): # check if we had a hover row hoverRow = getattr (self, 'hoverRow', None) if hoverRow is not None: # Clear the selection colour if necessary self.SetRowHighlight(self.hoverRow, False) self.hoverRow = wx.NOT_FOUND |
startWxDate = self.GetStartDate(); endWxDate = startWxDate + wx.DateSpan.Month() + wx.DateSpan.Month() + wx.DateSpan.Month() startDate = date(startWxDate.GetYear(), startWxDate.GetMonth() + 1, startWxDate.GetDay()) month = startDate.month + 3 if month > 12: endDate = startDate.replace(year=startDate.year+1, month=mon... | self._doDrawing() def _doDrawing(self): startWxDate = self.GetStartDate(); endWxDate = startWxDate + wx.DateSpan.Month() + wx.DateSpan.Month() + wx.DateSpan.Month() startDate = date(startWxDate.GetYear(), startWxDate.GetMonth() + 1, startWxDate.GetDay()) month = startDate.month + 3 if month > 12: endDate = startDat... | def _checkRedraw(self): if self._redrawCount > 0: self._redrawCount = 0 |
startTime = item.startTime offset = (startTime.date() - startDate).days fraction = busyFractions.get(offset, 0.25) if item.allDay: hours = 12.0 else: hours = (item.duration.seconds / (60 * 60) ) | modStart = modStart.astimezone(tzinfo) | def _checkRedraw(self): if self._redrawCount > 0: self._redrawCount = 0 |
fraction += (hours / 12.0) busyFractions[offset] = min(fraction, 1.0) offset = 0 while (startDate < endDate): self.SetBusy(startWxDate, busyFractions.get(offset, 0.0)) startWxDate += wx.DateSpan.Day() startDate += timedelta(days=1) offset += 1 | if (modStart >= startDatetime and modStart <= endDatetime): updateBusy(matchingMod, modStart) offset = 0 while (startDate < endDate): self.SetBusy(startWxDate, busyFractions.get(offset, 0.0)) startWxDate += wx.DateSpan.Day() startDate += timedelta(days=1) offset += 1 | def _checkRedraw(self): if self._redrawCount > 0: self._redrawCount = 0 |
class wxHTML(wx.html.HtmlWindow): | class wxHTML(HtmlWindowWithStatus): | def instantiateWidget(self): # Remove STATIC_BORDER: it wrecks padding on WinXP; was: style = wx.STATIC_BORDER style = 0 if self.textAlignmentEnum == "Left": style |= wx.TE_LEFT elif self.textAlignmentEnum == "Center": style |= wx.TE_CENTRE elif self.textAlignmentEnum == "Right": style |= wx.TE_RIGHT |
class wxItemDetail(wx.html.HtmlWindow): | class wxItemDetail(HtmlWindowWithStatus): | def onSelectItemsEvent (self, event): items = event.arguments['items'] if len(items)>0: self.widget.GoToItem (event.arguments['items'][0]) |
@schema.observer( modificationFor ) def debugModificationFor(self, op, name): if self.modificationFor == self: import pdb; pdb.set_trace() | def removeFromCollection(self, collection, cutting=False): """ If recurring, create a proxy and use its removeFromCollection(). | |
event.arguments['Enable'] = (self.selectedItemToView and | event.arguments['Enable'] = (self.selectedItemToView is not None and | def onDeleteEventUpdateUI(self, event): event.arguments['Text'] = _('Delete Collection') """ this is enabled if any user item is selected in the sidebar """ event.arguments['Enable'] = (self.selectedItemToView and getattr(self.selectedItemToView, 'renameable', True)) |
self.widget.SetValue(_("(Already sharing this collection)")) | self.widget.SetLabel(_("(Already sharing this collection)")) | def onAcceptShareEventUpdateUI(self, event): # If we're already sharing it, we should disable the button and change the text. enabled = True try: url, collectionName = MailSharing.getSharingHeaderInfo(item) existingSharedCollection = Sharing.findMatchingShare(self.itsView, url) except: enabled = True else: if existingS... |
if not event.startTime in rruleset: | if not event.recurrenceID in rruleset: | def _generateRule(self, after=None, before=None, inclusive=False): """Yield all occurrences in this rule.""" event = first = self.getFirstInRule() # check for modifications taking place before first, but only if # if we're actually interested in dates before first (i.e., the # after argument is None or less than first.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.