rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
line += '<td class="number"><span class="%s">%2.2fs</span></td>' % (timeClass, avg) | line += '<td class="number"><span class="%s">%2.2fs</span></td>' % (timeClass, current) | def _generateSummaryDetailLine(self, platforms, testkey, enddate, testDisplayName, previousTargets): line = '<tr><td><a href="detail_%s.html#%s" target="_new">%s</a></td>' % (enddate, testkey, testDisplayName) graph = [] if testkey in self.SummaryTargets.keys(): targetAvg = self.SummaryTargets[testkey] else: targetAv... |
line += '<td>%01.2fs</td>' % variance | line += '<td>%01.2fs</td>' % stdDev | def _generateSummaryDetailLine(self, platforms, testkey, enddate, testDisplayName, previousTargets): line = '<tr><td><a href="detail_%s.html#%s" target="_new">%s</a></td>' % (enddate, testkey, testDisplayName) graph = [] if testkey in self.SummaryTargets.keys(): targetAvg = self.SummaryTargets[testkey] else: targetAv... |
revisions = { 'osx': ['', ''], 'linux': ['', ''], 'win': ['', ''], } previousRun = { 'osx': 0, 'linux': 0, 'win': 0, } | revisions = { 'osx': ['', ''], 'linux': ['', ''], 'win': ['', ''], } currentValue = { 'osx': 0, 'linux': 0, 'win': 0, } previousValue = { 'osx': 0, 'linux': 0, 'win': 0, } | def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
platforms = { 'osx': { 'var': 0, | platforms = { 'osx': { 'stddev': 0, | def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
'linux': { 'var': 0, | 'linux': { 'stddev': 0, | def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
'win': { 'var': 0, | 'win': { 'stddev': 0, | def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
print "%s %s %s %s %s %s %f" % (testDisplayName, platformkey, buildkey, datekey, hour, revision, datapoint[DP_AVERAGE]) (v, n, avg) = self.variance(platformdata['values']) page.append('<!-- build: %s avg: %02.5f count: %d variance: %02.5f -->\n' % (buildkey, avg, n, v)) | if self._options['debug']: print "%s %s %s %s %s %s %f" % (testDisplayName, platformkey, buildkey, datekey, hour, revision, datapoint[DP_AVERAGE]) (v, n, avg) = self.standardDeviation(platformdata['values']) page.append('<!-- build: %s avg: %02.5f count: %d stddev: %02.5f -->\n' % (buildkey, avg, n, v)) | def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
detail.append('<p>%d items in days sample for an median of %02.5f and a variance of %02.5f</p>\n' % (n, avg, v)) platformdata['var'] = v | detail.append('<p>%d items in days sample for an median of %02.5f and a standard deviation of %02.5f</p>\n' % (n, avg, v)) platformdata['stddev'] = v | def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
revisions[platformkey] = [revision, revision] previousRun[platformkey] = dateitem[k_hours[-1]][0][DP_AVERAGE] (summaryline, graphdata) = self._generateSummaryDetailLine(platforms, testkey, enddate, testDisplayName, previousRun) | revisions[platformkey] = [revision, revision] p = len(k_hours) if n > 1: currentValue[platformkey] = dateitem[k_hours[p-1]][0][DP_AVERAGE] previousValue[platformkey] = dateitem[k_hours[p-1]][0][DP_AVERAGE] else: currentValue[platformkey] = dateitem[k_hours[p-1]][0][DP_AVERAGE] previousValue[platformkey] = dateitem[k... | def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
page.append('The original <a href="variance.html">variance page</a> shows the other test \n') page.append('data that is captured and the variance data for the last 7 days</p>\n') | page.append('The original <a href="stddev.html">standard deviation page</a> shows the other test \n') page.append('data that is captured and the standard deviation data for the last 7 days</p>\n') | def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
self.generateVarianceDetailPage('variance.html', tests, startdate, enddate) | self.generateDetailPage('stddev.html', tests, startdate, enddate) | def generateOutput(self, tests, startdate, enddate): self.generateVarianceDetailPage('variance.html', tests, startdate, enddate) self.generateSummaryPage('index.html', tests, startdate, enddate) |
item, attributeName = grid.GetElementValue (row, column) | def EndEdit (self, row, column, grid): value = self.delegate.GetControlValue (self.control) if value == self.initialValue: changed = False # @@@ For now we do not want to allow users to blank out fields. This should eventually be # replaced by proper editor validation. elif value.strip() == '': changed = False else: ... | |
self.logger.addHandler(logging.StreamHandler()) | addHandler() | def _init(self, **kwds): |
('Green', (u'Green'), 120), | ('Green', _(u'Green'), 120), | def setValues(self, **kwds): |
newRowSelection = min(newRowSelection, totalItems - 1) self.blockItem.postEventByName("SelectItemBroadcast", {'item':contents[newRowSelection]}) | self.wxSynchronizeWidget() if totalItems > 0: newRowSelection = min(newRowSelection, totalItems - 1) self.blockItem.postEventByName("SelectItemBroadcast", {'item':contents[newRowSelection]}) | def DeleteSelection (self): topLeftList = self.GetSelectionBlockTopLeft() bottomRightList = self.GetSelectionBlockBottomRight() """ Clear the selection before removing the elements from the collection otherwise our delegate will get called asking for deleted items """ self.ClearSelection() # build up a list of selecti... |
allDay = Block.findBlockByName('AllDayEventsCanvas') splitter.widget.MoveSash(allDay.widget.collapsedHeight) | splitter.widget.MoveSash( splitter.size.height * splitter.splitPercentage ) | def wxSynchronizeWidget(self): super (wxBoxContainer, self).wxSynchronizeWidget () |
dt = dt.astimezone(localtime).replace(tzinfo=None) | try: dt = dt.astimezone(localtime).replace(tzinfo=None) except ValueError: pass | def importProcess(self, text, extension=None, item=None): # the item parameter is so that a share item can be passed in for us # to populate. |
return item.getAttributeValue(self._translationDict[match.group(0)]) | return item.getAttributeValue(self._translationDict[match.group(0)], default='') | def translate(match): return item.getAttributeValue(self._translationDict[match.group(0)]) |
dc.SetFont(styles.eventLabelFont) DrawWrappedText(dc, item.displayName, textRect) | dc.SetFont(styles.eventLabelFont) if selected: proxy = RecurrenceDialog.getProxy(u'ui', item) DrawWrappedText(dc, proxy.displayName, textRect) else: DrawWrappedText(dc, item.displayName, textRect) | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item if item.isDeleted(): return |
note = pim.Note(itsView=view) note.body = note.getAttributeAspect('body', 'type').makeValue(body, indexed=True) | note = pim.Note(itsView=view, displayName=title, body=body) pim.EventStamp(note).add() event = pim.EventStamp(note) event.startTime = datetime.datetime.now(tz=ICUtzinfo.floating) event.duration = datetime.timedelta(minutes=60) event.anyTime = False allCollection = schema.ns('osaf.pim', view).allCollection allCollection... | def xmlrpc_note(self, title, body, viewName=None): view = getServletView(self.repositoryView.repository, viewName) view.refresh() note = pim.Note(itsView=view) note.body = note.getAttributeAspect('body', 'type').makeValue(body, indexed=True) view.commit() return "OK" # ??? |
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... |
if share.sharer.itsPath == "//userdata/me": | if share.sharer is not None and str(share.sharer.itsPath) == "//userdata/me": | def getButtonState (self, buttonName, item): if buttonName == u'Icon': if item in self.checkedItems: return 'Checked' elif buttonName == u'SharingIcon': share = Sharing.getShare(item) if share is not None: if share.sharer.itsPath == "//userdata/me": return "Upload" else: return "Download" return "" |
hardhatlib.executeCommand( buildenv, info['name'], [buildenv['make']], "Making launcher programs") if buildenv['version'] == 'release': | if buildenv['version'] == 'release': hardhatlib.executeCommand( buildenv, info['name'], [buildenv['make']], "Making launcher programs") | def build(buildenv): if buildenv['os'] == 'posix': os.chdir("distrib/linux/launcher") hardhatlib.executeCommand( buildenv, info['name'], [buildenv['make']], "Making launcher programs") if buildenv['version'] == 'release': hardhatlib.copyFile("chandler_bin", buildenv['root'] + \ os.sep + "release") hardhatlib.copyFile(... |
elif event.Dragging(): """ Clip mouse position to the scrolling window's bounds """ boundsX, boundsY = self.GetVirtualSizeTuple() if x < 0: x = 0 if x > boundsX: x = boundsX if y < 0: y = 0 if y > boundsY: y = boundsY deltaX = x - self.dragStart.x deltaY = y - self.dragStart.y if deltaX >= 0: left = self.dragStart.... | elif hasattr (self, 'dragStart'): if event.Dragging(): """ Clip mouse position to the scrolling window's bounds """ boundsX, boundsY = self.GetVirtualSizeTuple() if x < 0: x = 0 if x > boundsX: x = boundsX if y < 0: y = 0 if y > boundsY: y = boundsY deltaX = x - self.dragStart.x deltaY = y - self.dragStart.y if del... | 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: self.dragCreateDrawableObject.SizeDrag (dragRect, self.dragStart, wxPoint (x, y)) elif event.ButtonUp(): if hasattr (self, 'dragCreateDrawableObject'): del self.dragCreateDrawableObject self.ReleaseMouse() return true | 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 (... | |
eventsForNamedDispatch = self.widget.eventsForNamedDispatch | eventsForNamedDispatch = self.eventsForNamedDispatch | def onDestroyWidget (self): """ Called just before a widget is destroyed. It is the opposite of instantiateWidget. """ try: contents = self.contents except AttributeError: pass else: try: unsubscribe = getattr (type (contents), "unsubscribe") except AttributeError: pass else: unsubscribe (contents, self) try: eventsFor... |
filePath = unicode(os.path.join(os.path.dirname(siblingPath), fileName)) | filePath = unicode(os.path.join(os.path.dirname(siblingPath), fileName), sys.getfilesystemencoding()) | def set_file(self, fileName, siblingPath): fileName = fileName.encode(sys.getfilesystemencoding()) filePath = unicode(os.path.join(os.path.dirname(siblingPath), fileName)) self.bodyString = self.file_contents(filePath) self.filePath = filePath |
name, _(u"Python files|*.py|All files (*.*)|*.*"), | name, _(u"Python files|*.py|") + _(u"All files (*.*)|*.*"), | def onSaveFileEvent(self, event): """ Open a file to associate with this script, or save an existing script to a file. """ if not self._item.bodyString: # no script body, open and overwrite existing model data title = _(u"Open a script file") message = _(u"Open an existing script file, or choose a name\n" "for a new fi... |
endWxDate = startWxDate + wx.DateSpan.Month() + wx.DateSpan.Month() + wx.DateSpan.Month() | endWxDate = startWxDate + wx.DateSpan.Month() * 3 | def _doDrawing(self): |
startWxDate += wx.DateSpan.Day() startDate += timedelta(days=1) | startWxDate += wxDay startDate += timeDeltaDay | 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 ... |
dragRect = wxRect (top, left, width, height) | dragRect = wxRect (left, top, width, height) | 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 (... |
if element.kind == RSSData.ZaoBaoParcel.getRSSChannelKind(): return ['',''] displayName = element.getAttributeValue('displayName', default='<Untitled>') date = element.getAttributeValue('date', default='') if date != '': date = date.Format('%B %d, %Y %I:%M %p') return [displayName, str(date)] | return GetElementCellValues(element) | def ElementCellValues(self, element): if element.kind == RSSData.ZaoBaoParcel.getRSSChannelKind(): return ['',''] displayName = element.getAttributeValue('displayName', default='<Untitled>') date = element.getAttributeValue('date', default='') if date != '': date = date.Format('%B %d, %Y %I:%M %p') |
if element == RSSData.ZaoBaoParcel.getRSSChannelKind(): return ['',''] displayName = element.getAttributeValue('displayName', default='<Untitled>') date = element.getAttributeValue('date', default='') if date != '': date = date.Format('%B %d, %Y %I:%M %p') return [displayName, str(date)] | return GetElementCellValues(element) | def ElementCellValues(self, element): if element == RSSData.ZaoBaoParcel.getRSSChannelKind(): return ['',''] |
itemString += "<ul>" | itemString = "<ul>" | def Render_list(self, name, value): itemString += "<ul>" for j in value: try: itemString += ('<li><span class="editable">%s</span> <a href="%s">%s</a></li>\n' % (j.itsName, toLink(j.itsPath), j.itsPath)) except: itemString += "<li>%s (%s)</li>\n" % (clean(j), clean(type(j))) return itemString |
super(ChandlerServerHandle, self).__init__(host=host, port=port, username=username, password=password, useSSL=useSSL) if useSSL and repositoryView != None: self.factory.startTLS = True if self.factory.sslContextFactory == None: verifyCallback = ssl._VerifyCallback(repositoryView) self.factory.getContext = lambd... | self.resourcesByPath = {} self.factory = ChandlerHTTPClientFactory() self.factory.protocol = zanshin.webdav.WebDAVProtocol self.factory.startTLS = useSSL self.factory.host = host self.factory.port = port self.factory.username = username self.factory.password = password self.factory.retries = zanshin.webdav.DEFAULT_RET... | def __init__(self, host=None, port=None, username=None, password=None, useSSL=False, repositoryView=None): super(ChandlerServerHandle, self).__init__(host=host, port=port, username=username, password=password, useSSL=useSSL) if useSSL and repositoryView != None: self.factory.startTLS = True # Starts SSL immediately.... |
collectionList = [theItem for theItem in sidebar.contents if theItem in sidebar.checkedItems] if item not in collectionList: collectionList.insert (0, item) | collectionList = [theItem for theItem in sidebar.contents if (theItem in sidebar.checkedItems) and (theItem is not item)] collectionList.insert (0, item) """ tupleList is sorted so we always end up with on collection for any order of collections in the source """ | def _mapItemToCacheKeyItem(self, item): key = item rerender = False if isinstance (item, ItemCollection.ItemCollection): sidebar = Block.Block.findBlockByName ("Sidebar") collectionList = [theItem for theItem in sidebar.contents if theItem in sidebar.checkedItems] if item not in collectionList: collectionList.insert (0... |
rerender = key.source.first() != item key.source.placeItem (item, None) | else: """ Check to see if we need to reorder the source list """ for new, old in map (None, key.source, collectionList): if new is not old: key.source = collectionList rerender = True | def _mapItemToCacheKeyItem(self, item): key = item rerender = False if isinstance (item, ItemCollection.ItemCollection): sidebar = Block.Block.findBlockByName ("Sidebar") collectionList = [theItem for theItem in sidebar.contents if theItem in sidebar.checkedItems] if item not in collectionList: collectionList.insert (0... |
result += "<%s class='%s' uuid='%s'>\n" % (item.itsKind.itsName, classes, item.itsUUID) | result += "<%s %sclass='%s' uuid='%s'>\n" % (item.itsKind.itsName, versionString, classes, item.itsUUID) | def exportProcess(self, item, depth=0, items=None): |
if ((item.startTime >= date) and (item.startTime < nextDate)): | if ((item.startTime >= date) and (item.startTime < nextDate) and item.duration): | def getItemsByDate(self, date): """ Convenience method to look for the items in the block's contents that appear on the given date. @@@ We may push this work down into ItemCollections and/or Queries. |
if selections[0]: trust |= TRUST_AUTHENTICITY if selections[1]: trust |= TRUST_SITE | for sel in selections: if sel == 0: trust |= TRUST_AUTHENTICITY if sel == 1: trust |= TRUST_SITE | def ImportCertificate(repView, cpiaView): dlg = wx.FileDialog(wx.GetApp().mainFrame, "Choose a certificate to import", "", "", "PEM files|*.pem;*.crt|All files (*.*)|*.*", wx.OPEN | wx.HIDE_READONLY) if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() dlg.Destroy() if path == '': return else: dlg.Destroy() return try... |
(datetime(2005,3,8,11,50), anEvent, regularReminder)) | (datetime(2005,3,8,11,50, tzinfo = PyICU.ICUtzinfo.getDefault()), anEvent, regularReminder)) | def testReminders(self): # Make an event and add a reminder to it. anEvent = CalendarEvent("calendarEventItem", view=self.rep.view, startTime=datetime(2005,3,8,12,00), duration=timedelta(hours=1), allDay=False, anyTime=False) regularReminder = anEvent.makeReminder(timedelta(minutes=-10)) # Make sure it all got connect... |
if not os.path.isdir(profileDir): if os.path.isdir(dataDir): try: os.makedirs(profileDir, 0700) except: profileDir = chandlerDirectory else: | pattern = '%s%s*.default' % (profileDir, os.sep) try: import glob profileDir = glob.glob(pattern)[0] except IndexError: try: profileDir = _makeRandomProfileDir(pattern) except: | def locateProfileDir(chandlerDirectory): """ Locate the Chandler repository. The location is determined either by parameters, or if not specified, by the presence of a .chandler directory in the users home directory. """ # if a profileDir is specified then just use it if application.Globals.options.profileDir: applicat... |
except: profileDir = chandlerDirectory | def locateProfileDir(chandlerDirectory): """ Locate the Chandler repository. The location is determined either by parameters, or if not specified, by the presence of a .chandler directory in the users home directory. """ # if a profileDir is specified then just use it if application.Globals.options.profileDir: applicat... | |
localChanges = True etag = item.getAttributeValue('etag', default=None) if etag: davETag = dav.etag | if item.sharedVersion == -1: localChanges = True else: localChanges = HistoryChecker(item).isDirty() try: davItem = DAVItem.DAVItem(dav) davETag = davItem.etag etag = item.getAttributeValue('etag', default=None) | def syncItem(dav, item): # changes flags needsPut = False localChanges = False serverChanges = False # see if the local version has changed by comparing the last shared version # with the item's current version if item.sharedVersion != item._version: localChanges = True etag = item.getAttributeValue('etag', default=N... |
else: | except Dav.NotFound: | def syncItem(dav, item): # changes flags needsPut = False localChanges = False serverChanges = False # see if the local version has changed by comparing the last shared version # with the item's current version if item.sharedVersion != item._version: localChanges = True etag = item.getAttributeValue('etag', default=N... |
davItem = DAVItem.DAVItem(dav) | def syncItem(dav, item): # changes flags needsPut = False localChanges = False serverChanges = False # see if the local version has changed by comparing the last shared version # with the item's current version if item.sharedVersion != item._version: localChanges = True etag = item.getAttributeValue('etag', default=N... | |
DAV(durl).put(i) | def syncToServer(dav, item): from Dav import DAV url = unicode(dav.url) # set them here, even though we have to set them again later item.sharedVersion = item._version kind = item.itsKind # build a giant property string and then do a PROPPATCH # we don't ever want to actually change the UUID value on the server # s... | |
"TestNewMail.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) QAUITestAppLib.App_ns.itsView.check() | |
self.choiceAB.SetSelection( ch.GetSelectedItem() - 1 ) | self.choiceAB.SetSelection( self.ch2.GetArrowButtonStyle( ch.GetSelectedItem() ) ) | def OnClickColumnHeader( self, event ): ch = event.GetEventObject() self.l0.SetLabel( "(%d): clicked - selected (%ld)" %(event.GetId(), ch.GetSelectedItem()) ) if (ch.GetId() == self.baseCntlID + 1): self.choiceAB.SetSelection( ch.GetSelectedItem() - 1 ) # self.log.write( "Click! (%ld)\n" % event.GetEventType() ) |
lastColumnWidth = lastColumnWidth - wx.SystemSettings_GetMetric(wx.SYS_VSCROLL_X) | lastColumnWidth = lastColumnWidth - wx.SystemSettings_GetMetric(wx.SYS_VSCROLL_X) - 1 | def OnSize(self, event): if not wx.GetApp().ignoreSynchronizeWidget: size = event.GetSize() widthMinusLastColumn = 0 |
remaining = remaining - wx.SystemSettings_GetMetric(wx.SYS_VSCROLL_X) | remaining = remaining - wx.SystemSettings_GetMetric(wx.SYS_VSCROLL_X) - 1 | def wxSynchronizeWidget(self, **hints): """ A Grid can't easily redisplay its contents, so we write the following helper function to readjust everything after the contents change """ #Trim/extend the control's rows and update all values |
exclusions = { 'other':( "TestCalView.py", ), 'mac':( ), 'windows':( ), 'all':( "TestAllDayEvent.py", "TestDates.py", "TestRecurrenceImporting.py", ) } | exclusions = { 'other':( "TestCalView.py", ), 'mac':( ), 'windows':( ), 'all':( "TestAllDayEvent.py", "TestDates.py", "TestRecurrenceImporting.py", "TestNewEvent.py", "TestNewCollNoteStampMulti.py", ) } | def run_tests(tests): for filename in tests: execfile(os.path.join(functional_dir, filename)) |
item = None if grid.GetElementCount() != 0: row = grid.GetGridCursorRow() itemIndex = grid.RowToIndex(row) if itemIndex != -1: item = grid.blockItem.contents [itemIndex] | item = grid.blockItem.contents.getFirstSelectedItem() | def GetColLabelValue (self, column): grid = self.GetView() item = None if grid.GetElementCount() != 0: row = grid.GetGridCursorRow() itemIndex = grid.RowToIndex(row) if itemIndex != -1: item = grid.blockItem.contents [itemIndex] |
selectionRanges = self.blockItem.contents.getSelectionRanges() gridTable = self.GetTable() for indexStart, indexEnd in selectionRanges: rowStart = self.IndexToRow(indexStart) rowEnd = self.IndexToRow(indexEnd) | for rowStart, rowEnd in self.SelectedRowRanges(): | def InvalidateSelection (self): lastRow = self.GetNumberCols() - 1 selectionRanges = self.blockItem.contents.getSelectionRanges() gridTable = self.GetTable() for indexStart, indexEnd in selectionRanges: rowStart = self.IndexToRow(indexStart) rowEnd = self.IndexToRow(indexEnd) dirtyRect = wx.Rect() dirtyRect.SetTopLeft... |
contents.setSelectionRanges ([]) firstItemIndex = -1 for indexStart, indexEnd in self.SelectedIndexRanges(): if firstItemIndex == -1 or firstItemIndex > indexStart: firstItemIndex = indexStart contents.addSelectionRange ((indexStart, indexEnd)) item = None if firstItemIndex != -1: item = blockItem.contents[firstIt... | firstRow = event.GetTopRow() lastRow = event.GetBottomRow() indexStart = self.RowToIndex(firstRow) indexEnd = self.RowToIndex(lastRow) postSelection = True if event.Selecting(): contents.addSelectionRange((indexStart, indexEnd)) else: contents.removeSelectionRange((indexStart, indexEnd)) if (firstRow == 0 and lastRow ... | def OnRangeSelect(self, event): """ Synchronize the grid's selection back into the row """ blockItem = self.blockItem # Ignore notifications that arrise as a side effect of # changes to the selection blockItem.stopNotificationDirt() try: # map row ranges to index ranges contents = self.blockItem.contents contents.setSe... |
if (item is not None or event.Selecting() or event.ControlDown()): blockItem.PostSelectItems([item]) | blockItem.PostSelectItems() | def OnRangeSelect(self, event): """ Synchronize the grid's selection back into the row """ blockItem = self.blockItem # Ignore notifications that arrise as a side effect of # changes to the selection blockItem.stopNotificationDirt() try: # map row ranges to index ranges contents = self.blockItem.contents contents.setSe... |
self.EditIfNecessary() def EditIfNecessary(self): | def wxSynchronizeWidget(self, useHints=False): """ A Grid can't easily redisplay its contents, so we write the following helper function to readjust everything after the contents change """ | |
if (selectedItemToView not in contents and selectedItemToView is not None): selectedItemToView = contents.getFirstSelectedItem() self.blockItem.selectedItemToView = selectedItemToView if selectedItemToView is None: self.blockItem.PostSelectItems([selectedItemToView]) else: self.blockItem.PostSelectItems([]) if selecte... | if selectedItemToView is None: return index = contents.index (selectedItemToView) cursorRow = self.IndexToRow(index) if cursorRow == -1: return editAttributeNamed = getattr (self.blockItem, "editAttributeNamed", None) if editAttributeNamed is not None: try: column = self.blockItem.columnData.index (editAttributeName... | def wxSynchronizeWidget(self, useHints=False): """ A Grid can't easily redisplay its contents, so we write the following helper function to readjust everything after the contents change """ |
for selectionStart,selectionEnd in contents.getSelectionRanges(): | for rowStart,rowEnd in self.SelectedRowRanges(): | def UpdateSelection(self, columns): """ Update the grid's selection based on the collection's selection. |
rowStart = self.IndexToRow(selectionStart) rowEnd = self.IndexToRow(selectionEnd) | def UpdateSelection(self, columns): """ Update the grid's selection based on the collection's selection. | |
self.blockItem.PostSelectItems([item]) def SelectedIndexRanges(self): """ Uses RowRangeToIndexRange to convert the selected rows to selected indexes """ topLeftList = self.GetSelectionBlockTopLeft() bottomRightList = self.GetSelectionBlockBottomRight() selectedRows = ((row1, row2) for ((row1, col1), (row2, col2)) in ... | self.blockItem.PostSelectItems() def SelectedRowRanges(self): """ Uses IndexRangeToRowRange to convert the selected indexes to selected rows """ selection = self.blockItem.contents.getSelectionRanges() return self.IndexRangeToRowRange(selection) def IndexRangeToRowRange(self, indexRanges): """ Given a list of index r... | def GoToItem(self, item): if item != None: try: index = self.blockItem.contents.index (item) row = self.IndexToRow(index) except ValueError: item = None blockItem = self.blockItem if item is not None: blockItem.contents.addSelectionRange (index) blockItem.selectedItemToView = item self.SelectBlock (row, 0, row, self.Ge... |
topLeftList = self.GetSelectionBlockTopLeft() bottomRightList = self.GetSelectionBlockBottomRight() selectionRanges = reversed(self.blockItem.contents.getSelectionRanges()) | selectionRanges = list(reversed(self.blockItem.contents.getSelectionRanges())) | def DefaultCallback(item, collection=self.blockItem.contents): collection.remove(item) |
selectionRanges = self.blockItem.contents.getSelectionRanges() if not selectionRanges: detailItem = self.blockItem.selectedItemToView if detailItem is not None: yield detailItem return for selectionStart, selectionEnd in selectionRanges: for index in xrange(selectionStart, selectionEnd+1): yield self.blockItem.conten... | return self.blockItem.contents.iterSelection() | def SelectedItems(self): """ Return the list of selected items. """ selectionRanges = self.blockItem.contents.getSelectionRanges() if not selectionRanges: detailItem = self.blockItem.selectedItemToView if detailItem is not None: yield detailItem return for selectionStart, selectionEnd in selectionRanges: for index in ... |
if len(items)>0: | if len(items)==1: | def onSelectItemsEvent (self, event): items = event.arguments ['items'] self.selectItems (items) if len(items)>0: self.selectedItemToView = items[0] editAttributeNamed = event.arguments.get ('editAttributeNamed') if editAttributeNamed is not None: self.widget.EnableCellEditControl (False) self.editAttributeNamed = edi... |
def PostSelectItems(self, items): | def PostSelectItems(self, items = None): if items is None: items = list(self.contents.iterSelection()) | def PostSelectItems(self, items): self.postEventByName("SelectItemsBroadcast", {'items': items, 'collection': self.contentsCollection }) |
self.contents.setSelectionRanges([]) | self.contents.clearSelection() | def selectItems (self, items): """ Select the row corresponding to each item, and account for the fact that not all of the items are int the table Also make the first visible. """ |
logger.info("Updating channel: %s" % getattr(self, 'displayName', str(self.url)).encode('ascii', 'replace')) | channel = getattr(self, 'displayName', None) if channel is None: channel = str(self.url) else: channel = channel.encode('ascii', 'replace') logger.info("Updating channel: %s" % channel) | def Update(self, data=None): #getattr returns a unicode object which needs to be converted to bytes for #logging logger.info("Updating channel: %s" % getattr(self, 'displayName', str(self.url)).encode('ascii', 'replace')) |
set = self.rruleset.createDateUtilFromRule(dtstart) | def createDateUtilFromRule(self): """Construct a dateutil.rrule.rruleset from self.rruleset. The resulting rruleset will apply only to the modification or master for which self is an occurrence or modification, for instance, if an event has a thisandfuture modification, and self is an occurrence for that modification,... | |
repository = LocalRepository() repository.addObject(newItem) | def AddAddress(self, addressType, addressLocation, attributes): newItem = ContactMethodItem(addressType, addressLocation, attributes) self.contactMethods.append(newItem) self.SetContactMethods(self.contactMethods) # commit the changes repository = LocalRepository() repository.addObject(newItem) | |
if status & CItem.SCHEMA and kind.isKindOf(kind.getKindKind()): names = dirtyNames() if 'attributes' in names: self[uItem].flushCaches('attributes') elif 'superKinds' in names: self[uItem].flushCaches('superKinds') | def dirtyNames(): if kind is None: names = () else: names = kind._nameTuple(dirties) if status & CItem.KDIRTY: names += ('itsKind',) return names | |
self._scanHistory(self.itsVersion, newVersion, history, refreshes, merges, unloads, deletes) | self._scanHistory(self.itsVersion, newVersion, history, schema_history, refreshes, merges, unloads, deletes) | def _refreshForwards(self, mergeFn, newVersion, notify): |
history, refreshes, merges, unloads, deletes): | history, schema_history, refreshes, merges, unloads, deletes): | def _scanHistory(self, oldVersion, toVersion, history, refreshes, merges, unloads, deletes): |
self.nbAction = self.nbAction + 1 | self.nbVerif = self.nbVerif + 1 | def Report(self,description="Unknown"): ''' Report the current action states''' self.nbAction = self.nbAction + 1 self.Print("") self.Print("%s checking report : " %description) for failure in self.failureList: self.Print(" - Error : %s" % failure) for passed in self.passedList: self.Print(" - Ok : %s" % ... |
self.Print("Action status = %s" % status) | self.Print("Verification = %s" % status) | def Report(self,description="Unknown"): ''' Report the current action states''' self.nbAction = self.nbAction + 1 self.Print("") self.Print("%s checking report : " %description) for failure in self.failureList: self.Print(" - Error : %s" % failure) for passed in self.passedList: self.Print(" - Ok : %s" % ... |
if self.nbUnchecked == self.nbAction: | if self.nbUnchecked == self.nbVerif: | def Close(self): if self.toClose: # The file must close (time to report a summary) TestLogger.logger = None now = datetime.now() elapsed = now - self.startDate self.Print("") self.Print("++++++++++++++++++++++++SUMMARY++++++++++++++++++++++++") self.Print("Start date (before %s test script) = %s" %(self.mainDescription... |
elif self.nbPass == self.nbAction: | elif self.nbPass == self.nbVerif: | def Close(self): if self.toClose: # The file must close (time to report a summary) TestLogger.logger = None now = datetime.now() elapsed = now - self.startDate self.Print("") self.Print("++++++++++++++++++++++++SUMMARY++++++++++++++++++++++++") self.Print("Start date (before %s test script) = %s" %(self.mainDescription... |
self.Print("Total number of test actions executed : %s" %self.nbAction) self.Print("Total number of test actions PASSED : %s" %self.nbPass) self.Print("Total number of test actions FAILED : %s" %self.nbFail) | def Close(self): if self.toClose: # The file must close (time to report a summary) TestLogger.logger = None now = datetime.now() elapsed = now - self.startDate self.Print("") self.Print("++++++++++++++++++++++++SUMMARY++++++++++++++++++++++++") self.Print("Start date (before %s test script) = %s" %(self.mainDescription... | |
self.DoCapturedDragAndDrop() | self.DoCapturedDragAndDrop(copyOnly=True) | 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 """ |
"SendToBlockByReference", "SendToBlockByName", | "SendToBlockByReference", "SendToBlockByName", "SendToSender", | def _GenericEditEvent(self, event, methodName, changesData=True): try: method = getattr (self.widget, methodName) except AttributeError: # don't know, so BubbleUp event.arguments['continueBubbleUp'] = True else: result = method() if changesData: # notify that data has changed, if we can # use type() to skip repository ... |
self.rep.commit() | def testRule(self): import logging log = logging.getLogger("Test") log.setLevel(logging.DEBUG) | |
self.assertEqual(2, len([i for i in ic])) | def testRule(self): import logging log = logging.getLogger("Test") log.setLevel(logging.DEBUG) | |
if self.GetNumberCols() != 1: if lastColumnWidth > 0: self.SetColSize (lastColumnIndex, lastColumnWidth) self.ForceRefresh() | if lastColumnWidth > 0: self.SetColSize (lastColumnIndex, lastColumnWidth) self.ForceRefresh() | def OnSize(self, event): if not wx.GetApp().ignoreSynchronizeWidget: size = event.GetSize() widthMinusLastColumn = 0 |
splash.Update() | def _displayHook(obj): if obj is not None: print repr(obj) | |
its = Location.iterItems(view, exact=True) locQuery = [ i for i in its if i.displayName == locationName ] for firstSpot in locQuery: return firstSpot | for item in Location.iterItems(view, exact=True): if item.displayName == locationName: return item | def getLocation (cls, view, locationName): """ Factory Method for getting a Location. |
module with an .xrc extension | module with an .xrc extension. We'll freeze the wxMainFrame while adding the panel, since it's temporarily owned by wxMainFrame and would otherwise cause it to be temporarily displayed on the screen | def synchronizeView (self): wxMainFrame = app.association[id(app.model.mainFrame)] """ If it isn't in the association we need to construct it and put it in the association. """ if not app.association.has_key(id(self)): module = sys.modules[self.__class__.__module__] modulename = os.path.basename (module.__file__) modul... |
if so we'll remove it from the association and destroy it. Shortcut the case of setting the same window we've already set. | if so we'll remove it from the association and destroy it. Only windows with the attribute "model" are removed from the association since on the Mac there are some extra scrollbars added below the viewer parcel container. Shortcut the case of setting the same window we've already set. | def synchronizeView (self): wxMainFrame = app.association[id(app.model.mainFrame)] """ If it isn't in the association we need to construct it and put it in the association. """ if not app.association.has_key(id(self)): module = sys.modules[self.__class__.__module__] modulename = os.path.basename (module.__file__) modul... |
if window.__dict__.has_key("model"): | if hasattr (window, "model"): | def synchronizeView (self): wxMainFrame = app.association[id(app.model.mainFrame)] """ If it isn't in the association we need to construct it and put it in the association. """ if not app.association.has_key(id(self)): module = sys.modules[self.__class__.__module__] modulename = os.path.basename (module.__file__) modul... |
Attach the new parcel to the view. | Attach the new parcel to the view. Don't forget to show the panel which was temporarily hidden | def synchronizeView (self): wxMainFrame = app.association[id(app.model.mainFrame)] """ If it isn't in the association we need to construct it and put it in the association. """ if not app.association.has_key(id(self)): module = sys.modules[self.__class__.__module__] modulename = os.path.basename (module.__file__) modul... |
item = RSSChannel(rssURL,None,self._container,self._kind) | item = RSSChannel(None,self._container,self._kind) item.initAttributes(rssURL) | def newItem(self,rssURL): item = RSSChannel(rssURL,None,self._container,self._kind) return item |
def __init__(self,rssURL,name,parent,kind,**_kwds): | def __init__(self,name,parent,kind,**_kwds): | def __init__(self,rssURL,name,parent,kind,**_kwds): Item.__init__(self,name,parent,kind,**_kwds) Observable1.__init__(self) parserData = feedparser.parse(rssURL) if (parserData['channel'] == {}): self.delete() #@@@ verify it's ok to delete an object before __init__ is completed raise RSSChannelException, 'No RSS Data c... |
item.updateAttributes(itemData) | item.initAttributes(itemData) | def newItem(self, itemData): item = RSSItem(itemData, itemData.get('title',''),self._container,self._kind) item.updateAttributes(itemData) return item |
self.timeHeight += 3 | if '__WXGTK__' not in wx.PlatformInfo: self.timeHeight += 3 | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item if item.isDeleted(): return |
notification.data ['Enable'] = len (self.selection) != 0 | notification.data ['Enable'] = False | def onDeleteEventUpdateUI (self, notification): notification.data ['Enable'] = len (self.selection) != 0 |
stderr=True, | def _openRepository(self, ramdb=True): preloadedRepositoryPath = os.path.join(self.testdir, '__preloaded_repository__') self.rep = DBRepository(os.path.join(self.testdir, '__repository__')) | |
self.rep.logger.setLevel(self.logLevel) | def _openRepository(self, ramdb=True): preloadedRepositoryPath = os.path.join(self.testdir, '__preloaded_repository__') self.rep = DBRepository(os.path.join(self.testdir, '__repository__')) | |
if not self.displayed and not self.shuttingDown and not constants.OFFLINE: | if not self.displayed and not self.shuttingDown and not Globals.options.offline: | def _actionCompleted(self): if __debug__: trace("_actionCompleted") |
if self.mailMessage is not None or constants.OFFLINE: | if self.mailMessage is not None or Globals.options.offline: | def _prepareForSend(self, mailMessageUUID): """Sends a mail message via SMTP using the account and mailMessage passed to this classes __init__ method using the Twisted Asych Reactor""" |
if constants.OFFLINE: | if Globals.options.offline: | def _prepareForSend(self, mailMessageUUID): """Sends a mail message via SMTP using the account and mailMessage passed to this classes __init__ method using the Twisted Asych Reactor""" |
if constants.OFFLINE: | if Globals.options.offline: | def _testAccountSettings(self): if __debug__: trace("_testAccountSettings") |
if self.shuttingDown or constants.OFFLINE: | if self.shuttingDown or Globals.options.offline: | def _testSuccess(self, result): if __debug__: trace("_testSuccess") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.