rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
def ReplaceViewParcelMenu(self): """ Override to customize your parcel menu. """ ignoreErrors = wxLogNull () viewerParcelMenu = self.resources.LoadMenu ('ViewerParcelMenu') del ignoreErrors if (viewerParcelMenu != None): menuBar = app.association[id(app.model.mainFrame)].GetMenuBar () index = menuBar.FindMenu (_('View'... | def RemoveViewParcelMenu(self): """ Override to customize your parcel menu. """ menuBar = app.association[id(app.model.mainFrame)].GetMenuBar () index = menuBar.FindMenu (self.GetMenuName()) if index != wxNOT_FOUND: oldMenu = menuBar.Remove (index) del oldMenu | |
Util.ok(None, _(u"EVDB Search"), _(u"An error occurred while fetching events from EVDB:\n%s\n\nSee chandler.log for details." % (e,))) | Util.ok(None, _(u"EVDB Search"), _(u"An error occurred while fetching events from EVDB:\n%(error)s\n\nSee chandler.log for details.") % {'error': e}) | def onAddToCollection(self, event): keywords = EVDBDialog.GetSearchDictFromDialog() result = None if keywords: try: result = evdb.GetCollectionFromSearch(self.itsView, keywords) except Exception, e: Util.ok(None, _(u"EVDB Search"), _(u"An error occurred while fetching events from EVDB:\n%s\n\nSee chandler.log for det... |
Date Time DateTime TimeDelta | Date Time DateTime TimeDelta TimeZone | def _get_nrv(): if nrv is None: reset() return nrv |
installSourceFile = None | 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']) compFile1 = hardhatlib.compressDirectory(buildenv, [distName], distName) | os.chdir(buildenv['root']) compFile1 = hardhatlib.compressDirectory(buildenv, [distName], distName) installTargetFile = hardhatlib.makeInstaller(buildenv, [distName], distName) | 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... |
installSourceFile = hardhatlib.makeInstaller(buildenv, [distName], distName) installSourceFile = os.path.join(installSourceFile, "Setup.exe") installTargetFile = distName compFile1 = hardhatlib.compressDirectory(buildenv, [distName], distName) | compFile1 = hardhatlib.compressDirectory(buildenv, [distName], distName) installTargetFile = hardhatlib.makeInstaller(buildenv, [distName], distName) | 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... |
if buildenv['version'] == 'release': _outputLine(buildenv['outputdir']+os.sep+"enduser", compFile1) else: _outputLine(buildenv['outputdir']+os.sep+"developer", compFile1) | 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... | |
if installSourceFile: | if installTargetFile: | 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... |
else: if installSourceFile: installTarget = os.path.join(buildenv['root'], ('%s.exe' % installTargetFile)) if os.path.exists(installTarget): os.remove(installTarget) os.rename(installSourceFile, installTarget) | else: if buildenv['version'] == 'release': _outputLine(buildenv['outputdir']+os.sep+"enduser", compFile1) else: _outputLine(buildenv['outputdir']+os.sep+"developer", compFile1) | 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... |
if Globals.options.create: self.create.SetValue(True) | 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 | wx.STAY_ON_TOP pre.Create(None, -1, _(u"Startup Op... | |
self.Show() | 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 | wx.STAY_ON_TOP pre.Create(None, -1, _(u"Startup Op... | |
return self._index(key)[0] | i, coll = self._index(key) return i | def index(self, key): """ returns the item refered to by the key @param key: the key used for lookup into the ref collection. @type key: C{immutable}, typically C{String} @return: C{item} if found, or C{None} if not found. """ try: return self._index(key)[0] except KeyError: return None |
assert not bar.has_key(child.itsName) | if __debug__: if not child in bar: if bar.has_key(child.itsName): logging.warning("%s already has a %s named %s" % (bar.itsName, child.itsKind, child.itsName)) | def rebuildChildren(block, containers): """ scan one level of the static hierarchy looking for dynamic children. """ parent = block.parentBlock if (parent): rebuildChildren (parent, containers) for child in block.childrenBlocks: # pick up children if isinstance (child, DynamicChild): """ Use location to look up the con... |
parentWidget = block.dynamicParent.widget | def CalculateWXStyle(cls, block): if block.menuItemKind == "Separator": id = wx.ID_SEPARATOR kind = wx.ITEM_SEPARATOR else: """ Menu items must have an event, otherwise they can't cause any action, nor can we use wxWindows api's to distinguish them from each other. """ assert block.hasAttributeValue('event') id = Block... | |
return style return (None, id, "", "", kind, None) | return style | def CalculateWXStyle(cls, block): if block.menuItemKind == "Separator": id = wx.ID_SEPARATOR kind = wx.ITEM_SEPARATOR else: """ Menu items must have an event, otherwise they can't cause any action, nor can we use wxWindows api's to distinguish them from each other. """ assert block.hasAttributeValue('event') id = Block... |
for canvasItem in self.drawOrderedCanvasItems(): | for canvasItem in self.drawOrderedCanvasItems: | def DrawCells(self, dc): styles = self.blockItem.calendarContainer # Set up fonts and brushes for drawing the events dc.SetTextForeground(wx.BLACK) dc.SetBrush(wx.WHITE_BRUSH) |
def drawOrderedCanvasItems(self): | def SetDrawOrder(self): | def drawOrderedCanvasItems(self): """ Calculate the order of canvas items, taking selection, history, and active collection into account. """ ordered = [] selectedBoxes = [] activeBoxes = [] orderLastMap = {} contents = CalendarSelection(self.blockItem.contents) |
return ordered | self.drawOrderedCanvasItems = ordered | def drawOrderedCanvasItems(self): """ Calculate the order of canvas items, taking selection, history, and active collection into account. """ ordered = [] selectedBoxes = [] activeBoxes = [] orderLastMap = {} contents = CalendarSelection(self.blockItem.contents) |
for canvasItem in reversed(self.drawOrderedCanvasItems()): | for canvasItem in reversed(self.drawOrderedCanvasItems): | def GetCanvasItemAt(self, unscrolledPosition): """ Similar to the one in CollectionCanvas, but take selection into account, because sometimes items on the bottom of a stack of conflicting events is the currently selected one. """ for canvasItem in reversed(self.drawOrderedCanvasItems()): if canvasItem.isHit(unscrolledP... |
item.Update() | try: item.Update() except socket.timeout: logging.debug('zaobao - socked timed out') | def Execute(self, agent, notification): repository = self.getRepository() |
python, | def build(buildenv): version = buildenv['version'] if buildenv['os'] in ('osx', 'posix'): # Create the build directory buildDir = os.path.abspath("build_%s" % version) if os.access(buildDir, os.F_OK): hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Temporary build directory exists: " + buildDir... | |
os.chdir("build") os.chdir("msw") | def build(buildenv): version = buildenv['version'] if buildenv['os'] in ('osx', 'posix'): # Create the build directory buildDir = os.path.abspath("build_%s" % version) if os.access(buildDir, os.F_OK): hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Temporary build directory exists: " + buildDir... | |
"msw.sln", | "build/msw/msw.sln", | def build(buildenv): version = buildenv['version'] if buildenv['os'] in ('osx', 'posix'): # Create the build directory buildDir = os.path.abspath("build_%s" % version) if os.access(buildDir, os.F_OK): hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Temporary build directory exists: " + buildDir... |
def clean(buildenv): if buildenv['os'] == 'posix': if buildenv['version'] == 'release': buildDir=buildenv['root']+os.sep+'wxpython'+os.sep+'build_release' if os.access(buildDir, os.F_OK): hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Removing temporary build directory: " + buildDir) hardhatlib.... | os.putenv('WXWIN', os.getcwd()) | def build(buildenv): version = buildenv['version'] if buildenv['os'] in ('osx', 'posix'): # Create the build directory buildDir = os.path.abspath("build_%s" % version) if os.access(buildDir, os.F_OK): hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Temporary build directory exists: " + buildDir... |
os.chdir("wxSWIG") hardhatlib.executeCommand( buildenv, info['name'], [buildenv['nmake'], '-f', 'makefile.vc', 'clean'], "Cleaning wxSWIG") | if version == 'release': hardhatlib.executeCommand( buildenv, info['name'], [buildenv['python'], 'setup.py', 'clean', '--all'], "Cleaning wxPython") elif version == 'debug': hardhatlib.executeCommand( buildenv, info['name'], [buildenv['python_d'], 'setup.py', 'clean', '--all'], "Cleaning wxPython") | def clean(buildenv): if buildenv['os'] == 'posix': if buildenv['version'] == 'release': buildDir=buildenv['root']+os.sep+'wxpython'+os.sep+'build_release' if os.access(buildDir, os.F_OK): hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Removing temporary build directory: " + buildDir) hardhatlib.... |
self._commitDownloadedMail() | return callback.addBoth(lambda x: self._commitDownloadedMail()) | def _fetchMessage(self, msgs, curMessage): if __debug__: trace("_fetchMessage") |
return self.proto.fetchMessage(str(m[0]), uid=True ).addCallback(self._fetchMessage, m ).addErrback(self.catchErrors) | return callback.addBoth(lambda x: self.proto.fetchMessage(str(m[0]), uid=True ).addCallback(self._fetchMessage, m ).addErrback(self.catchErrors) ) | def _fetchMessage(self, msgs, curMessage): if __debug__: trace("_fetchMessage") |
ProtocolWrapper.__init__(self, factory, wrappedProtocol) | self.factory = factory self.wrappedProtocol = wrappedProtocol | def __init__(self, factory, wrappedProtocol): if debug: print 'TwistedProtocolWrapper.__init__' ProtocolWrapper.__init__(self, factory, wrappedProtocol) |
if share.active and not share.hidden and (share.contents not in sharedCollections): | if (share.active and not share.hidden and share.contents is not None and share.contents not in sharedCollections): | def syncAll(view, updateCallback=None): """ Synchronize all active shares. @param view: The repository view object @type view: L{repository.persistence.RepositoryView} """ sharedCollections = [] for share in Share.iterItems(view): if share.active and not share.hidden and (share.contents not in sharedCollections): sha... |
super(run_in_thread, self).__init__() | super(run_in_thread, self).__init__(name=str(item.itsPath)) | def __init__(self, code, item): self.view = item.itsView self.uuid = item.itsUUID self.code = code repo = self.view.repository if repo is not None: self.view = repo.createView() super(run_in_thread, self).__init__() self.setDaemon(True) # main thread can exit even if this one hasn't |
["debug","Chandler"], | ["debug"], | 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... |
["release","Chandler"], | ["release"], | 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.UIRepositoryView.refresh() | def deleteAllBranchCaches (block): for child in block.childrenBlocks: deleteAllBranchCaches (child) import osaf.framework.blocks.BranchPoint as BranchPoint if isinstance (block, BranchPoint.BranchPointBlock): block.delegate.deleteCache() | |
if self.parent.blockItem.dayMode: reldate = self.parent.blockItem.selectedDate - \ self.parent.blockItem.rangeStart self.weekHeader.SetSelectedItem(reldate.day+1) else: self.weekHeader.SetSelectedItem(0) | self.UpdateHeader() | def OnDayColumnSelect(self, event): """ dispatches to appropriate events in self.parent, based on the column selected """ colIndex = self.weekHeader.GetSelectedItem() # column 0, week button if (colIndex == 0): return self.parent.OnWeekSelect() # last column, the "+" expand button # (this may change...) if (colIndex... |
if drawableObject.bounds.Inside (x, y): | if drawableObject.bounds.Inside ((x, y)): | def OnMouseEvent (self, event): x, y = event.GetPositionTuple() x, y = self.CalcUnscrolledPosition (x, y) for drawableObject in self.zOrderedDrawableObjects: if drawableObject.bounds.Inside (x, y): event.m_x = x - drawableObject.bounds.GetX() event.m_y = y - drawableObject.bounds.GetY() if drawableObject.ProcessEvent (... |
else: | elif detailItemChanged or treeChanged: | def installTreeOfBlocks(self): """ If necessary, replace our children with a tree of blocks appropriate for our content. """ hints = {} keyItem = self.delegate._mapItemToCacheKeyItem( self.selectedItem, hints) newView = self.delegate.getBranchForKeyItem(keyItem) if keyItem is None: detailItem = None else: """ Seems lik... |
break try: kc = schema.ns("osaf.pim.collections", item.itsView).kind_collections for i in kc.collections: if item in i and hasattr(i,'contentsUpdated'): i.contentsUpdated(item) break except AttributeError, ae: logger.debug(ae) pass | else: try: kc = schema.ns("osaf.pim.collections", item.itsView).kind_collections for i in kc.collections: if item in i and hasattr(i,'contentsUpdated'): i.contentsUpdated(item) except AttributeError, ae: logger.debug(ae) pass | def mapChangesCallable(item, version, status, literals, references): """ """ # handle changes to items in a ListCollection if hasattr(item,'collections'): for i in item.collections: i.contentsUpdated(item) break # handle changes to items in an existing KindCollection # is the item in a kind collection? try: #@@@ this ... |
def get_outline_color(r,g,b): from colorsys import * hsv = rgb_to_hsv(r,g,b) newhsv = (hsv[0], min(hsv[1]+.1,1), max(hsv[2] - .2,0)) return hsv_to_rgb(*newhsv) | class CachedAttribute(object): def __init__(self, method): self.method = method self.name = method.__name__ def __get__(self, inst, cls): if inst is None: return self result = self.method(inst) setattr(inst, self.name, result) return result | def get_outline_color(r,g,b): from colorsys import * hsv = rgb_to_hsv(r,g,b) newhsv = (hsv[0], min(hsv[1]+.1,1), max(hsv[2] - .2,0)) return hsv_to_rgb(*newhsv) |
self.calendarColor = Styles.ColorStyle(self.itsView) | hueList = [k/360.0 for k in [210, 120, 60, 0, 240, 90, 330, 30, 180, 270]] @classmethod def getNextHue(cls, oldhue): """ returns the next hue following the one passed in For example, f.hue = nextHue(f.hue) """ found = False for hue in cls.hueList: if found: return hue if hue == oldhue: found = True return cls.hueList[... | def __init__(self, *args, **keywords): super(CalendarData, self).__init__(*args, **keywords) self.calendarColor = Styles.ColorStyle(self.itsView) |
color = styles.blockItem.getEventOutlineColor(item) | eventColors = styles.blockItem.getEventColors(item) color = eventColors.outlineColor | def GetStatusPen(self, styles): # probably should use styles to determine a good pen color item = self.GetItem() color = styles.blockItem.getEventOutlineColor(item) if (item.transparency == "confirmed"): pen = wx.Pen(color, 4) elif (item.transparency == "fyi"): pen = wx.Pen(color, 4) elif (item.transparency == "tentati... |
pen = wx.Pen(color, 4) | pen = wx.Pen(color, 1) | def GetStatusPen(self, styles): # probably should use styles to determine a good pen color item = self.GetItem() color = styles.blockItem.getEventOutlineColor(item) if (item.transparency == "confirmed"): pen = wx.Pen(color, 4) elif (item.transparency == "fyi"): pen = wx.Pen(color, 4) elif (item.transparency == "tentati... |
def getEventColorStyle(self, event): | def setupNextHue(self): c = self.contents.source.calendarColor.backgroundColor self.lastHue = CalendarData.getNextHue(self.lastHue) (c.red, c.green, c.blue) = rgb2color(*hsv_to_rgb(self.lastHue, 1.0, 1.0)) def getEventColors(self, event): """ Get the eventColors object which contains all the right color tints for the ... | def getCalendarData(self): """ Lazily stamp the data """ caldata = self.contents.source if not isinstance(caldata, CalendarData): caldata.StampKind('add', CalendarData.getKind(view=caldata.itsView)) colorstyle = Styles.ColorStyle(view=self.itsView) # make copies, because initialValue ends up being shared, because # it... |
return coll.calendarColor return None def getEventBackgroundColor(self, event): colorStyle = self.getEventColorStyle(event) if colorStyle: return colorStyle.backgroundColor.wxColor() return self.getEventsBackgroundColor() def getEventOutlineColor(self, event): colorStyle = self.getEventColorStyle(event) if colorStyle... | return coll return self.calendarData def setCalendarColor(self, color): """ Set the base color from which all tints are determined. Note that this will lazily stamp the selected collection """ ec = copy.copy(self.calendarData.eventColor) (ec.red, ec.green, ec.blue) = color self.calendarData.eventColor = ec | def getEventColorStyle(self, event): containingCollections = event.itemCollectionInclusions calDataKind = CalendarData.getKind(view=self.itsView) for coll in containingCollections: |
self.blockItem.setEventsColor(event.GetValue()) | c = event.GetValue().Get() self.blockItem.setCalendarColor(c) | def OnSelectColor(self, event): self.blockItem.setEventsColor(event.GetValue()) # just cause a repaint - hopefully this cascades to child windows? self.Refresh() |
self.colorSelect.SetColour(self.parent.blockItem.getEventsBackgroundColor()) | self.colorSelect.SetColour(self.parent.blockItem.calendarData.eventColor.wxColor()) | def wxSynchronizeWidget(self): selectedDate = self.parent.blockItem.selectedDate startDate = self.parent.blockItem.rangeStart |
dc.SetTextForeground(styles.eventLabelColor) | def PrintStackEntry(entry): print " " + entry[2] + " @ " + entry[0][30:] + ":" + str(entry[1]) | |
dc.SetBrush(styles.selectionBrush) dc.SetPen(wx.Pen(styles.blockItem.getEventOutlineColor(selectedBox.GetItem()))) | eventColors = styles.blockItem.getEventColors(selectedBox.GetItem()) dc.SetPen(wx.Pen(eventColors.selectedOutlineColor)) brush = styles.GetGradientBrush(eventColors.selectedGradientLeft, eventColors.selectedGradientRight) dc.SetBrush(brush) dc.SetTextForeground(eventColors.selectedTextColor) | def PrintStackEntry(entry): print " " + entry[2] + " @ " + entry[0][30:] + ":" + str(entry[1]) |
drawingPen = wx.Pen(styles.blockItem.getEventOutlineColor(item)) drawingBrush = wx.Brush(styles.blockItem.getEventBackgroundColor(item)) dc.SetPen(drawingPen) dc.SetBrush(drawingBrush) | 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) | |
dc.SetPen(wx.Pen(styles.blockItem.getEventOutlineColor(item))) dc.SetBrush(styles.selectionBrush) | eventColors = styles.blockItem.getEventColors(item) dc.SetPen(wx.Pen(eventColors.selectedOutlineColor)) brush = styles.GetGradientBrush(eventColors.selectedGradientLeft, eventColors.selectedGradientRight) dc.SetBrush(brush) dc.SetTextForeground(eventColors.selectedTextColor) | 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) |
self._setRoot(newParent._addItem(self, previous, next)) self._parent = newParent | self._setParent(newParent) | def move(self, newParent, previous=None, next=None): 'Move this item under another container or make it a root.' |
pressedBitmap = wx.GetApp().GetImage(name + "md.png") | pressedBitmap = wx.GetApp().GetImage(name + "MouseDown.png") | def __init__(self, parent, name): """ |
reNotifyInside(child, item) | needsLayout = reNotifyInside(child, item) or needsLayout | def reNotifyInside(block, item): notifySelf = len(block.childrenBlocks) == 0 # True if no children try: # process from the children up for child in block.childrenBlocks: notifySelf = reNotifyInside (child, item) or notifySelf except AttributeError: pass try: syncMethod = type(block).synchronizeItemDetail except Attribu... |
print key, testkey, targetAvg, current, c_perc, c_diff, s, stdDev | print key, testkey, targetAvg, current, previous, c_perc, c_diff, s, stdDev | def _generateSummaryDetailLine(self, platforms, testkey, enddate, testDisplayName, currentValue, previousValue): graph = [] if testkey in self.SummaryTargets.keys(): targetAvg = self.SummaryTargets[testkey] else: targetAvg = 0.0 |
line += '<td>%01.2fs</td>' % stdDev | line += '<td>%0.2es</td>' % stdDev | def _generateSummaryDetailLine(self, platforms, testkey, enddate, testDisplayName, currentValue, previousValue): graph = [] if testkey in self.SummaryTargets.keys(): targetAvg = self.SummaryTargets[testkey] else: targetAvg = 0.0 |
previousValue[platformkey] = dateitem[k_hours[p-1]][0][DP_AVERAGE] | previousValue[platformkey] = dateitem[k_hours[p-2]][0][DP_AVERAGE] | def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
previousValue[platformkey] = dateitem[k_hours[p-2]][0][DP_AVERAGE] | previousValue[platformkey] = dateitem[k_hours[p-1]][0][DP_AVERAGE] | def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
width, height = self.canvas.GetVirtualSize() | try: self.canvas.columnCanvas except AttributeError: width, height = self.canvas.GetVirtualSize() else: width, height = self.canvas.columnCanvas.GetVirtualSize() | def OnPrintPage(self, page): dc = self.GetDC() |
width, height = self.canvas.GetVirtualSize() | def OnPrintPage(self, page): dc = self.GetDC() | |
self.editor.SaveAndHide() | if self.editor.IsShown(): self.editor.SaveAndHide() | def GrabFocusHack(self): self.editor.SaveAndHide() |
def flushCaches(self, reason): | def flushCaches(self, reason, recursive=True): | def flushCaches(self, reason): """ Flush the caches setup on this Kind and its subKinds. """ |
for subKind in self._references.get('subKinds', Nil): subKind.flushCaches(reason) | if recursive: for subKind in self._references.get('subKinds', Nil): subKind.flushCaches(reason) | def flushCaches(self, reason): """ Flush the caches setup on this Kind and its subKinds. """ |
who = schema.One(schema.Text, initialValue = u"", indexed) | who = schema.One(schema.Text, initialValue = u"", indexed=True) | def __str__(self): readable = [] for item in self: readable.append(item.itsName) theList = ', '.join(readable) return '['+theList+']' |
style = 0 | style = wx.STATIC_BORDER | def instantiateWidget(self): 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 |
widget = wxTable (self.parentBlock.widget, Block.getWidgetID(self)) | widget = wxTable (self.parentBlock.widget, Block.getWidgetID(self), style=wx.NO_BORDER) | def instantiateWidget (self): widget = wxTable (self.parentBlock.widget, Block.getWidgetID(self)) widget.SetDefaultCellFont(Styles.getFont(getattr(self, "characterStyle", None))) widget.SetLabelFont(Styles.getFont(getattr(self, "headerStyle", None))) defaultName = "_default" widget.SetDefaultRenderer (GridCellAttribute... |
method = getattr (type (item), "addToCollection", None) if method is not None: method (item, possibleCollection) | if getattr(item, pim.EventStamp.rruleset.name) is not None: RecurrenceDialog.getProxy(u'ui', item).addToCollection(possibleCollection) else: method = getattr (type (item), "addToCollection", None) if method is not None: method (item, possibleCollection) | def AddItems (self, itemList): # Adding due to Drag and Drop? whereToDropItem = getattr (self, 'whereToDropItem', None) if whereToDropItem is None: possibleCollections = self.SelectedItems() else: possibleCollections = [self.blockItem.contents[whereToDropItem]] self.SetRowHighlight(self.whereToDropItem, False) del self... |
def getReminderType(reminder): | def getReminderType(item): | def getReminderType(reminder): """ What kind of user reminder is this? Returns 'none', 'before', 'after', or 'custom' """ if reminder is None: return 'none' if reminder.absoluteTime is not None: return 'custom' delta = timeDeltaMinutes(reminder.delta) return (delta > 0) and 'after' or 'before' |
if reminder is None: | if getattr(item, pim.Remindable.userReminderTime.name, None) is not None: return 'custom' delta = getattr(item, pim.Remindable.userReminderInterval.name, None) if delta is None: | def getReminderType(reminder): """ What kind of user reminder is this? Returns 'none', 'before', 'after', or 'custom' """ if reminder is None: return 'none' if reminder.absoluteTime is not None: return 'custom' delta = timeDeltaMinutes(reminder.delta) return (delta > 0) and 'after' or 'before' |
if reminder.absoluteTime is not None: return 'custom' delta = timeDeltaMinutes(reminder.delta) return (delta > 0) and 'after' or 'before' | deltaMinutes = timeDeltaMinutes(delta) return deltaMinutes > 0 and 'after' or 'before' | def getReminderType(reminder): """ What kind of user reminder is this? Returns 'none', 'before', 'after', or 'custom' """ if reminder is None: return 'none' if reminder.absoluteTime is not None: return 'custom' delta = timeDeltaMinutes(reminder.delta) return (delta > 0) and 'after' or 'before' |
(getReminderType(pim.Remindable(item).getUserReminder()) in ('before', 'after'))) | (getReminderType(item) in ('before', 'after'))) | def shouldShow(self, item): return (super(ReminderRelativeAreaBlock, self).shouldShow(item) and (getReminderType(pim.Remindable(item).getUserReminder()) in ('before', 'after'))) |
(getReminderType(pim.Remindable(item).getUserReminder()) == 'custom')) | (getReminderType(item) == 'custom')) | def shouldShow(self, item): return (super(ReminderAbsoluteAreaBlock, self).shouldShow(item) and (getReminderType(pim.Remindable(item).getUserReminder()) == 'custom')) |
return getReminderType(pim.Remindable(item).getUserReminder()) | return getReminderType(item) | def GetAttributeValue(self, item, attributeName): """ Get the value from the specified attribute of the item. """ return getReminderType(pim.Remindable(item).getUserReminder()) |
remindable = pim.Remindable(item) reminder = remindable.getUserReminder() reminderType = getReminderType(reminder) | reminderType = getReminderType(item) | def SetAttributeValue(self, item, attributeName, value): """ Set the value of the attribute given by the value. """ if self.ReadOnly((item, attributeName)): return |
remindable.userReminderTime = None | setattr(item, pim.Remindable.userReminderTime.name, None) | def SetAttributeValue(self, item, attributeName, value): """ Set the value of the attribute given by the value. """ if self.ReadOnly((item, attributeName)): return |
(units, scale, isAfter) = timeDeltaDetails(reminder.delta) remindable.userReminderInterval = scaleTimeDelta(units, scale, not isAfter) | delta = getattr(item, pim.Remindable.userReminderInterval.name) (units, scale, isAfter) = timeDeltaDetails(delta) setattr(item, pim.Remindable.userReminderInterval.name, scaleTimeDelta(units, scale, not isAfter)) | def SetAttributeValue(self, item, attributeName, value): """ Set the value of the attribute given by the value. """ if self.ReadOnly((item, attributeName)): return |
remindable.userReminderInterval = scaleTimeDelta(15, 0, value == 'after') | setattr(item, pim.Remindable.userReminderInterval.name, scaleTimeDelta(15, 0, value == 'after')) | def SetAttributeValue(self, item, attributeName, value): """ Set the value of the attribute given by the value. """ if self.ReadOnly((item, attributeName)): return |
remindable.userReminderTime = datetime.now(tz=ICUtzinfo.default)\ .replace(hour=17, minute=0, second=0, microsecond=0) | setattr(item, pim.Remindable.userReminderTime.name, datetime.now(tz=ICUtzinfo.default)\ .replace(hour=17, minute=0, second=0, microsecond=0)) | def SetAttributeValue(self, item, attributeName, value): """ Set the value of the attribute given by the value. """ if self.ReadOnly((item, attributeName)): return |
reminder = pim.Remindable(item).getUserReminder() reminderType = getReminderType(reminder) | reminderType = getReminderType(item) | def GetAttributeValue(self, item, attributeName): reminder = pim.Remindable(item).getUserReminder() reminderType = getReminderType(reminder) if reminderType not in ('before', 'after'): return 0 (units, scale, isAfter) = timeDeltaDetails(reminder.delta) return scale |
(units, scale, isAfter) = timeDeltaDetails(reminder.delta) | delta = getattr(item, pim.Remindable.userReminderInterval.name) (units, scale, isAfter) = timeDeltaDetails(delta) | def GetAttributeValue(self, item, attributeName): reminder = pim.Remindable(item).getUserReminder() reminderType = getReminderType(reminder) if reminderType not in ('before', 'after'): return 0 (units, scale, isAfter) = timeDeltaDetails(reminder.delta) return scale |
reminder = pim.Remindable(item).getUserReminder() reminderType = getReminderType(reminder) | reminderType = getReminderType(item) | def SetAttributeValue(self, item, attributeName, value): if value is None: return reminder = pim.Remindable(item).getUserReminder() reminderType = getReminderType(reminder) if reminderType not in ('before', 'after'): return (units, scale, isAfter) = timeDeltaDetails(reminder.delta) if scale == value: return # unchange... |
(units, scale, isAfter) = timeDeltaDetails(reminder.delta) | delta = getattr(item, pim.Remindable.userReminderInterval.name) (units, scale, isAfter) = timeDeltaDetails(delta) | def SetAttributeValue(self, item, attributeName, value): if value is None: return reminder = pim.Remindable(item).getUserReminder() reminderType = getReminderType(reminder) if reminderType not in ('before', 'after'): return (units, scale, isAfter) = timeDeltaDetails(reminder.delta) if scale == value: return # unchange... |
reminder = pim.Remindable(item).getUserReminder() reminderType = getReminderType(reminder) | reminderType = getReminderType(item) | def GetAttributeValue(self, item, attributeName): # Get the existing reminder, and figure out what kind it is reminder = pim.Remindable(item).getUserReminder() reminderType = getReminderType(reminder) |
(units, scale, isAfter) = timeDeltaDetails(reminder.delta) | delta = getattr(item, pim.Remindable.userReminderInterval.name) (units, scale, isAfter) = timeDeltaDetails(delta) | def GetAttributeValue(self, item, attributeName): # Get the existing reminder, and figure out what kind it is reminder = pim.Remindable(item).getUserReminder() reminderType = getReminderType(reminder) |
reminder = pim.Remindable(item).getUserReminder() reminderType = getReminderType(reminder) | reminderType = getReminderType(item) | def SetAttributeValue(self, item, attributeName, valueString): reminder = pim.Remindable(item).getUserReminder() reminderType = getReminderType(reminder) if reminderType not in ('before', 'after'): assert False return valueString = valueString.replace('?','').strip() if len(valueString) == 0: # Put the old value back.... |
(units, scale, isAfter) = timeDeltaDetails(reminder.delta) | delta = getattr(item, pim.Remindable.userReminderInterval.name) (units, scale, isAfter) = timeDeltaDetails(delta) | def SetAttributeValue(self, item, attributeName, valueString): reminder = pim.Remindable(item).getUserReminder() reminderType = getReminderType(reminder) if reminderType not in ('before', 'after'): assert False return valueString = valueString.replace('?','').strip() if len(valueString) == 0: # Put the old value back.... |
pim.Remindable(item).userReminderInterval = scaleTimeDelta(value, scale, isAfter) | setattr(item, pim.Remindable.userReminderInterval.name, scaleTimeDelta(value, scale, isAfter)) | def SetAttributeValue(self, item, attributeName, valueString): reminder = pim.Remindable(item).getUserReminder() reminderType = getReminderType(reminder) if reminderType not in ('before', 'after'): assert False return valueString = valueString.replace('?','').strip() if len(valueString) == 0: # Put the old value back.... |
regionBox = region.GetBox() if regionBox.y == 0 and regionBox.height == 1: return | def OnPaint(self, event): dc = wx.PaintDC(self) | |
pass | self.widget.ClearAllAttr() | def onEnableBusyBars(self, event): self.enableBusyBars = not self.enableBusyBars if ( not self.enableBusyBars ): # Disabling this until relver gets bumped #self.widget.ClearAllAttr() pass self.widget.wxSynchronizeWidget() self.widget.Refresh() |
def drawGraph(data, platforms, filename): | def drawGraph(data, platforms, filename, size=(132, 132), xLabel='Revision'): | def drawGraph(data, platforms, filename): """ Draw a picture in png format. @param data: Format: [(x1, winy1, osxy1, linuxy1, acceptabley1), ...] @param platforms:Platforms tuple @param filename: A PNG filename (so it should end in '.png'). """ if not doChart or len(data) < 1: return False def ticX(data): return ... |
label='Revision') | label=xLabel) | def ticX(data): return int(len(data)/10) + 1 |
size=(132, 132), | size=size, | def ticX(data): return int(len(data)/10) + 1 |
if delta.days < 14: | if delta.days < self._options['delta_days']: | def churnData(self): tests = {} today = datetime.datetime.today() |
indexpage.append('<h1>Performance Standard Deviation for the previous 7 days</h1>\n') | indexpage.append('<h1>Performance Standard Deviation for the previous %d days</h1>\n' % self._options['delta_days']) | def generateDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
if testkey <> 'totals:': | if testkey in graphTests: | def generateDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
graphDict[testkey] = graphPlatform def plat2data(graphPlatform, acceptable): dates = unique(graphPlatform['win'].keys() + \ graphPlatform['osx'].keys() + \ graphPlatform['linux'].keys()) dates.sort() data = [] for date in dates: data.append((date, graphPlatform['win'].get(date, None), graphPlatform['osx'].get(date, No... | def generateDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} | |
detailfile = file(os.path.join(self._options['html_data'], 'detail_%s_%s.html' % (startdate, enddate)), 'w') | detailfile = file(os.path.join(self._options['html_data'], detailfilename), 'w') | def generateDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
tboxfile.write('<tr><th rowspan="2">Test<br/>Latest results as of %s</th><th rowspan="2">0.6<br/>Target</th>' % latest) | tboxfile.write('<tr><th rowspan="2">Test (<a href="%s">trends</a>)<br/>Latest results as of %s</th><th rowspan="2">0.6<br/>Target</th>' % ('trends.html', latest)) | def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runtime) ] }}}} |
def RemoveViewParcelMenu(self): """ Override to customize your parcel menu. """ menuBar = app.association[id(app.model.mainFrame)].GetMenuBar () index = menuBar.FindMenu (self.GetMenuName()) if index != wxNOT_FOUND: oldMenu = menuBar.Remove (index) del oldMenu | def RemoveViewParcelMenu(self): """ Override to customize your parcel menu. """ menuBar = app.association[id(app.model.mainFrame)].GetMenuBar () index = menuBar.FindMenu (self.GetMenuName()) if index != wxNOT_FOUND: oldMenu = menuBar.Remove (index) del oldMenu | |
ignoreErrors = wxLogNull () viewerParcelMenu = self.resources.LoadMenu ('ViewerParcelMenu') del ignoreErrors if (viewerParcelMenu != None): mainFrameId = id(app.model.mainFrame) if app.association.has_key(mainFrameId): mainFrame = app.association[mainFrameId] menuBar = mainFrame.GetMenuBar () index = menuBar.FindMenu (... | mainFrameId = id(app.model.mainFrame) if app.association.has_key(mainFrameId): mainFrame = app.association[mainFrameId] menuBar = mainFrame.GetMenuBar () menuIndex = menuBar.FindMenu (_('View')) + 1 assert (menuIndex != wxNOT_FOUND) noParcelMenu = menuBar.FindMenu(_('Help')) == menuIndex ignoreErrors = wxLogNull () vi... | def ReplaceViewParcelMenu(self): """ Override to customize your parcel menu. """ ignoreErrors = wxLogNull () viewerParcelMenu = self.resources.LoadMenu ('ViewerParcelMenu') del ignoreErrors if (viewerParcelMenu != None): mainFrameId = id(app.model.mainFrame) if app.association.has_key(mainFrameId): mainFrame = app.asso... |
oldMenu = menuBar.Replace (index + 1, viewerParcelMenu, | oldMenu = menuBar.Replace (menuIndex, viewerParcelMenu, | def ReplaceViewParcelMenu(self): """ Override to customize your parcel menu. """ ignoreErrors = wxLogNull () viewerParcelMenu = self.resources.LoadMenu ('ViewerParcelMenu') del ignoreErrors if (viewerParcelMenu != None): mainFrameId = id(app.model.mainFrame) if app.association.has_key(mainFrameId): mainFrame = app.asso... |
def AddViewParcelMenu(self): """ Override to customize your parcel menu. """ ignoreErrors = wxLogNull () viewerParcelMenu = self.resources.LoadMenu ('ViewerParcelMenu') del ignoreErrors if (viewerParcelMenu != None): mainFrameId = id(app.model.mainFrame) if not app.association.has_key(mainFrameId): mainFrame = app.asso... | else: if not noParcelMenu: oldMenu = menuBar.Remove (menuIndex) del oldMenu | def ReplaceViewParcelMenu(self): """ Override to customize your parcel menu. """ ignoreErrors = wxLogNull () viewerParcelMenu = self.resources.LoadMenu ('ViewerParcelMenu') del ignoreErrors if (viewerParcelMenu != None): mainFrameId = id(app.model.mainFrame) if app.association.has_key(mainFrameId): mainFrame = app.asso... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.