rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
line1 = _(u"Chandler encountered an unexpected problem while trying to start.\n") | def realMain(): Utility.initProfileDir(Globals.options) Globals.chandlerDirectory = Utility.locateChandlerDirectory() os.chdir(Globals.chandlerDirectory) Utility.initLogging(Globals.options) Utility.initI18n(Globals.options) | |
logging.error (longMessage) if os.linesep != '\n': longMessage = longMessage.replace ('\n', os.linesep) if hasattr (wx.TheClipboard, 'SetData'): wx.TheClipboard.SetData (wx.TextDataObject (longMessage)) line3 = _(u"The clipboard contains the stack trace.\n") else: line3 = "" frames = 8 line2 = _(u"Here are the bott... | logging.error(longMessage) | def realMain(): Utility.initProfileDir(Globals.options) Globals.chandlerDirectory = Utility.locateChandlerDirectory() os.chdir(Globals.chandlerDirectory) Utility.initLogging(Globals.options) Utility.initI18n(Globals.options) |
self._showStatus("Wait for Sharing URL...\n") | self._showStatus("Wait for Sharing URLs...\n") | def OnPublish(self, evt): # Publish the collection |
self._showStatus("%s" % shareXML.getLocation()) | self._showStatus("%s\n" % shareXML.getLocation()) self._showStatus("%s\n" % shareICal.getLocation()) | def OnPublish(self, evt): # Publish the collection |
if hasattr(event.arguments['sender'], 'title'): event.arguments['Text'] = event.arguments['sender'].title | title = getattr(event.arguments['sender'], 'title', '') if title: accel = getattr(event.arguments['sender'], 'accel', '') if accel: title += '\t' + accel event.arguments['Text'] = title | def broadcast (block, methodName, event, childTest): callMethod (block, methodName, event) for child in block.childrenBlocks: if childTest (child): broadcast (child, methodName, event, childTest) |
if op != 'refresh': if not (op is None or self.filter(other)): | if op == 'add': if not self.filter(other): | def sourceChanged(self, op, change, sourceOwner, sourceName, inner, other, source=None): |
refDict.extend(value.values()) | for item in value.itervalues(): refDict.append(item) | def setAttributeValue(self, name, value=None, _attrDict=None): """Create and/or set a Chandler attribute. |
params["src"] = None params["dest"] = None | params["src"] = None params["dest"] = None params["link"] = None | def handleManifest(buildenv, filename, fatalErrors=True): params = {} params["src"] = None params["dest"] = None params["recursive"] = True params["glob"] = "*" params["exclude"] = "\.svn" srcdir = buildenv['root'] destdir = buildenv['distdir'] if fatalErrors: hhMsg = HARDHAT_ERROR else: hhMsg = HARDHAT_WARNING for ... |
abspath = os.path.join(srcdir,line) if os.path.isdir(abspath): log(buildenv, HARDHAT_MESSAGE, "HardHat", abspath) copyto = os.path.join(buildenv['distdir'], params["dest"], line) _copyTree(abspath, copyto, params["recursive"], params["glob"], params["exclude"]) | if linkdir is not None: if buildenv['os'] <> 'win': srcpath = os.path.abspath(os.path.join(destdir, linkdir, line)) linkpath = os.path.join(linkdir, line) if os.path.isdir(srcpath): log(buildenv, HARDHAT_MESSAGE, "HardHat", "linking %s to %s in %s" % (linkpath, line, destdir)) mkdirs(destdir) os.chdir(destdir) os.sy... | def handleManifest(buildenv, filename, fatalErrors=True): params = {} params["src"] = None params["dest"] = None params["recursive"] = True params["glob"] = "*" params["exclude"] = "\.svn" srcdir = buildenv['root'] destdir = buildenv['distdir'] if fatalErrors: hhMsg = HARDHAT_ERROR else: hhMsg = HARDHAT_WARNING for ... |
if os.path.exists(abspath): | abspath = os.path.join(srcdir,line) if os.path.isdir(abspath): | def handleManifest(buildenv, filename, fatalErrors=True): params = {} params["src"] = None params["dest"] = None params["recursive"] = True params["glob"] = "*" params["exclude"] = "\.svn" srcdir = buildenv['root'] destdir = buildenv['distdir'] if fatalErrors: hhMsg = HARDHAT_ERROR else: hhMsg = HARDHAT_WARNING for ... |
copyto = os.path.join(buildenv['distdir'], params["dest"], line) createpath = os.path.dirname(copyto) mkdirs(createpath) if os.path.islink(abspath): linkto = os.readlink(abspath) os.symlink(linkto, copyto) | copyto = os.path.join(buildenv['distdir'], params["dest"], line) _copyTree(abspath, copyto, params["recursive"], params["glob"], params["exclude"]) else: if os.path.exists(abspath): log(buildenv, HARDHAT_MESSAGE, "HardHat", abspath) copyto = os.path.join(buildenv['distdir'], params["dest"], line) createpath = os.path.d... | def handleManifest(buildenv, filename, fatalErrors=True): params = {} params["src"] = None params["dest"] = None params["recursive"] = True params["glob"] = "*" params["exclude"] = "\.svn" srcdir = buildenv['root'] destdir = buildenv['distdir'] if fatalErrors: hhMsg = HARDHAT_ERROR else: hhMsg = HARDHAT_WARNING for ... |
shutil.copy(abspath, copyto) else: log(buildenv, hhMsg, "HardHat", "File missing: " + abspath) if fatalErrors: raise HardHatError, 'File missing: ' + abspath else: continue | log(buildenv, hhMsg, "HardHat", "File missing: " + abspath) if fatalErrors: raise HardHatError, 'File missing: ' + abspath else: continue | def handleManifest(buildenv, filename, fatalErrors=True): params = {} params["src"] = None params["dest"] = None params["recursive"] = True params["glob"] = "*" params["exclude"] = "\.svn" srcdir = buildenv['root'] destdir = buildenv['distdir'] if fatalErrors: hhMsg = HARDHAT_ERROR else: hhMsg = HARDHAT_WARNING for ... |
reflection of complexity of our sidebar design, so here is a summary of the rules: | reflection of complexity of our sidebar design. Here is a description of the rules: | def getButtonImage (self, item, mouseOverFlag): """ The rules for naming icons are complicated, which is a reflection of complexity of our sidebar design, so here is a summary of the rules: |
'Sidebar', ButtonName, IconName, Checked, MouseState, Deactive, '.png' | 'Sidebar', ButtonName, iconName, Checked, MouseState, Deactive, '.png' | def getButtonImage (self, item, mouseOverFlag): """ The rules for naming icons are complicated, which is a reflection of complexity of our sidebar design, so here is a summary of the rules: |
The ButtonName is followed by IconName. IconName is a property of the collection, e.g. the Dashboard has an IconName of 'Dashboard'. The In, Out, and Trash collections have names 'In', 'Out' and 'Trash' respectively. Currently, new collections have no icon name, so the IconName can be empty. Another property of the col... | The ButtonName is followed by iconName. iconName is a property of the collection, e.g. the Dashboard has an iconName of 'Dashboard'. The In, Out, and Trash collections have iconNames 'In', 'Out' and 'Trash' respectively. Currently, new collections have no iconNme, so the iconName can be empty. Another property of the c... | def getButtonImage (self, item, mouseOverFlag): """ The rules for naming icons are complicated, which is a reflection of complexity of our sidebar design, so here is a summary of the rules: |
TaskMixin. Currently, only the All collection has this property, so the IconNames for the AllCollection are 'All', 'AllCalendarEventMixin', 'AllMailMessageMixin' and 'AllTaskMixin'. Another property of the collection, controlled by the allowOverlay, attribute determintes whether or not it can be checked. If the colle... | TaskMixin. Currently, only the Dashboard collection has this property, so the iconNames for the Dashboard are 'Dashboard', 'DashboardCalendarEventMixin', 'DashboardMailMessageMixin' and 'DashboardTaskMixin'. Another property of the collection, controlled by the allowOverlay attribute, determines whether or not it can... | def getButtonImage (self, item, mouseOverFlag): """ The rules for naming icons are complicated, which is a reflection of complexity of our sidebar design, so here is a summary of the rules: |
if self.buttonState['screenMouseDown']: | if self.buttonState['screenMouseDown'] != self.buttonState['blockChecked']: | def getButtonImage (self, item, mouseOverFlag): """ The rules for naming icons are complicated, which is a reflection of complexity of our sidebar design, so here is a summary of the rules: |
stateBitmaps = self.stateBitmaps[self.currentState] assert stateBitmaps is not None rolloverBitmap = getattr(stateBitmaps, "rollover", None) if rolloverBitmap is not None: | if self.IsEnabled(): stateBitmaps = self.stateBitmaps[self.currentState] assert stateBitmaps is not None rolloverBitmap = getattr(stateBitmaps, "rollover", None) if rolloverBitmap is not None: | def _RolloverStart(self, event): """ Change the state of the button to its possible rollover state. """ stateBitmaps = self.stateBitmaps[self.currentState] assert stateBitmaps is not None rolloverBitmap = getattr(stateBitmaps, "rollover", None) if rolloverBitmap is not None: self.SetBitmapLabel(rolloverBitmap) self.Ref... |
stateBitmaps = self.stateBitmaps[self.currentState] if getattr(stateBitmaps, "rollover", None) is not None: assert getattr(stateBitmaps, "normal", None) is not None, "invalid state '" + inStateName + "' is missing 'normal' bitmap" self.SetBitmapLabel(stateBitmaps.normal) self.Refresh() self.Update() | if self.IsEnabled(): stateBitmaps = self.stateBitmaps[self.currentState] if getattr(stateBitmaps, "rollover", None) is not None: assert getattr(stateBitmaps, "normal", None) is not None, "invalid state '" + inStateName + "' is missing 'normal' bitmap" self.SetBitmapLabel(stateBitmaps.normal) self.Refresh() self.Updat... | def _RolloverFinish(self, event): """ Return the button to its non-rollover state. """ stateBitmaps = self.stateBitmaps[self.currentState] # only do all this if there was actually a rollover if getattr(stateBitmaps, "rollover", None) is not None: assert getattr(stateBitmaps, "normal", None) is not None, "invalid state ... |
timeString = timeFormatter.format(datetime.combine(dummyDate, time(hour=16)), hourFP) | timeFormatter.format(datetime.combine(dummyDate, time(hour=16)), hourFP) | def GetLocaleHourStrings(self, hourrange, dc): """ use PyICU to format the hour, because some locales use a 24 hour clock """ timeFormatter = DateFormat.createTimeInstance(DateFormat.SHORT) dummyDate = date.today() |
print 'merge' | print 'Doing merge' | def merge(dav, item, davItem, hasLocalChanges): # for now, just pull changes from the server and overwrite local changes... print 'merge' syncFromServer(item, davItem) |
props = '<osaf:kind xmlns:osaf="//core">%s</osaf:kind><osaf:uuid xmlns:osaf="//core">%s</osaf:uuid>' % (kind.itsPath, item.itsUUID.str16()) | props = makePropString('kind', '//core', kind.itsPath) + \ makePropString('uuid', '//core', item.itsUUID.str16()) | 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 props = '<osaf:kind xmlns:osaf="//core">%s</osaf:kind><osaf:uuid xmlns:os... |
data = '' | 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 props = '<osaf:kind xmlns:osaf="//core">%s</osaf:kind><osaf:uuid xmlns:os... | |
data = '<osaf:%s xmlns:osaf="%s"><![CDATA[' % (name, namespace) | listData = '' | 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 props = '<osaf:kind xmlns:osaf="//core">%s</osaf:kind><osaf:uuid xmlns:os... |
data += '<itemref>' + unicode(durl) + '</itemref>' | listData += '<itemref>' + unicode(durl) + '</itemref>' | 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 props = '<osaf:kind xmlns:osaf="//core">%s</osaf:kind><osaf:uuid xmlns:os... |
data += ']]></osaf:%s>' % (name) else: | props += makePropString(name, namespace, listData) elif acard == 'single': | 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 props = '<osaf:kind xmlns:osaf="//core">%s</osaf:kind><osaf:uuid xmlns:os... |
data = '<osaf:%s xmlns:osaf="%s"><![CDATA[<itemref>%s</itemref>]]></osaf:%s>' % (name, namespace, unicode(durl), name) | props += makePropString(name, namespace, '<itemref>%s</itemref>' % (unicode(durl))) | 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 props = '<osaf:kind xmlns:osaf="//core">%s</osaf:kind><osaf:uuid xmlns:os... |
value = atype.makeString(value) data = '<osaf:%s xmlns:osaf="%s"><![CDATA[%s]]></osaf:%s>' % (name, namespace, value, name) props += data | props += makePropString(name, namespace, atype.makeString(value)) elif acard == 'dict': pass else: raise Exception | 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 props = '<osaf:kind xmlns:osaf="//core">%s</osaf:kind><osaf:uuid xmlns:os... |
for node in nodes: otherItem = DAV(node.content).get() item.addValue(name, otherItem) | setfunc = item.addValue | def syncFromServer(item, davItem): from Dav import DAV kind = davItem.itsKind for (name, attr) in kind.iterAttributes(True): value = davItem.getAttribute(attr) if not value: continue print 'Getting:', name, '(' + attr.type.itsName + ')' # see if its an ItemRef or not if isinstance(attr.type, Kind): # time for some ... |
node = nodes[0] otherItem = DAV(node.content).get() item.setAttributeValue(name, otherItem) | setfunc = item.setAttributeValue elif attr.cardinality == 'dict': pass | def syncFromServer(item, davItem): from Dav import DAV kind = davItem.itsKind for (name, attr) in kind.iterAttributes(True): value = davItem.getAttribute(attr) if not value: continue print 'Getting:', name, '(' + attr.type.itsName + ')' # see if its an ItemRef or not if isinstance(attr.type, Kind): # time for some ... |
def median(values): """ 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 None is a special value that is ignored by PyChart. """ if len(values) == 0: median = None else: values = [x for x in values if x != 0] if len(values) == 0: median... | 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 = [] osMedians = {'win': {}, 'osx': {}, 'linux': {}} def median(values): ""... | |
for testkey in tests.keys(): | for (testkey, testDisplayName) in self.SummaryTests: | def generateDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
indexpage.append('<h2 id="%s">%s</h2>\n' % (testkey, testkey)) detailpage.append('<h2>%s</h2>\n' % testkey) | indexpage.append('<h2 id="%s">%s</h2>\n' % (testkey, testDisplayName)) detailpage.append('<h2 id="%s">%s</h2>\n' % (testkey, testDisplayName)) | def generateDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
detailpage.append('<p>Sample Average is %2.3f and std.dev is %2.3f</p>\n' % (avg, v)) | detailpage.append('<p>Median is %2.3f and Sample Average is %2.3f and std.dev is %2.3f</p>\n' % (med, avg, v)) | def generateDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
detailpage.append('<tr><td>%02d:%02d:%02d</td><td class="%s">%02.3f</td>' \ '<td class="number">%d</td><td class="number_left">%02.3f</td><td class="number">%02.3f</td></tr>\n' % (datapoint[1].hour, datapoint[1].minute, datapoint[1].second, s, datapoint[DP_RUNTIME], perc, c_perc, c_diff)) | if lastDatapoint is not None: bonsaiURL = 'http://bonsai.osafoundation.org/svnquery.cgi?treeid=default&module=all&branch=trunk&branchtype=match&sortby=Date&date=explicit&mindate=%4d-%02d-%02d+%02d:%02d:%02d&maxdate=%4d-%02d-%02d+%02d:%02d:%02d&repository=/svn/chandler' % \ (lastDatapoint[1].year, lastDatapoint[1].month... | def generateDetailPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} |
trendspage.append('<h2>%s</h2><img src="%s" alt="graph" title="%s">' % (testDisplayName, graphfilename, testDisplayName)) | trendspage.append('<h2><a href="%s | 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, None), graphPlatform['linux'].get(date... |
def makeValue(self, data): | def makeValue(self, data): """Make a list of strings from comma separated strings. The implementation is very cheap, using split, so spaces are part of the list's elements and the strings cannot contain spaces.""" | def typeXML(self, value, generator, withSchema): |
hourHeightMode = schema.One(CalendarHourMode, defaultValue="auto", | hourHeightMode = schema.One(CalendarHourMode, defaultValue="visibleHours", | def _getColumns(self): if self.blockItem.dayMode: return 1 else: return self.blockItem.daysPerView |
if calname != "": | if calname == "": | def itemsFromVObject(view, text, coerceTzinfo = None, filters = None, monolithic = True, changes=None, previousView=None, updateCallback=None): """ Take a string, create or update items from that stream. The updating of items uses Sharing.importValue; changes, previousView and updateCallback are all optional pass-thro... |
if not subscribedBlocks.has_key (self.itsUUID): subscribedBlocks [self.itsUUID] = UUID() | if not self.subscribedBlocks.has_key (self.itsUUID): self.subscribedBlocks [self.itsUUID] = UUID() | def render (self): try: instantiateWidgetMethod = getattr (type (self), "instantiateWidget") except AttributeError: pass else: oldIgnoreSynchronizeWidget = Globals.wxApplication.ignoreSynchronizeWidget Globals.wxApplication.ignoreSynchronizeWidget = True try: widget = instantiateWidgetMethod (self) finally: Globals.wxA... |
subscribedBlocks [self.itsUUID], | self.subscribedBlocks [self.itsUUID], | def render (self): try: instantiateWidgetMethod = getattr (type (self), "instantiateWidget") except AttributeError: pass else: oldIgnoreSynchronizeWidget = Globals.wxApplication.ignoreSynchronizeWidget Globals.wxApplication.ignoreSynchronizeWidget = True try: widget = instantiateWidgetMethod (self) finally: Globals.wxA... |
def create(self, verbose=False, notxn=False): | def create(self, verbose=False): | def create(self, verbose=False, notxn=False): |
self._notxn = notxn | def create(self, verbose=False, notxn=False): | |
if self._notxn: self._env.open(self.dbHome, DB_CREATE | DB_INIT_MPOOL, 0) else: self._env.open(self.dbHome, DB_CREATE | self.OPEN_FLAGS, 0) | self._env.open(self.dbHome, DB_CREATE | self.OPEN_FLAGS, 0) | def _create(self): |
def open(self, verbose=False, create=False, notxn=False): | def open(self, verbose=False, create=False, recover=False): | def open(self, verbose=False, create=False, notxn=False): |
self._notxn = notxn | def open(self, verbose=False, create=False, notxn=False): | |
if self._notxn: self._env.open(self.dbHome, DB_INIT_MPOOL, 0) self._openDb(False) | if recover: before = datetime.now() self._env.open(self.dbHome, DB_RECOVER | DB_CREATE | self.OPEN_FLAGS, 0) after = datetime.now() print 'opened db with recovery in %s' %(after - before) | def open(self, verbose=False, create=False, notxn=False): |
before = datetime.now() self._env.open(self.dbHome, self.OPEN_FLAGS) after = datetime.now() self._openDb(False) | self._env.open(self.dbHome, self.OPEN_FLAGS, 0) self._openDb(False) | def open(self, verbose=False, create=False, notxn=False): |
if self._notxn: txn = None else: txn = self._env.txn_begin(None, DB_DIRTY_READ | DB_TXN_NOWAIT) | txn = self._env.txn_begin(None, DB_DIRTY_READ | DB_TXN_NOWAIT) | def _openDb(self, create): |
if not repository._notxn: self._txn = repository._env.txn_begin(None, (DB_DIRTY_READ | DB_TXN_NOWAIT)) else: self._txn = None | self._txn = repository._env.txn_begin(None, (DB_DIRTY_READ | DB_TXN_NOWAIT)) | def commit(self): repository = self.repository verbose = repository.verbose versions = repository._versions history = repository._history |
print "got line" | def lineReceived(self, line): print "got line" """Error Conditions""" if TIMEOUT_RESPONSE: """Do not respond to clients request""" return | |
print "" + module + " needs updating" | log.write("%s needs updating\n" % module) | def changesInSVN(workingDir, log): changesDict = {} |
log.write("Module unchanged" + "\n") | log.write("%s unchanged\n" % module) | def changesInSVN(workingDir, log): changesDict = {} |
Wrap wx.StaticText to give it the same GetValue/SetValue behavior that other wx controls have. (This was simpler than putting lotsa special cases all over the StringAttributeEditor...) | For some reason, wx.StaticText uses GetLabel/SetLabel instead of GetValue/SetValue; also, its Label functions don't display single ampersands 'cuz they might be menu accelerators. To solve both these problems, I've added implementations of GetValue/SetValue that double any embedded ampersands. | def OnEnterPressed(self, event): self.blockItem.postEventByName ('EnterPressed', {'text':self.GetValue()}) event.Skip() |
GetValue = wx.StaticText.GetLabel SetValue = wx.StaticText.SetLabel | def GetValue(self): """ Get the label, un-doubling any embedded ampersands """ return self.GetLabel().replace(u'&&', u'&') def SetValue(self, newValue): """ Set the label, doubling any embedded ampersands """ self.SetLabel(newValue.replace(u'&', u'&&')) | def OnEnterPressed(self, event): self.blockItem.postEventByName ('EnterPressed', {'text':self.GetValue()}) event.Skip() |
calendar.setTimeZone(ICUtzinfo.default._timezone) | calendar.setTimeZone(ICUtzinfo.default.timezone) | def setRange(self, date): """ Sets the range to include the given date, given the current view. For week view, it will start the range at the beginning of the week. For day view, it will set the range to start at the given date |
calendar.setTimeZone(ICUtzinfo.default._timezone) | calendar.setTimeZone(ICUtzinfo.default.timezone) | def setRange(self, date): """ We need to override CalendarBlock's because the cal ctrl always has its range over an entire week, even if a specific day is selected (and dayMode is true). """ assert self.daysPerView == 7, "daysPerView is a legacy variable, keep it at 7 plz" |
defaultStyle = Styles.CharacterStyle() defaultBoldStyle = \ Styles.CharacterStyle(fontStyle='bold', fontSize=10.0) defaultBigBoldStyle = \ Styles.CharacterStyle(fontStyle='bold', fontSize=13.0) defaultFont = Styles.getFont(defaultStyle) defaultBoldFont = Styles.getFont(defaultBoldStyle) defaultBigBoldFont = Styles.ge... | defaultFont = Styles.getFont(self.characterStyle) defaultBoldFont = Styles.getFont(self.boldCharacterStyle) defaultBigBoldFont = Styles.getFont(self.bigBoldCharacterStyle) | def InitializeStyles(self): |
@staticmethod def GetLocaleHourStrings(hourrange): | def GetLocaleHourStrings(self, hourrange): | def _doDrawingCalculations(self): |
defaultTzinfo = DefaultTimeZone.get().tzinfo | defaultTzinfo = DefaultTimeZone.get(view=self.blockItem.itsView).tzinfo | def GetLocaleHourStrings(hourrange): """ use PyICU to format the hour, because some locales use a 24 hour clock """ timeFormatter = DateFormat.createTimeInstance() hourFP = FieldPosition(DateFormat.HOUR1_FIELD) dummyDate = date.today() defaultTzinfo = DefaultTimeZone.get().tzinfo for hour in hourrange: timedate = time... |
w = wxCalendarControl(self.parentBlock.widget, -1) | w = wxCalendarControl(self.parentBlock.widget, -1, tzCharacterStyle=self.tzCharacterStyle) | def instantiateWidget(self): if not self.getHasBeenRendered(): self.setRange( datetime.now().date() ) self.setHasBeenRendered() w = wxCalendarControl(self.parentBlock.widget, -1) return w |
def __init__(self, *arguments, **keywords): super(wxCalendarControl, self).__init__(*arguments, **keywords) | def __init__(self, parent, id, tzCharacterStyle, *arguments, **keywords): super(wxCalendarControl, self).__init__(parent, id, *arguments, **keywords) | def __init__(self, *arguments, **keywords): super(wxCalendarControl, self).__init__(*arguments, **keywords) self.allDayCloseArrowImage = wx.GetApp().GetImage("AllDayCloseArrow_whitebg.png") self.allDayOpenArrowImage = wx.GetApp().GetImage("AllDayOpenArrow_whitebg.png") self.allDayBlankArrowImage = wx.GetApp().GetImage... |
self.tzChoice = self.MakeTimezoneChoice() | self.tzChoice = self.MakeTimezoneChoice(tzCharacterStyle) | def __init__(self, *arguments, **keywords): super(wxCalendarControl, self).__init__(*arguments, **keywords) self.allDayCloseArrowImage = wx.GetApp().GetImage("AllDayCloseArrow_whitebg.png") self.allDayOpenArrowImage = wx.GetApp().GetImage("AllDayOpenArrow_whitebg.png") self.allDayBlankArrowImage = wx.GetApp().GetImage... |
def MakeTimezoneChoice(self): | def MakeTimezoneChoice(self, tzCharacterStyle): | def MakeTimezoneChoice(self): # [@@@] grant: On Linux, ICUtzinfo.getDefault() returns "PDT", # not "US/Pacific". Should we do something to figure out # that it's equivalent? |
style = Styles.CharacterStyle(fontSize=11.0) font = Styles.getFont(style) | font = Styles.getFont(tzCharacterStyle) | def MakeTimezoneChoice(self): # [@@@] grant: On Linux, ICUtzinfo.getDefault() returns "PDT", # not "US/Pacific". Should we do something to figure out # that it's equivalent? |
wx.SAVE | wx.CHANGE_DIR | wx.OVERWRITE_PROMPT) | wx.SAVE | wx.OVERWRITE_PROMPT) | def onExportIcalendarEvent(self, event): # triggered from "File | Import/Export" Menu |
self.setFreeBusy(None, self.hints) else: self.setFreeBusy(None, {}) | self.setFreeBusy(None, **self.hints) else: self.setFreeBusy(None) | def wxSynchronizeWidget(self, useHints=False): style = wx.minical.CAL_SUNDAY_FIRST | wx.minical.CAL_SHOW_SURROUNDING_WEEKS | wx.minical.CAL_SHOW_BUSY if '__WXMAC__' in wx.PlatformInfo: style |= wx.BORDER_SIMPLE else: style |= wx.BORDER_STATIC if isMainCalendarVisible() and self.blockItem.doSelectWeek: style |= wx.mini... |
def setFreeBusy(self, event, hints): | def setFreeBusy(self, event, **hints): | def setFreeBusy(self, event, hints): if self._recalcCount == 0: startWxDate = self.GetStartDate(); endWxDate = startWxDate + wx.DateSpan.Month() * 3 start = datetime(startWxDate.GetYear(), startWxDate.GetMonth() + 1, startWxDate.GetDay()) |
if self.source: | if self.source is not None: | def _ensureQueryIsCurrent (self): """ Make sure that we update the queryString if the rule is stale, then let our superclass handle its part. """ if self.ruleIsStale: args = {} newQueryString = self._rule if self.source: if newQueryString: newQueryString = "union (" + newQueryString + ", for i in $0 where True)" else: ... |
if self.source: | if self.source is not None: | def subscribe(self, *arguments, **keywords): if self.source: self.source.subscribe (self, "") super (ItemCollection, self).subscribe (*arguments, **keywords) |
smallWord = word[0:i] + "..." | smallWord = word[0:i] | def DrawClippedText(self, dc, word, x, y, maxWidth): # keep shortening the word until it fits for i in xrange(len(word), 0, -1): smallWord = word[0:i] + "..." width, height = dc.GetTextExtent(smallWord) if width <= maxWidth: dc.DrawText(smallWord, x, y) return |
updateCallback(msg=_(u"Conflict for item '%s' attribute: %s '%s' vs '%s'" % (item.getItemDisplayName(), | updateCallback(msg=_(u"Conflict for item '%s' attribute: %s '%s' vs '%s'") % (item.getItemDisplayName(), | def importValue(item, changes, attribute, value, previousView, updateCallback=None, setCallback=None): """ Conditionally set a value (brought in via the sharing layer) on an item, depending on whether the new value is different than the old one, and whether the value has really changed remotely since the last sync. Con... |
value))) | value)) | def importValue(item, changes, attribute, value, previousView, updateCallback=None, setCallback=None): """ Conditionally set a value (brought in via the sharing layer) on an item, depending on whether the new value is different than the old one, and whether the value has really changed remotely since the last sync. Con... |
item.contents = collection tableKind = Globals.repository.findPath("//parcels/osaf/framework/blocks/Table") for copy in copies.values(): if copy.isItemOf(tableKind): copy.contents = collection | untitledItemCollection = item.contents for copy in untitledItemCollection.collectionOwner: copy.contents = collection | def onModifyContentsEvent(self, notification): event = notification.event operation = event.operation |
self.SetColLabelSize (32) | self.SetColLabelSize (20) | def Reset(self): """ 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 |
style=wx.TE_PROCESS_ENTER | wx.NO_BORDER | def __init__(self, *arguments, **keywords): style=wx.TE_PROCESS_ENTER | wx.NO_BORDER # Windows and Mac add an extra vertical scrollbar for TE_MULTILINE, # and GTK does not. Further, if GTK is not multiline, then the single # line mode looks really wonky with a huge cursor if '__WXGTK__' in wx.PlatformInfo: style |= wx... | |
if '__WXGTK__' in wx.PlatformInfo: style |= wx.TE_MULTILINE | style=wx.NO_BORDER | wx.TE_NO_VSCROLL | wx.TE_MULTILINE | wx.TE_AUTO_SCROLL | def __init__(self, *arguments, **keywords): style=wx.TE_PROCESS_ENTER | wx.NO_BORDER # Windows and Mac add an extra vertical scrollbar for TE_MULTILINE, # and GTK does not. Further, if GTK is not multiline, then the single # line mode looks really wonky with a huge cursor if '__WXGTK__' in wx.PlatformInfo: style |= wx... |
os.chdir(os.path.join("model","util","ext")) if buildenv['version'] == 'debug': python = buildenv['python_d'] if buildenv['version'] == 'release': python = buildenv['python'] hardhatlib.executeCommand( buildenv, info['name'], [python, "setup.py", "install"], "Building UUID Extension" ) os.chdir("../../..") | if not ((buildenv['os'] == 'win') and (buildenv['version'] == 'debug')): os.chdir(os.path.join("model","util","ext")) if buildenv['version'] == 'debug': python = buildenv['python_d'] if buildenv['version'] == 'release': python = buildenv['python'] hardhatlib.executeCommand( buildenv, info['name'], [python, "setup.py",... | 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(... |
self.rootdir = os.environ['CHANDLERHOME'] | def setUp(self, ramdb=True): self.ramdb = ramdb self.rootdir = os.environ['CHANDLERHOME'] self.testdir = os.path.join(self.rootdir, 'chandler', 'repository', 'tests') self.rep = XMLRepository(os.path.join(self.testdir, '__repository__')) self.rep.create(ramdb=self.ramdb) schemaPack = os.path.join(self.rootdir, 'chandle... | |
setattr (item, attributeName, valueString) self.AttributeChanged() | if self.allowEmpty() or len(valueString.strip()) > 0: setattr (item, attributeName, valueString) self.AttributeChanged() else: self.SetControlValue(self.control, self.GetAttributeValue(item, attributeName)) def allowEmpty(self): """ Return true if this field allows an empty value to be written to the content mode... | def SetAttributeValue(self, item, attributeName, valueString): try: cardinality = item.getAttributeAspect (attributeName, "cardinality") except AttributeError: cardinality = "single" if cardinality == "single": if self.GetAttributeValue(item, attributeName) != valueString: # logger.debug("StringAE.SetAttributeValue: ch... |
setattr(self, self.__collection__, Set(self.source)) | if isinstance(self.source, MultiCollection): trash = schema.ns('osaf.pim', self.itsView).trashCollection sourceMinusTrash = Difference(self.source, trash) setattr(self, self.__collection__, sourceMinusTrash) else: setattr(self, self.__collection__, Set(self.source)) | def __init__(self, *args, **kwds): |
('new_event_from_file_menu_for_performance', ' ('new_event_by_double_clicking_in_the_cal_view_for_performance', ' ('test_new_calendar_for_performance', ' ('importing_3000_event_calendar', ' | ('new_event_from_file_menu_for_performance.event_creation', ' ('new_event_by_double_clicking_in_the_cal_view_for_performance.double_click_in_the_calendar_view', ' ('test_new_calendar_for_performance.collection_creation', ' ('importing_3000_event_calendar.import_large_calendar', ... | def __init__(self): self._app_path = os.getcwd() self._options = { 'tbox_data': '.', # raw .perf files 'html_data': '.', # where to output generated .html 'perf_data': '.', # where to store processed data 'verbose': False, 'debug': False, 'cleanup': False, # remove .perf files when processed 'c... |
('creating_new_event_from_the_file_menu_after_large_data_import', ' ('creating_a_new_event_in_the_cal_view_after_large_data_import', ' | ('creating_new_event_from_the_file_menu_after_large_data_import.event_creation', ' ('creating_a_new_event_in_the_cal_view_after_large_data_import.double_click_in_the_calendar_view', ' | def __init__(self): self._app_path = os.getcwd() self._options = { 'tbox_data': '.', # raw .perf files 'html_data': '.', # where to output generated .html 'perf_data': '.', # where to store processed data 'verbose': False, 'debug': False, 'cleanup': False, # remove .perf files when processed 'c... |
('perf_stamp_as_event', 'Stamp'), | ('perf_stamp_as_event.change_the_event_stamp', 'Stamp'), | def __init__(self): self._app_path = os.getcwd() self._options = { 'tbox_data': '.', # raw .perf files 'html_data': '.', # where to output generated .html 'perf_data': '.', # where to store processed data 'verbose': False, 'debug': False, 'cleanup': False, # remove .perf files when processed 'c... |
'new_event_from_file_menu_for_performance': 1, 'new_event_by_double_clicking_in_the_cal_view_for_performance': 1, 'test_new_calendar_for_performance': 1, 'importing_3000_event_calendar': 30, | 'new_event_from_file_menu_for_performance.event_creation': 1, 'new_event_by_double_clicking_in_the_cal_view_for_performance.double_click_in_the_calendar_view': 1, 'test_new_calendar_for_performance.collection_creation': 1, 'importing_3000_event_calendar.import_large_calendar': ... | def __init__(self): self._app_path = os.getcwd() self._options = { 'tbox_data': '.', # raw .perf files 'html_data': '.', # where to output generated .html 'perf_data': '.', # where to store processed data 'verbose': False, 'debug': False, 'cleanup': False, # remove .perf files when processed 'c... |
'creating_new_event_from_the_file_menu_after_large_data_import': 1, 'creating_a_new_event_in_the_cal_view_after_large_data_import': 1, | 'creating_new_event_from_the_file_menu_after_large_data_import.event_creation': 1, 'creating_a_new_event_in_the_cal_view_after_large_data_import.double_click_in_the_calendar_view': 1, | def __init__(self): self._app_path = os.getcwd() self._options = { 'tbox_data': '.', # raw .perf files 'html_data': '.', # where to output generated .html 'perf_data': '.', # where to store processed data 'verbose': False, 'debug': False, 'cleanup': False, # remove .perf files when processed 'c... |
'perf_stamp_as_event': 1, | 'perf_stamp_as_event.change_the_event_stamp': 1, | def __init__(self): self._app_path = os.getcwd() self._options = { 'tbox_data': '.', # raw .perf files 'html_data': '.', # where to output generated .html 'perf_data': '.', # where to store processed data 'verbose': False, 'debug': False, 'cleanup': False, # remove .perf files when processed 'c... |
if isinstance(self.source, MultiCollection): | trash = schema.ns('osaf.pim', self.itsView).trashCollection if (isinstance(self.source, MultiCollection) and trash not in self.source.sources): | def __init__(self, *args, **kwds): |
trash = schema.ns('osaf.pim', self.itsView).trashCollection | def __init__(self, *args, **kwds): | |
class CanvasBitmapButton(wx.BitmapButton): | class CanvasBitmapButton(wx.lib.buttons.GenBitmapButton): | def UpdateSize(self): """ Sizes the button to just fit the bitmap """ |
Currently does not work well on MacOSX: wxWidgets doesn't implement a button with no border. | Currently, the wx.BitmapButton does not work well on MacOSX: wxWidgets doesn't implement a button with no border. Ideally, we would use a "proper" bitmap button that actually generated a accurate masked area, | def UpdateSize(self): """ Sizes the button to just fit the bitmap """ |
self.SetBackgroundColour("white") | def __init__(self, parent, name): """ | |
for dt in itertools.islice(event.rruleset, MAXRECUR): | isDate = type(event.dtstart[0].value) == datetime.date if isDate: recurrenceIter = [event.dtstart[0].value] else: recurrenceIter = itertools.islice(event.rruleset, MAXRECUR) for dt in recurrenceIter: | 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. |
print 'from script.py debug=%s, mask=%s' % (testDebug, testMask) | def run_startup_script_with_symbols(view, builtIns): global global_cats_profiler if Globals.options.testScripts: try: for aScript in Script.iterItems(view): if aScript.test: aScript.execute() finally: # run the cleanup script schema.ns('osaf.app', view).CleanupAfterTests.execute() # Execute new framework if chandlerTe... | |
doDistribution(releaseMode, workingDir, log, outputDir, buildVersion, buildVersionEscaped, distOption, hardhatScript) | doDistribution(releaseMode, workingDir, log, outputDir, buildVersion, buildVersionEscaped, hardhatScript) | 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... |
def doDistribution(releaseMode, workingDir, log, outputDir, buildVersion, buildVersionEscaped, distOption, hardhatScript): | def doDistribution(releaseMode, workingDir, log, outputDir, buildVersion, buildVersionEscaped, hardhatScript): | def doDistribution(releaseMode, workingDir, log, outputDir, buildVersion, buildVersionEscaped, distOption, hardhatScript): # Create end-user, developer distributions print "Making distribution files for " + releaseMode log.write(separator) log.write("Making distribution files for " + releaseMode + "\n") if releaseMod... |
if not hasattr (self, "hoverRow"): | if not hasattr (self, "hoverImageRow"): | def OnMouseEvents (self, event): """ This code is tricky, tred with care -- DJA """ event.Skip() #Let the grid also handle the event gridWindow = self.GetGridWindow() |
self.hoverRow = row | self.hoverImageRow = row | def OnMouseEvents (self, event): """ This code is tricky, tred with care -- DJA """ event.Skip() #Let the grid also handle the event gridWindow = self.GetGridWindow() |
elif hasattr (self, "hoverRow"): | elif hasattr (self, "hoverImageRow"): | def OnMouseEvents (self, event): """ This code is tricky, tred with care -- DJA """ event.Skip() #Let the grid also handle the event gridWindow = self.GetGridWindow() |
del self.hoverRow | del self.hoverImageRow | def OnMouseEvents (self, event): """ This code is tricky, tred with care -- DJA """ event.Skip() #Let the grid also handle the event gridWindow = self.GetGridWindow() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.