rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
if changesInCVS(workingDir, cvsVintage, log): | cvsChanges = changesInCVS(workingDir, cvsVintage, log) if cvsChanges['external'] or cvsChanges['internal']: | 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... |
doBuild(releaseMode, workingDir, log) | doBuild(releaseMode, workingDir, log, cvsChanges) if cvsChanges['external'] or cvsChanges['internal'] or cvsChanges['chandler']: | def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log): global buildenv, changes try: buildenv = hardhatlib.defaults buildenv['root'] = workingDir buildenv['hardhatroot'] = whereAmI hardhatlib.init(buildenv) except hardhatlib.HardHatMissingCompilerError: print "Could not locate compiler. Exiti... |
changesAtAll = False | changesDict = {} | def changesInCVS(workingDir, cvsVintage, log): changesAtAll = False |
changesAtAll = True | changesDict[module] = True | def changesInCVS(workingDir, cvsVintage, log): changesAtAll = False |
[cvsProgram, "-q -z3", "update", "-dAP"]) | [cvsProgram, "-q -z3", "update", "-dP", cvsVintage, module]) | def changesInCVS(workingDir, cvsVintage, log): changesAtAll = False |
return changesAtAll def doBuild(buildmode, workingDir, log, clean='clean'): | return changesDict def doBuild(buildmode, workingDir, log, cvsChanges, clean='clean'): | def changesInCVS(workingDir, cvsVintage, log): changesAtAll = False |
from epydoc.html import HTMLFormatter from epydoc.objdoc import DocMap, report_param_mismatches from epydoc.imports import import_module, find_modules from epydoc.objdoc import set_default_docformat | def generateDocs(options, outputDir): if options.verbose: verbosity = 4 else: verbosity = 1 chandlerBin = os.getenv('CHANDLERBIN') targetDir = os.path.join(outputDir, 'api') if not os.path.isdir(targetDir): _mkdirs(targetDir) # This is the options dictionary # It is used by most of the epydoc routines and # the con... | |
If the C{{indexName} attribute of this collection is set to | If the C{indexName} attribute of this collection is set to | def createIndex (self): """ Create an index on this collection |
if self._dirty: | if self._dirty or self._version == 0: | def _xmlValue(self, generator): |
try: """Set the Python locale""" locale.setlocale(locale.LC_ALL, self._localeSet[0]) except locale.Error: logging.error("Unable to set Python locale to: '%s'" % self._localeSet[0]) | for locale in self._localeSet: if self.__setPythonLocale(locale): break | def setLocaleSet(self, localeSet=None, domain=OSAF_DOMAIN): self.flushCache() |
return not (item.anyTime or not item.duration) | return not ((item.anyTime and not item.allDay) or not item.duration) | def shouldShow (self, item): return not (item.anyTime or not item.duration) |
attributes.extend(('duration', 'anyTime')) | attributes.extend(('anyTime', 'allDay', 'duration')) | def attributesToWatch(self): attributes = super(TransparencyConditionalBlock, self).attributesToWatch() attributes.extend(('duration', 'anyTime')) return attributes |
if len(tzString > 0): | if len(tzString) > 0: | 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 not os.path.exists (os.path.join(extModuleDir, "sources-" + version + ".tar.gz")): | sourceTarball = os.path.join(extModuleDir, "sources-" + version + ".tar.gz") log.write("Checking for source tarball " + sourceTarball) if not os.path.exists(sourceTarball) : | def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log): # make sure workingDir is absolute, remove it, and create it workingDir = os.path.abspath(workingDir) if not os.path.exists(workingDir): os.mkdir(workingDir) os.chdir(workingDir) # remove outputDir and create it outputDir = os.path.join(wor... |
log.write("initialization log:" + "\n") CopyLog(os.path.join(releaseModeDir, logPath), log) log.write("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n") | def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log): # make sure workingDir is absolute, remove it, and create it workingDir = os.path.abspath(workingDir) if not os.path.exists(workingDir): os.mkdir(workingDir) os.chdir(workingDir) # remove outputDir and create it outputDir = os.path.join(wor... | |
mainModule = 'chandler' logPath = 'hardhat.log' | def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log): # make sure workingDir is absolute, remove it, and create it workingDir = os.path.abspath(workingDir) if not os.path.exists(workingDir): os.mkdir(workingDir) os.chdir(workingDir) # remove outputDir and create it outputDir = os.path.join(wor... | |
def onRemoveEventUpdateUI(self, event): | def onDeleteEventUpdateUI(self, event): | def onRemoveEventUpdateUI(self, event): # so you can't use the delete key to delete a collection event.arguments['Enable'] = False |
def onDeleteEventUpdateUI(self, event): event.arguments['Text'] = _(u'Delete Collection') | def onRemoveEventUpdateUI(self, event): event.arguments['Text'] = _(u'Remove Collection') | def onDeleteEventUpdateUI(self, event): event.arguments['Text'] = _(u'Delete Collection') """ this is enabled if any user item is selected in the sidebar """ event.arguments['Enable'] = (self.selectedItemToView is not None and getattr(self.selectedItemToView, 'renameable', True)) |
legendBorderX = self.xOffset - legendBorderWidth + 1 | legendBorderX = self.xOffset + 3 - legendBorderWidth | def DrawBackground(self, dc): styles = self.parent self._doDrawingCalculations() |
share.conduit.createTickets() | if publishType == 'collection': share.conduit.createTickets() elif publishType == 'freebusy': share.conduit.getTickets() if not share.conduit.ticketReadOnly: share.conduit.createTickets() | def publish(collection, account, classesToInclude=None, publishType = 'collection', attrsToExclude=None, displayName=None, updateCallback=None): """ Publish a collection, automatically determining which conduits/formats to use, and how many @type collection: pim.ContentCollection @param collection: The collection to p... |
pen = self.GetStatusPen(eventColors.outlineColor) | pen = self.GetStatusPen(outlineColor) | def Draw(self, dc, styles, brushOffset, selected): item = self._item itemRect = self._bounds gradientLeft, gradientRight, outlineColor, textColor = \ styles.blockItem.getEventColors(item, selected) if selected: brush = styles.brushes.GetGradientBrush(itemRect.x + brushOffset, itemRect.width, gradientLeft, gradientRig... |
if Globals.CPIAScript is not None: | try: script = Globals.CPIAScript except AttributeError: script = None if script is not None: | def RunScript(script=None): """ Run the current script. If no script is specified, pick up the global script option, and create a CPIA Script from that text. @@@DLD - split this into two methods; one for loading, one for running. @@@DLD - stop using globals; run whatever the repository says is the current script """ if... |
if not self.HasBodyAttribute(newAttribute): | if not self.HasBodyAttribute(attribute): | def AddBodyAttribute(self, attribute): if not self.HasBodyAttribute(newAttribute): list = self.GetBodyAttributes() list.append(newAttribute) self.SetBodyAttributes(list) |
list.append(newAttribute) | list.append(attribute) | def AddBodyAttribute(self, attribute): if not self.HasBodyAttribute(newAttribute): list = self.GetBodyAttributes() list.append(newAttribute) self.SetBodyAttributes(list) |
companion = self.getAttributeAspect(name, 'companion', default=None) value = PersistentDict(self, companion, **value) self._values[name] = value | if _attrDict is self._references: if old is None: self._references[name] = refDict = self._refDict(name) else: assert isinstance(old, RefDict) refDict = old refDict.extend(value.values()) value = refDict else: companion = self.getAttributeAspect(name, 'companion', default=None) value = PersistentDict(self, companion, *... | def setAttributeValue(self, name, value=None, _attrDict=None): """Create and/or set a Chandler attribute. |
try: errorText = unicode(err.__str__(), 'utf8', 'replace') except UnicodeEncodeError, e: logging.exception("Unable to convert Exception string text to Unicode") errorText = u"" | def catchErrors(self, err): """ This method captures all errors thrown while in the Twisted Reactor Thread as well as errors raised by non-Twisted code while in the Twisted Reactor Thread. catchErrors will print a stacktrace of C{failure.Failure} objects to the chandler.log. catchErrors also handles c{Exception}s but w... | |
if valChanged: | if valChanged and name != newTZname: | def getInsertIndex(name): insertIndex = 0 offset = getOffset(PyICU.ICUtzinfo.getInstance(name)) for n in wellKnowns: test_offset = getOffset(PyICU.ICUtzinfo.getInstance(n)) if offset < test_offset: break insertIndex += 1 |
rows = dlg.grid.GetSelectedRows() newTZ = None if len(rows) > 0: name = table.GetValue(rows[0], colData['name']['display']) if name != '': newTZ = PyICU.ICUtzinfo.getInstance(name) if name not in wellKnowns: wellKnowns.insert(getInsertIndex(name), name) | def getInsertIndex(name): insertIndex = 0 offset = getOffset(PyICU.ICUtzinfo.getInstance(name)) for n in wellKnowns: test_offset = getOffset(PyICU.ICUtzinfo.getInstance(n)) if offset < test_offset: break insertIndex += 1 | |
self.ScaleWidthToFit(True) | def __init__(self, parent, view): wx.grid.Grid.__init__(self, parent, -1) | |
if evt.GetCol() == colData['checked']['display']: | self.SelectRow(evt.GetRow()) checkedCol = colData['checked']['display'] if evt.GetCol() == checkedCol: | def OnCellLeftClick(self, evt): if evt.GetCol() == colData['checked']['display']: self.table.Toggle(evt.GetRow()) self.SelectRow(evt.GetRow()) |
self.SelectRow(evt.GetRow()) | if not self.table.GetValue(evt.GetRow(), checkedCol): self.ClearSelection() | def OnCellLeftClick(self, evt): if evt.GetCol() == colData['checked']['display']: self.table.Toggle(evt.GetRow()) self.SelectRow(evt.GetRow()) |
chandlerdb, queryparser | chandlerdb, queryparser, pyicu, pylucene, | def generateDocs(options, outputDir): if options.verbose: verbosity = 4 else: verbosity = 1 if sys.platform == 'cygwin': chandlerdb = 'release/bin/Lib/site-packages/chandlerdb' queryparser = 'release/bin/Lib/site-packages/QueryParser.py' elif sys.platform == 'darwin': chandlerdb = 'release/Library/Frameworks/Python.fr... |
(item not in allCollection or self.primaryCollection.itsUUID == allCollection.itsUUID)) ) | item not in allCollection)) | 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... |
fillColorLozengeType = 'SelectedGradientLeft' | fillColorLozengeType = 'UnselectedGradientRight' | def DrawCollectionSwatches(self, dc, topLeft, bottomRight, vertical=True): """ topLeft and bottomRight must be vectors (lists which can be added and subtracted like vectors) """ app_ns = schema.ns('osaf.app', self.item.itsView) sidebarCollections = app_ns.sidebarCollection allCollection = schema.ns('osaf.pim', self.ite... |
fillColorLozengeType = 'SelectedFYIGradientLeft' | fillColorLozengeType = 'OverlayGradientRight' | def DrawCollectionSwatches(self, dc, topLeft, bottomRight, vertical=True): """ topLeft and bottomRight must be vectors (lists which can be added and subtracted like vectors) """ app_ns = schema.ns('osaf.app', self.item.itsView) sidebarCollections = app_ns.sidebarCollection allCollection = schema.ns('osaf.pim', self.ite... |
input = file(largeBinary, 'r') | input = file(largeBinary, 'rb') | def testBZ2Compressed(self): khepburn = self.rep.find('//CineGuide/KHepburn') self.assert_(khepburn is not None) |
input = file(largeBinary, 'r') | input = file(largeBinary, 'rb') | def testZlibCompressed(self): khepburn = self.rep.find('//CineGuide/KHepburn') self.assert_(khepburn is not None) |
input = file(largeBinary, 'r') | input = file(largeBinary, 'rb') | def testUncompressed(self): khepburn = self.rep.find('//CineGuide/KHepburn') self.assert_(khepburn is not None) |
u.encode(sys.getfilesystemencoding())) | u.encode('utf8')) | def setUp(self): u = uw("profileDir_") self.path = os.path.join(os.path.dirname(__file__), u.encode(sys.getfilesystemencoding())) |
import M2Crypto.BN as BN profileDir = pattern.replace('*', '%s') % (BN.randfname(8)) from osaf.framework.certstore import utils utils.entropyInitialized = True | chars = string.letters + string.digits name = ''.join([chars[ord(c) % len(chars)] for c in os.urandom(8)]) profileDir = pattern.replace('*', '%s') %(name) | def _makeRandomProfileDir(pattern): import M2Crypto.BN as BN profileDir = pattern.replace('*', '%s') % (BN.randfname(8)) from osaf.framework.certstore import utils utils.entropyInitialized = True os.makedirs(profileDir, 0700) return profileDir |
if hasattr(self, "backgroundColor"): widget.SetBackgroundColour(self.backgroundColor.wxColor()) if hasattr(self, "foregroundColor"): widget.SetForegroundColour(self.foregroundColor.wxColor()) | widget.SetBackgroundColour(self.backgroundColor.wxColor()) widget.SetForegroundColour(self.foregroundColor.wxColor()) | def synchronizeColor(self, block): widget = block.widget if widget: if hasattr(self, "backgroundColor"): widget.SetBackgroundColour(self.backgroundColor.wxColor()) if hasattr(self, "foregroundColor"): widget.SetForegroundColour(self.foregroundColor.wxColor()) |
SendMail(fromAddr, mailtoAddr, startTime, buildName, "The build failed", | SendMail(fromAddr, mailtoAddr, startTime, buildName, "status", | 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, mailtoAddr, startTime, buildName, "Unit tests failed", | SendMail(fromAddr, mailtoAddr, startTime, buildName, "status", | 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... |
if attr == 'startTime': startTimeDelta = (value - self.startTime) self.rruleset.moveDatesAfter(recurrenceID, startTimeDelta) | startMidnight = datetime.combine(self.startTime.date(), time(0, tzinfo=self.startTime.tzinfo)) if attr in ('startTime', 'allDay'): startTimeDelta = zero_delta if attr == 'startTime': startTimeDelta = (value - self.startTime) elif self.allDay != value: if value == False: startTimeDelta = self.startTime - startMidnigh... | def changeThisAndFuture(self, attr=None, value=None): """Modify this and all future events.""" master = self.getMaster() first = master # Changed for no-THISANDFUTURE-style recurrenceID = self.recurrenceID isFirst = (recurrenceID == master.startTime) self._ignoreValueChanges = True if attr == 'startTime': startTimeDel... |
self.recurrenceID = self.startTime | if self.allDay: self.recurrenceID = startMidnight else: self.recurrenceID = self.startTime | def makeThisAndFutureMod(): # Changing occurrenceFor before changing rruleset is important, it # keeps the rruleset change from propagating inappropriately self.occurrenceFor = self if attr != 'rruleset': self.rruleset = self.rruleset.copy(cloudAlias='copying') self.rruleset.removeDates(datetime.__lt__, self.startTime)... |
contentView.deferDelete() | if not isinstance(shares[0], OneTimeShare): contentView.deferDelete() | def mergeFunction(code, item, attribute, value): # 'value' is the one from the *this* view # getattr(item, attribute) is the value from a different view |
dict((key, dict(refList._iterHistory(version, newVersion) for key, refList in value.iteritems()))) | dict((key, dict(refList._iterHistory(version, newVersion))) for key, refList in value.iteritems()) | def _collectChanges(self, view, flag, dirties, newChanges, changes, indexChanges, version, newVersion): |
endDateString = "%d-%d-%d" % (year1,month1,1) | endDateString = "%d-%d-%d" % (year1,month1,1) else: endDateString = "%d-%d-%d" % (year,month+1,1) | def testDateQuery(self): """ Test a date range in the query predicate """ tools.timing.reset() import osaf.contentmodel.tests.GenerateItems as GenerateItems |
newHeight = headerHeight + previewHeight numMonths = 0 | newHeight = monthHeight + headerHeight + previewHeight numMonths = 1 | def AdjustSplit(self, splitter, height): headerHeight = self.GetHeaderSize().height previewWidget = Block.Block.findBlockByName("PreviewArea").widget previewHeight = previewWidget.GetSize()[1] monthHeight = self.GetMonthSize().height newHeight = headerHeight + previewHeight numMonths = 0 while ( ( (newHeight + 0.5 * m... |
def setUp(self): self.tzInfoItem = TimeZoneInfo.get() | def setUp(self): self.tzInfoItem = TimeZoneInfo.get() | |
return event | return event.itsItem | def GenerateCalendarEvent(view, days=30, tzinfo=ICUtzinfo.floating): event = Calendar.CalendarEvent(itsView=view) event.summary = random.choice(HEADLINES) if TEST_I18N: event.summary = uw(event.summary) # Choose random days, hours startDelta = timedelta(days=random.randint(0, days), hours=random.randint(0, 24)) now ... |
message.triageStatus = randomEnum(pim.TriageEnum) return message | message.itsItem.triageStatus = randomEnum(pim.TriageEnum) return message.itsItem | def GenerateMailMessage(view, tzinfo=None): global M_FROM message = Mail.MailMessage(itsView=view) body = M_TEXT outbound = random.randint(0, 1) type = random.randint(1, 8) numTo = random.randint(1, 3) if M_FROM is None: M_FROM = GenerateCalendarParticipant(view) message.fromAddress = M_FROM for num in ... |
return task | return task.itsItem | def GenerateTask(view, tzinfo=None): """ Generate one Task item """ task = pim.Task(itsView=view) delta = timedelta(days=random.randint(0, 5), hours=random.randint(0, 24)) task.dueDate = datetime.today().replace(tzinfo=tzinfo) + delta task.summary = random.choice(TITLES) if TEST_I18N: task.summary = uw(task.summary) ... |
pass | unittest.main() | def testAppend(self): |
def emulate_sidebarClick(cls, sidebar, cellName, double=False): ''' Process a left click on the given cell in the given sidebar''' | def emulate_sidebarClick(cls, sidebar, cellName, double=False, overLay=False): ''' Process a left click on the given cell in the given sidebar if overLay is true the overLay disk next to the collection name is checked otherwise the collection is selected''' xOffset = 24 if overLay: xOffset=3 | def emulate_sidebarClick(cls, sidebar, cellName, double=False): ''' Process a left click on the given cell in the given sidebar''' # for All, In, Out, Trash collection find by item rather than itemName chandler_collections = {"All":schema.ns('osaf.pim', Globals.mainViewRoot).allCollection, "Out":schema.ns('osaf.pim', G... |
cls.emulate_click(gw, x=cellRect.GetX()+3, y=cellRect.GetY()+3, double=double) | cls.emulate_click(gw, x=cellRect.GetX()+xOffset, y=cellRect.GetY()+3, double=double) | def emulate_sidebarClick(cls, sidebar, cellName, double=False): ''' Process a left click on the given cell in the given sidebar''' # for All, In, Out, Trash collection find by item rather than itemName chandler_collections = {"All":schema.ns('osaf.pim', Globals.mainViewRoot).allCollection, "Out":schema.ns('osaf.pim', G... |
contact.displayName = "Alexis" | contact.contactName.firstName = "Alexis" | def testNotifyFor(self): """ Test query notification """ import osaf.contentmodel.tests.GenerateItems as GenerateItems import osaf.contentmodel.ItemCollection as ItemCollection |
contact.displayName = "Alexis" | contact.contactName.firstName = "Alexis" | def testNotifyUnion(self): """ Test notification of union query """ import osaf.contentmodel.tests.GenerateItems as GenerateItems |
nearFutureSeconds=15 | def getstack(): stack = traceback.extract_stack(limit=5)[:-2] return "".join(traceback.format_list(stack)) | |
nearFutureSeconds=3 | def getstack(): stack = traceback.extract_stack(limit=5)[:-2] return "".join(traceback.format_list(stack)) | |
if item not in self.share.items: self.share.items.append(item) | self.share.items.append(item) | def __conditionalPutItem(self, item): """ Put an item if it's not on the server or is out of date """ |
if not hasattr(self, '_notifications'): return | def closeView(self): """ Close this repository view. | |
def HandleDragEnd(self, runHandler=True): | def HandleDragEnd(self): | def HandleDragEnd(self, runHandler=True): if self._dragCanceled: return if self._dragStarted: self._dragTimer.Stop() del self._dragTimer if runHandler: self.dragEndHandler() self._window.ReleaseMouse() |
if runHandler: self.dragEndHandler() | self.dragEndHandler() | def HandleDragEnd(self, runHandler=True): if self._dragCanceled: return if self._dragStarted: self._dragTimer.Stop() del self._dragTimer if runHandler: self.dragEndHandler() self._window.ReleaseMouse() |
self.dragState.HandleDragEnd(runHandler=False) self.dragState = None | def OnMouseEvent(self, event): """ Handles mouse events, calls overridable methods related to: 1. Selecting an item 2. Dragging/moving an item 3. Resizing an item """ # ignore entering and leaving events if (event.Entering() or event.Leaving()): event.Skip() return | |
osAvgs = {'win': {}, 'osx': {}, 'linux': {}} def average(values): | osMedians = {'win': {}, 'osx': {}, 'linux': {}} def median(values): | def platforms2GraphData(platforms, acceptable): """ Convert the platforms structure and acceptable value into a list of tuples needed by drawGraph function. @return: [(x1, winy1, osxy1, linuxy1, acceptabley1), ...], (win, osx, linux) """ ret = [] osAvgs = {'win': {}, 'osx': {}, 'linux': {}} def average(values): """ ... |
Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because | Return the median of the values, but ignore 0s as they signify a non-value. Also, None is returned if the median would be 0, because | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
avg = None | median = None | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
s = sum(values) if s == 0: avg = None | if len(values) == 0: median = None | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
avg = s/(len(values)*1.0) return avg | values.sort() median = values[len(values)/2] return median | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
osAvgs[platform][lastRev] = average(values) | osMedians[platform][lastRev] = median(values) | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
osAvgs[platform][rev] = average(values) | osMedians[platform][rev] = median(values) | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
for value in osAvgs['win'].itervalues(): | for value in osMedians['win'].itervalues(): | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
revs.extend(osAvgs['win'].keys()) | revs.extend(osMedians['win'].keys()) | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
for value in osAvgs['osx'].itervalues(): | for value in osMedians['osx'].itervalues(): | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
revs.extend(osAvgs['osx'].keys()) | revs.extend(osMedians['osx'].keys()) | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
for value in osAvgs['linux'].itervalues(): | for value in osMedians['linux'].itervalues(): | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
revs.extend(osAvgs['linux'].keys()) | revs.extend(osMedians['linux'].keys()) | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
item += (osAvgs['win'].get(rev, None), ) | item += (osMedians['win'].get(rev, None), ) | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
item += (osAvgs['osx'].get(rev, None), ) | item += (osMedians['osx'].get(rev, None), ) | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
item += (osAvgs['linux'].get(rev, None), ) | item += (osMedians['linux'].get(rev, None), ) | def average(values): """ Return the average of the values, but ignore 0s as they signify a non-value. Also, None is returned if the average would be 0, because None is a special value that is ignored by PyChart. """ if len(values) == 0: avg = None else: values = [x for x in values if x != 0] # Skip 0s s = sum(values) i... |
indexpage.append('<h2>%s</h2>\n' % testkey) | indexpage.append('<h2 id="%s">%s</h2>\n' % (testkey, testkey)) | def generateDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
msg += "tinderbox: starttime: %s\n" % nowTime | msg += "tinderbox: starttime: %s\n" % startTime | def run(options): treeName = options.tree buildName = options.build fromAddr = "builds@osafoundation.org" toAddr = options.toAddr toDomain = options.toDomain smtpOutbound = "smtp.osafoundation.org" logFile = options.logfile logPath = options.logpath status = options.status logData ... |
self._conflictDepth = self.FindGapInSequence(parentDepths) | self._conflictDepth = self.FindFirstGapInSequence(parentDepths) | def CalculateConflictDepth(self): if not self._parentConflicts: return 0 # We'll find out the depth of all our parents, and then # see if there's an empty gap we can fill # this relies on parentDepths being sorted, which # is true because the conflicts are added in # the same order as the they appear in the calendar p... |
self.SetWindowStyle(self.GetWindowStyle() | wx.SUNKEN_BORDER) | def __init__(self, *arguments, **keywords): """ Giant hack. Calling event.GetEventObject in OnShow of application, while the object is being created cause the object to get the wrong type because of a "feature" of SWIG. So we need to avoid OnShows in this case. """ oldIgnoreSynchronizeWidget = wx.GetApp().ignoreSynchro... | |
def subscribe(self, callbackItem, callbackMethodName): | def subscribe(self, callbackItem = None, callbackMethodName = None): | def subscribe(self, callbackItem, callbackMethodName): """ This query should subscribe to repository changes """ self._callbacks [callbackItem.itsUUID] = callbackMethodName log.debug("RepoQuery<>.subscribe(): %s" % (self.queryString)) self.__rep.addNotificationCallback(self.queryCallback) |
self._callbacks [callbackItem.itsUUID] = callbackMethodName | if callbackItem is not None: self._callbacks [callbackItem.itsUUID] = callbackMethodName | def subscribe(self, callbackItem, callbackMethodName): """ This query should subscribe to repository changes """ self._callbacks [callbackItem.itsUUID] = callbackMethodName log.debug("RepoQuery<>.subscribe(): %s" % (self.queryString)) self.__rep.addNotificationCallback(self.queryCallback) |
self.delete() | if os.path.exists(self.dbHome): self.delete() | def open(self, **kwds): |
if event.LeftIsDown(): | if event.Dragging() and event.LeftIsDown(): | def OnMouseEvents(self, event): # trigger a Drag and Drop if we're a single line and all selected if self.IsSingleLine() and event.LeftDown(): selStart, selEnd = self.GetSelection() if selStart==0 and selEnd>1 and selEnd==self.GetLastPosition(): if event.LeftIsDown(): # still down? # have we had the focus for a little ... |
staticControl.Bind(wx.EVT_LEFT_DOWN, self.OnStaticClick) | staticControl.Bind(wx.EVT_LEFT_UP, self.OnStaticClick) | def __init__(self, parent, id, title=u'', position=wx.DefaultPosition, size=wx.DefaultSize, maxLineCount=1, style=0, staticControlDelegate=None, *args, **keys): super(AETypeOverTextCtrl, self).__init__(parent, id) staticSize = keys['staticSize'] del keys['staticSize'] self.hideLoc = (-100,-100) self.showLoc = (0,0) sel... |
clipRect = wx.Rect(cx,cy,cwidth,cheight) | clipRect = (cx,cy,cwidth,cheight) | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item if item.isDeleted(): return |
if ('__WXMAC__' in wx.PlatformInfo): margin = 5 else: margin = 0 | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item if item.isDeleted(): return | |
textRect = (x,y,width, | textRect = (x,y,width - margin, | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item if item.isDeleted(): return |
dc.SetClippingRect(clipRect) | dc.SetClippingRegion(*clipRect) | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item if item.isDeleted(): return |
roundRect = wx.Rect(*rect) | (x,y,width,height) = rect | def DrawEventRectangle(self, dc, rect, hasLeftRounded=False, hasTopRightRounded=True, hasBottomRightRounded=True, clipRightSide=False): """ Make a rounded rectangle, optionally specifying if the top and bottom right side of the rectangle should have rounded corners. Uses clip rect tricks to make sure it is drawn correc... |
roundRect.x -= radius roundRect.width += radius | x -= radius width += radius | def DrawEventRectangle(self, dc, rect, hasLeftRounded=False, hasTopRightRounded=True, hasBottomRightRounded=True, clipRightSide=False): """ Make a rounded rectangle, optionally specifying if the top and bottom right side of the rectangle should have rounded corners. Uses clip rect tricks to make sure it is drawn correc... |
roundRect.width += radius; | width += radius; | def DrawEventRectangle(self, dc, rect, hasLeftRounded=False, hasTopRightRounded=True, hasBottomRightRounded=True, clipRightSide=False): """ Make a rounded rectangle, optionally specifying if the top and bottom right side of the rectangle should have rounded corners. Uses clip rect tricks to make sure it is drawn correc... |
roundRect.height += radius | height += radius | def DrawEventRectangle(self, dc, rect, hasLeftRounded=False, hasTopRightRounded=True, hasBottomRightRounded=True, clipRightSide=False): """ Make a rounded rectangle, optionally specifying if the top and bottom right side of the rectangle should have rounded corners. Uses clip rect tricks to make sure it is drawn correc... |
roundRect.y -= radius roundRect.height += radius | y -= radius height += radius | def DrawEventRectangle(self, dc, rect, hasLeftRounded=False, hasTopRightRounded=True, hasBottomRightRounded=True, clipRightSide=False): """ Make a rounded rectangle, optionally specifying if the top and bottom right side of the rectangle should have rounded corners. Uses clip rect tricks to make sure it is drawn correc... |
dc.DrawRoundedRectangleRect(roundRect, radius) | dc.DrawRoundedRectangle(x,y,width,height,radius) | def DrawEventRectangle(self, dc, rect, hasLeftRounded=False, hasTopRightRounded=True, hasBottomRightRounded=True, clipRightSide=False): """ Make a rounded rectangle, optionally specifying if the top and bottom right side of the rectangle should have rounded corners. Uses clip rect tricks to make sure it is drawn correc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.