rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
displayName=_(u"All My Items"), | displayName=_(u"My items"), | def GetColorForHue (hue): rgb = wx.Image.HSVtoRGB (wx.Image_HSVValue (hue / 360.0, 0.5, 1.0)) return ColorType (rgb.red, rgb.green, rgb.blue, 255) |
self._showStatus(_(u"Sharing Error:\n%(error)s") % {'error': err}) | if err.message.startswith("DNS lookup failed"): msg = _(u"Unable to look up that server's address via DNS") elif err.message.startswith("Connection was refused by other side"): msg = _(u"Connection refused by server") else: msg = err.message self._showStatus(_(u"Sharing Error:\n%(error)s") % {'error': msg}) | def _shareError(self, err): |
busyInfo = wx.BusyInfo (_("Quitting...")) | def OnClose(self, event): """ Main window is about to be closed when the application is quitting. """ # Finish any edits in progress. from osaf.framework.blocks.Block import Block Block.finishEdits() | |
del busyInfo busyInfo = wx.BusyInfo (_("Stopping wakeup service...")) | def OnClose(self, event): """ Main window is about to be closed when the application is quitting. """ # Finish any edits in progress. from osaf.framework.blocks.Block import Block Block.finishEdits() | |
del busyInfo busyInfo = wx.BusyInfo (_("Stopping twisted...")) | def OnClose(self, event): """ Main window is about to be closed when the application is quitting. """ # Finish any edits in progress. from osaf.framework.blocks.Block import Block Block.finishEdits() | |
del busyInfo busyInfo = wx.BusyInfo (_("Stopping crypto...")) | def OnClose(self, event): """ Main window is about to be closed when the application is quitting. """ # Finish any edits in progress. from osaf.framework.blocks.Block import Block Block.finishEdits() | |
self.grid.SetColLabelValue(1, _("End Time")) | self.grid.SetColLabelValue(1, _("Duration")) | def OnInit(self, model): self.model = model self.grid = wxGrid(self, -1) self._loadEvents() self.grid.CreateGrid(100, 3) # self.grid.SetColLabelSize(0) self.grid.SetColLabelValue(0, _("Start Time")) self.grid.SetColLabelValue(1, _("End Time")) self.grid.SetColLabelValue(2, _("Headline")) self.grid.SetRowLabelSize(0) ... |
factory.protocol = _TwistedESMTPSender factory.testing = testing | factory.protocol = _TwistedESMTPSender factory.testing = testing if NAME_OR_ADDRESS: factory.domain = NAME_OR_ADDRESS | def _sendingMail(self, from_addr, to_addrs, messageText, deferred, testing=False): if __debug__: trace("_sendingMail") |
timeFormatter = DateFormat.createTimeInstance() hourFP = FieldPosition(DateFormat.HOUR1_FIELD) | timeFormatter = DateFormat.createTimeInstance(DateFormat.SHORT) | def GetLocaleHourStrings(self, hourrange, dc): """ 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() for hour in hourrange: timedate = time(hour=hour) hourdate = datetime.com... |
for fieldID in (DateFormat.HOUR1_FIELD, DateFormat.HOUR_OF_DAY1_FIELD, DateFormat.HOUR0_FIELD, DateFormat.HOUR_OF_DAY0_FIELD): hourFP = FieldPosition(fieldID) timeString = timeFormatter.format(datetime.combine(dummyDate, time(hour=16)), hourFP) if hourFP.getBeginIndex() != hourFP.getEndIndex(): break assert hourFP.g... | def GetLocaleHourStrings(self, hourrange, dc): """ 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() for hour in hourrange: timedate = time(hour=hour) hourdate = datetime.com... | |
hourString = str(timeString)[start:end] | hourString = unicode(timeString)[start:end] | def GetLocaleHourStrings(self, hourrange, dc): """ 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() for hour in hourrange: timedate = time(hour=hour) hourdate = datetime.com... |
item = self.GetItem() | item = self.GetItem().getMaster() | def CanDrag(self): item = self.GetItem() return (item.isAttributeModifiable('startTime') and item.isAttributeModifiable('duration')) |
item = self.GetItem() | item = self.GetItem().getMaster() | def CanChangeTitle(self): item = self.GetItem() return item.isAttributeModifiable('displayName') |
EVT_ERASE_BACKGROUND (self, self.OnEraseBackground) | if wxPlatform == '__WXMSW__': EVT_ERASE_BACKGROUND (self, self.OnEraseBackground) | def Setup(self, model, resources): """ Set up model and resources for the convience of the parcel. OnInit gives the parcel a chance to wire up their events. """ self.model = model self.resources = resources self.OnInit() EVT_ERASE_BACKGROUND (self, self.OnEraseBackground) |
item._references[name]._mergeChanges(oldVersion, toVersion) merged.append(dirties.hash(name)) | value = item._references.get(name, None) if value is not None and value._isRefList(): value._mergeChanges(oldVersion, toVersion) merged.append(dirties.hash(name)) | def _mergeRDIRTY(self, item, dirties, oldVersion, toVersion): |
self.finishSelectionChanges () | def onSelectionChangedEvent (self, notification): """ We have an event boundary inside us, which keeps all the events sent between blocks of the Detail View to ourselves. When we get a SelectionChanged event, we jump across the event boundary and call synchronizeItemDetail on each block to give it a chance to synchroni... | |
def finishSelectionChanges (self): """ Need to finish any changes to the selected item that are in progress. """ focusBlock = self.getFocusBlock() try: focusBlock.saveFocusData() except AttributeError: pass | def onNULLEventUpdateUI (self, notification): """ The NULL Event is always disabled """ notification.data ['Enable'] = False | |
widget.Bind(wx.EVT_KILL_FOCUS, self.onLoseFocus) | widget.Bind(wx.EVT_KILL_FOCUS, self.saveDataAndSkip) widget.Bind(wx.EVT_KEY_UP, self.saveDataAndSkip) | def instantiateWidget (self): widget = super (EditTextAttribute, self).instantiateWidget() # We need to save off the changed widget's data into the block periodically # Hopefully OnLoseFocus is getting called every time we lose focus. widget.Bind(wx.EVT_KILL_FOCUS, self.onLoseFocus) return widget |
def onKeyUp (self, event): self.saveTextValue() | def instantiateWidget (self): widget = super (EditTextAttribute, self).instantiateWidget() # We need to save off the changed widget's data into the block periodically # Hopefully OnLoseFocus is getting called every time we lose focus. widget.Bind(wx.EVT_KILL_FOCUS, self.onLoseFocus) return widget | |
def saveFocusData (self): | def saveDataAndSkip (self, event): | def saveFocusData (self): # called to save away the data in the UI focus block self.saveTextValue() |
def onLoseFocus (self, event): self.saveFocusData() | def saveFocusData (self): # called to save away the data in the UI focus block self.saveTextValue() | |
elif dataFormat.GetType() == \ self.dataFormats[OUTLOOK_EXPRESS_DRAG_FORMAT].GetType(): | elif dataFormat == self.dataFormats[OUTLOOK_EXPRESS_DRAG_FORMAT]: | def PasteData(self, data): """ Determine what kind of object is in data, paste accordingly. """ dataFormat = None for format in data.GetAllFormats(): if data.GetDataSize(format) > 0: dataFormat = format if dataFormat is not None: if dataFormat.GetType() == self.fileFormat.GetType(): self.OnFilePaste() elif dataFormat.G... |
def _getDisplayNameForShare(self, share): container = self._getContainerResource() try: result = container.serverHandle.blockUntil(container.getDisplayName) except: result = "" return result or super(WebDAVConduit, self)._getDisplayNameForShare(share) return result | def _getContainerResource(self): | |
valid = panel["validationHandler"](item, panel['fields'], values) if not valid: | invalidMessage = panel["validationHandler"](item, panel['fields'], values) if invalidMessage: | def __Validate(self): # Call any custom validation handlers that might be defined |
coll = pim.ListCollection(itsView = repView).setup() | def fillCollectionFromFlickr(self, repView): """ Fills the collection with photos from the flickr website. """ coll = pim.ListCollection(itsView = repView).setup() if self.userName: flickrUserName = flickr.people_findByUsername(self.userName.encode('utf8')) flickrPhotos = flickr.people_getPublicPhotos(flickrUserName.id... | |
assert (False) userdata = self.itsView.findPath ("//userdata") userdata = self.itsView.findPath ("//userdata") | assert(False, "we should have either a userName or tag") | def fillCollectionFromFlickr(self, repView): """ Fills the collection with photos from the flickr website. """ coll = pim.ListCollection(itsView = repView).setup() if self.userName: flickrUserName = flickr.people_findByUsername(self.userName.encode('utf8')) flickrPhotos = flickr.people_getPublicPhotos(flickrUserName.id... |
lambda UUID: cmp(flickrPhoto.id, repView[UUID].flickrID)) | lambda uuid: cmp(flickrPhoto.id, repView.findValue(uuid, 'flickrID'))) | def fillCollectionFromFlickr(self, repView): """ Fills the collection with photos from the flickr website. """ coll = pim.ListCollection(itsView = repView).setup() if self.userName: flickrUserName = flickr.people_findByUsername(self.userName.encode('utf8')) flickrPhotos = flickr.people_getPublicPhotos(flickrUserName.id... |
photoItem = FlickrPhoto(photo=flickrPhoto, itsView=repView, itsParent=userdata) | photoItem = FlickrPhoto(photo=flickrPhoto, itsView=repView, itsParent=repView['userdata']) | def fillCollectionFromFlickr(self, repView): """ Fills the collection with photos from the flickr website. """ coll = pim.ListCollection(itsView = repView).setup() if self.userName: flickrUserName = flickr.people_findByUsername(self.userName.encode('utf8')) flickrPhotos = flickr.people_getPublicPhotos(flickrUserName.id... |
class UpdateTask: | class UpdateTask(object): | def fillCollectionFromFlickr(self, repView): """ Fills the collection with photos from the flickr website. """ coll = pim.ListCollection(itsView = repView).setup() if self.userName: flickrUserName = flickr.people_findByUsername(self.userName.encode('utf8')) flickrPhotos = flickr.people_getPublicPhotos(flickrUserName.id... |
def __getattr__(self, key): try: return self.__dict__[key] except KeyError: pass try: return self.__getitem__(key) except: raise AttributeError, "object has no attribute '%s'" % key | def __getitem__(self, key): if key == 'channel': key = 'feed' if key == 'items': key = 'entries' return UserDict.__getitem__(self, key) | |
matchKey += " : %s" % dateStr | matchKey = cls.textMatches[matchKey]+ " : %s" % dateStr | def parseDate(cls, target): """Parses Natural Language date strings using parsedatetime library.""" target = target.lower() for matchKey in cls.textMatches: #natural language string for date found if ((cls.textMatches[matchKey]).lower()).startswith(target): cal = parsedatetime.Calendar() (dateVar, invalidFlag) = cal.pa... |
matchKey += " - %s" %timeVar | matchKey = cls.textMatches[matchKey]+ " - %s" %timeVar | def parseTime(cls, target): """Parses Natural Language time strings using parsedatetime library.""" target = target.lower() for matchKey in cls.textMatches: #natural language time string found if ((cls.textMatches[matchKey]).lower()).startswith(target): cal = parsedatetime.Calendar() (timeVar, invalidFlag) = cal.parse(... |
textkind = rep.findPath("//Schema/Core/Text") | textkind = rep.findPath("//Schema/Core/Lob") | def importICalendar(cal, rep, parent=None): """Import the given vobject vcalendar into rep at the given parent. Currently only grabs vevents, ignores duration, ignores rdates with extra duration information. Also, vobject 0.1 has a bug (argh) that completely ignores recurrence information. Fortunately, this offsets ... |
def GetStatusPen(self, styles): | def GetStatusPen(self, color): | def GetStatusPen(self, styles): # probably should use styles to determine a good pen color item = self.GetItem() eventColors = styles.blockItem.getEventColors(item) color = eventColors.outlineColor if (item.transparency == "confirmed"): pen = wx.Pen(color, 4) elif (item.transparency == "fyi"): pen = wx.Pen(color, 1) el... |
eventColors = styles.blockItem.getEventColors(item) color = eventColors.outlineColor | def GetStatusPen(self, styles): # probably should use styles to determine a good pen color item = self.GetItem() eventColors = styles.blockItem.getEventColors(item) color = eventColors.outlineColor if (item.transparency == "confirmed"): pen = wx.Pen(color, 4) elif (item.transparency == "fyi"): pen = wx.Pen(color, 1) el... | |
def Draw(self, dc, boundingRect, styles, bitmapBrush): | def Draw(self, dc, boundingRect, styles, selected): | def Draw(self, dc, boundingRect, styles, bitmapBrush): item = self._item |
drawingPen = dc.GetPen() origin = dc.GetDeviceOrigin() newOrigin = copy.copy(origin) | eventColors = styles.blockItem.getEventColors(item) if selected: penColor = eventColors.selectedOutlineColor gradientLeft = eventColors.selectedGradientLeft gradientRight = eventColors.selectedGradientRight textColor = eventColors.selectedTextColor else: penColor = eventColors.outlineColor gradientLeft = eventColors.gr... | def Draw(self, dc, boundingRect, styles, bitmapBrush): item = self._item |
newOrigin.x += itemRect.x dc.SetDeviceOriginPoint(newOrigin) itemRect = copy.copy(itemRect) itemRect.x = 0 brush = wx.Brush(wx.WHITE,wx.STIPPLE) brush.SetStipple(bitmapBrush) | brush = styles.GetGradientBrush(itemRect.x, itemRect.width, gradientLeft, gradientRight) dc.SetPen(wx.Pen(penColor)) | def Draw(self, dc, boundingRect, styles, bitmapBrush): item = self._item |
dc.SetPen(drawingPen) | def Draw(self, dc, boundingRect, styles, bitmapBrush): item = self._item | |
pen = self.GetStatusPen(styles) | pen = self.GetStatusPen(penColor) | def Draw(self, dc, boundingRect, styles, bitmapBrush): item = self._item |
dc.SetDeviceOriginPoint(origin) | def Draw(self, dc, boundingRect, styles, bitmapBrush): item = self._item | |
def Draw(self, dc, styles): | def Draw(self, dc, styles, selected): | def Draw(self, dc, styles): item = self._item itemRect = self._bounds dc.DrawRectangleRect(itemRect) # draw little rectangle to the left of the item pen = self.GetStatusPen(styles) pen.SetCap(wx.CAP_BUTT) dc.SetPen(pen) dc.DrawLine(itemRect.x + 2, itemRect.y + 3, itemRect.x + 2, itemRect.y + itemRect.height - 3) # ... |
pen = self.GetStatusPen(styles) | pen = self.GetStatusPen(eventColors.outlineColor) | def Draw(self, dc, styles): item = self._item itemRect = self._bounds dc.DrawRectangleRect(itemRect) # draw little rectangle to the left of the item pen = self.GetStatusPen(styles) pen.SetCap(wx.CAP_BUTT) dc.SetPen(pen) dc.DrawLine(itemRect.x + 2, itemRect.y + 3, itemRect.x + 2, itemRect.y + itemRect.height - 3) # ... |
def MakeGradientBitmap(self, width, leftColor, rightColor): | def MakeGradientBrush(self, offset, width, leftColor, rightColor): | def MakeGradientBitmap(self, width, leftColor, rightColor): """ Creates a gradient brush from leftColor to rightColor, specified as color tuples (r,g,b) The brush is a bitmap, width of self.dayWidth, height 1. The color gradient is made by varying the color saturation from leftColor to rightColor. This means that the H... |
bits = "" | offset %= bitmapWidth | def MakeGradientBitmap(self, width, leftColor, rightColor): """ Creates a gradient brush from leftColor to rightColor, specified as color tuples (r,g,b) The brush is a bitmap, width of self.dayWidth, height 1. The color gradient is made by varying the color saturation from leftColor to rightColor. This means that the H... |
pixel = x % width sat = satStart + satStep*pixel | gradientIndex = (x - offset + bitmapWidth) % bitmapWidth gradientIndex %= width sat = satStart + satStep*gradientIndex | def MakeGradientBitmap(self, width, leftColor, rightColor): """ Creates a gradient brush from leftColor to rightColor, specified as color tuples (r,g,b) The brush is a bitmap, width of self.dayWidth, height 1. The color gradient is made by varying the color saturation from leftColor to rightColor. This means that the H... |
return wx.BitmapFromImage(image) def GetGradientBitmap(self, width, leftColor, rightColor): | bitmap = wx.BitmapFromImage(image) brush = wx.Brush(wx.WHITE, wx.STIPPLE) brush.SetStipple(bitmap) return brush def GetGradientBrush(self, offset, width, leftColor, rightColor): | def MakeGradientBitmap(self, width, leftColor, rightColor): """ Creates a gradient brush from leftColor to rightColor, specified as color tuples (r,g,b) The brush is a bitmap, width of self.dayWidth, height 1. The color gradient is made by varying the color saturation from leftColor to rightColor. This means that the H... |
key = (width, leftColor, rightColor) bitmap = self._gradientCache.get(key, None) if not bitmap: bitmap = self.MakeGradientBitmap(*key) self._gradientCache[key] = bitmap return bitmap | key = (offset, width, leftColor, rightColor) brush = self._gradientCache.get(key, None) if not brush: brush = self.MakeGradientBrush(*key) self._gradientCache[key] = brush return brush | def GetGradientBitmap(self, width, leftColor, rightColor): """ Gets an appropriately sized gradient brush from the cache, or creates one if necessary """ key = (width, leftColor, rightColor) bitmap = self._gradientCache.get(key, None) if not bitmap: bitmap = self.MakeGradientBitmap(*key) self._gradientCache[key] = bitm... |
dc.SetPen(wx.TRANSPARENT_PEN) dc.SetBrush(wx.WHITE_BRUSH) | def DrawCells(self, dc): styles = self.parent | |
dc.SetPen(wx.TRANSPARENT_PEN) | def DrawCells(self, dc): styles = self.parent | |
eventColors = styles.blockItem.getEventColors(item) dc.SetTextForeground(eventColors.textColor) canvasItem.Draw(dc, styles) | canvasItem.Draw(dc, styles, False) | def DrawCells(self, dc): styles = self.parent |
eventColors = styles.blockItem.getEventColors(selectedBox.GetItem()) dc.SetPen(wx.Pen(eventColors.selectedOutlineColor)) bitmap = styles.GetGradientBitmap(self.parent.dayWidth, eventColors.selectedGradientLeft, eventColors.selectedGradientRight) brush = wx.Brush(wx.WHITE,wx.STIPPLE) brush.SetStipple(bitmap) dc.SetBrush... | selectedBox.Draw(dc, styles, True) | def DrawCells(self, dc): styles = self.parent |
eventColors = styles.blockItem.getEventColors(item) dc.SetPen(wx.Pen(eventColors.outlineColor)) bitmap = styles.GetGradientBitmap(self.dayWidth, eventColors.gradientLeft, eventColors.gradientRight) dc.SetTextForeground(eventColors.textColor) canvasItem.Draw(dc, boundingRect, styles, bitmap) | canvasItem.Draw(dc, boundingRect, styles, False) | def DrawCells(self, dc): styles = self.parent # Set up fonts and brushes for drawing the events dc.SetTextForeground(wx.BLACK) dc.SetBrush(wx.WHITE_BRUSH) |
item = selectedBox.GetItem() eventColors = styles.blockItem.getEventColors(item) dc.SetPen(wx.Pen(eventColors.selectedOutlineColor)) bitmap = styles.GetGradientBitmap(self.dayWidth, eventColors.selectedGradientLeft, eventColors.selectedGradientRight) dc.SetTextForeground(eventColors.selectedTextColor) selectedBox.Draw(... | selectedBox.Draw(dc, boundingRect, styles, True) | def DrawCells(self, dc): styles = self.parent # Set up fonts and brushes for drawing the events dc.SetTextForeground(wx.BLACK) dc.SetBrush(wx.WHITE_BRUSH) |
print "in PhotoCollection.update()" | def update(self,repView): print "in PhotoCollection.update()" self.getCollectionFromFlickr(repView) | |
refDict = self._refDict(name, self.getOtherName(name)) | refDict = item._refDict(name, self.getOtherName(name)) | def getInitialValues(self, item, values, references): |
allCollection = schema.ns("osaf.app", self.view).allCollection | allCollection = schema.ns("osaf.app", view).allCollection | def importProcess(self, text, extension=None, item=None, changes=None, previousView=None, updateCallback=None): # the item parameter is so that a share item can be passed in for us # to populate. |
event.m_shiftDown = shiftFlag | event.m_shiftDown = char.isupper() or shiftFlag | def set_event_info(event): # setup event info for a keypress event event.m_keyCode = keyCode event.m_rawCode = keyCode event.m_shiftDown = shiftFlag event.m_controlDown = event.m_metaDown = ctrlFlag event.m_altDown = altFlag event.SetEventObject(widget) |
elif format == EMAIL_FORMAT: | elif format in (EMAIL_FORMAT, EMAILX_FORMAT): | def importFileAsFormat(format, filename, view, coll=None, selectedCollection=False): """ Import file, return the item that's imported, or None for multiple items. """ if format == ICALENDAR_FORMAT: osaf.sharing.ICalendar.importICalendarFile(filename, view, coll, selectedCollection = selectedCollection) return None elif... |
text = fp.read() | size = -1 if format == EMAILX_FORMAT: size = int(fp.readline()) text = fp.read(size) | def importFileAsFormat(format, filename, view, coll=None, selectedCollection=False): """ Import file, return the item that's imported, or None for multiple items. """ if format == ICALENDAR_FORMAT: osaf.sharing.ICalendar.importICalendarFile(filename, view, coll, selectedCollection = selectedCollection) return None elif... |
parent = parcel_for_module(cls.__module__, view) item = parent.getItemChild(cls.__name__) if isinstance(item, AnnotationItem): return item | parent = view.findPath(ModuleMaker(cls.__module__).getPath()) if parent is not None: item = parent.getItemChild(cls.__name__) if isinstance(item, AnnotationItem): return item | def _find_schema_item(cls, view): parent = parcel_for_module(cls.__module__, view) item = parent.getItemChild(cls.__name__) if isinstance(item, AnnotationItem): return item |
cls.__name__, parcel_for_module(cls.__module__, view), | "tmp_"+cls.__name__, view | def _create_schema_item(cls, view): return AnnotationItem( cls.__name__, parcel_for_module(cls.__module__, view), ) |
python = buildenv['python_d'] hardhatlib.executeCommand( buildenv, info['name'], [python, "setup.py", "build", "--debug"], "Building UUID Extension" ) if buildenv['version'] == 'release': python = buildenv['python'] hardhatlib.executeCommand( buildenv, info['name'], [python, "setup.py", "build"], "Building UUID Extensi... | hardhatlib.executeCommand(buildenv, info['name'], [buildenv['python_d'], 'setup.py', 'build', '--build-base=build_debug', '--debug', 'install', '--force'], "Building and installing UUIDext debug") | def build(buildenv): # Build the linux launcher program if buildenv['os'] == 'posix': os.chdir("distrib/linux/launcher") if buildenv['version'] == 'release': hardhatlib.executeCommand( buildenv, info['name'], [buildenv['make']], "Making launcher programs") hardhatlib.copyFile("chandler_bin", buildenv['root'] + \ os.se... |
self.widget.Refresh() | if hasattr(self, 'widget'): self.widget.Refresh() | def onSelectItemsEvent(self, event): """ Sets the block selection |
doBuild(releaseMode, workingDir, log, cvsChanges, clean='') | doBuild(releaseMode, workingDir, log, cvsChanges, clean) | def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log, skipTests=False, upload=False): global buildenv, changes try: buildenv = hardhatlib.defaults buildenv['root'] = workingDir buildenv['hardhatroot'] = whereAmI hardhatlib.init(buildenv) except hardhatlib.HardHatMissingCompilerError: print "Co... |
doBuild(releaseMode, workingDir, log, cvsChanges) | doBuild(releaseMode, workingDir, log, cvsChanges, clean) | def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log, skipTests=False, upload=False): global buildenv, changes try: buildenv = hardhatlib.defaults buildenv['root'] = workingDir buildenv['hardhatroot'] = whereAmI hardhatlib.init(buildenv) except hardhatlib.HardHatMissingCompilerError: print "Co... |
self.username, self.password, self.account.useSSL) | self.username, self.password, self.useSSL) | def __getSettings(self): if self.account is None: return (self.host, self.port, self.sharePath.strip("/"), self.username, self.password, self.account.useSSL) else: return (self.account.host, self.account.port, self.account.path.strip("/"), self.account.username, self.account.password, self.account.useSSL) |
item = self.item | item = getattr(self.item, 'proxiedItem', self.item) | def watchForChanges(self): if not hasattr(self, 'widget'): return assert not hasattr(self.widget, 'watchedAttributes') attrsToMonitor = self.attributesToMonitor() if attrsToMonitor is not None: # Map the attributes to the real attributes they're based on # (this isn't a list comprehension because we're relying on the #... |
self.itsView.unwatchItem(self, self.item, 'onWatchedItemChanged') | item = getattr(self.item, 'proxiedItem', self.item) self.itsView.unwatchItem(self, item, 'onWatchedItemChanged') | def stopWatchingForChanges(self): try: watchedAttributes = self.widget.watchedAttributes except AttributeError: pass else: if watchedAttributes is not None: #logger.debug('%s: stopping watching for changes in %s' % #(debugName(self), watchedAttributes)) self.itsView.unwatchItem(self, self.item, 'onWatchedItemChanged') ... |
ch2.AddItem( -1, v, wx.colheader.CH_JUST_Left + i, 90, 0, 1, 1 ) | ch2.AddItem( -1, v, textJusts[i], 90, 0, 1, 1 ) | def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log |
self.log.write( "Control %d:" %(self.ch1.GetId()) ) self.ch1.DumpInfo() self.log.write( "Control %d:" %(self.ch2.GetId()) ) self.ch2.DumpInfo() self.log.write( "Control %d:" %(self.ch3.GetId()) ) self.ch3.DumpInfo() | self.ch1.DumpInfo( "Control %d:" %(self.ch1.GetId()) ) self.ch2.DumpInfo( "Control %d:" %(self.ch2.GetId()) ) self.ch3.DumpInfo( "Control %d:" %(self.ch3.GetId()) ) | def OnButtonDumpInfo( self, event ): # self.log.write( "OnButtonDumpInfo" ) self.log.write( "Control %d:" %(self.ch1.GetId()) ) self.ch1.DumpInfo() self.log.write( "Control %d:" %(self.ch2.GetId()) ) self.ch2.DumpInfo() self.log.write( "Control %d:" %(self.ch3.GetId()) ) self.ch3.DumpInfo() |
rsyncServer + ":continuous/" + buildNameNoSpaces]) | options.rsyncServer + ":continuous/" + buildNameNoSpaces]) | def main(): global buildscriptFile, fromAddr, mailtoAddr, alertAddr, adminAddr, defaultDomain, defaultRsyncServer parser = OptionParser(usage="%prog [options] buildName", version="%prog 1.2") parser.add_option("-t", "--toAddr", action="store", type="string", dest="toAddr", default=mailtoAddr, help="Where to mail scrip... |
self.getPlainTextReader(), uuid, | reader, uuid, | def _writeData(self, uuid, store, db): |
os.putenv('WXWIN', os.getcwd()) | os.putenv('WXWIN', buildenv['root_dos'] + "\\..\\..\\internal\\wx\\wxPython-2.5") | def build(buildenv): version = buildenv['version'] if buildenv['os'] in ('osx', 'posix'): # Create the build directory buildDir = os.path.abspath("build_%s" % version) if os.access(buildDir, os.F_OK): hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Temporary build directory exists: " + buildDir... |
logger.setLevel(logging.WARNING) | logger.setLevel(logging.INFO) | def initLogging(options): global logger if logger is None: # Make PROFILEDIR available within the logging config file logging.PROFILEDIR = options.profileDir logConfFile = options.logging if os.path.isfile(logConfFile): # Replacing the standard fileConfig with our own, below # logging.config.fileConfig(options.loggin... |
def Destroy(self): pass | def Destroy(self): #super (wxMiniCalendar, self).Destroy() pass | |
from DynamicContainerBlocks import Toolbar as Toolbar | def wxSynchronizeWidget(self, *arguments, **keywords): from DynamicContainerBlocks import Toolbar as Toolbar selectedChoice = self._getSelectedChoice() if selectedChoice != self.blockItem.selection: for childBlock in self.blockItem.childrenBlocks: if not isinstance(childBlock, Toolbar): childBlock.parentBlock = None if... | |
from DynamicContainerBlocks import Toolbar as Toolbar | def _getSelectedChoice(self): from DynamicContainerBlocks import Toolbar as Toolbar index = 0 for childBlock in self.blockItem.childrenBlocks: if isinstance(childBlock, Toolbar): for toolbarItem in childBlock.widget.toolItemList: if childBlock.widget.GetToolState(toolbarItem.widget.GetId()): return index index += 1 # I... | |
props += makePropString(name, namespace, atype.makeString(value)) | try: dataString = value.getReader().read() except AttributeError: dataString = value props += makePropString(name, namespace, dataString) | 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... |
def __init__(self, *args, **kwds): super(ItemCollection, self).__init__(*args, **kwds) | def __init__(self, name=None, parent=None, kind): if not parent: parent = Globals.repository.findPath('//userdata/contentitems') super(ItemCollection, self).__init__(name, parent, kind) | def __init__(self, *args, **kwds): super(ItemCollection, self).__init__(*args, **kwds) |
self.inclusions.remove(item.itsUUID) | uuid = item.itsUUID self.inclusions.remove(uuid) | def removeInclusion(self, item): self.inclusions.remove(item.itsUUID) |
formattedBacktrace = "".join(backtrace[-frames:]) message = ("Chandler encountered an unexpected problem while trying to start.\n" + \ "Here are the bottom %s frames of the stack:\n%s") % (frames - 1, formattedBacktrace) logging.error(message) | line2 = _(u"Here are the bottom %(frames)s frames of the stack:\n") % {'frames': frames - 1} line3 = _(u"The clipboard contains the stack trace.\n") shortMessage = "".join ([line1, line2, "\n"] + backtrace[-frames:] + ["\n", line3]) | def realMain(): Utility.initProfileDir(Globals.options) Globals.chandlerDirectory = Utility.locateChandlerDirectory() os.chdir(Globals.chandlerDirectory) Utility.initLogging(Globals.options) Utility.initI18n(Globals.options) |
dialog = wx.MessageDialog(None, message, "Chandler", | dialog = wx.MessageDialog(None, shortMessage, "Chandler", | def realMain(): Utility.initProfileDir(Globals.options) Globals.chandlerDirectory = Utility.locateChandlerDirectory() os.chdir(Globals.chandlerDirectory) Utility.initLogging(Globals.options) Utility.initI18n(Globals.options) |
def __str__(self): return self.__doc__ %(self.getItem()._repr_()) class NoParentError(ValueError, ItemError): 'While creating %s, parent is None' | def __str__(self): return self.__doc__ %(self.getItem().itsPath, self.args[1]) | |
class NoSuchDefaultParentError(SchemaError): 'While creating %s, defaultParent %s, specified on kind %s, was not found' def __str__(self): kind = self.args[1] return self.__doc__ %(self.str(self.getItem()), kind._values['defaultParent'], kind.itsPath) | def __str__(self): return self.args[0] % self.args[1:] | |
self.loadParcel("http://osafoundation.org/parcels/osaf/contentmodel") | self.loadParcel("http://osafoundation.org/parcels/osaf/contentmodel/calendar") | def testRule(self): import logging log = logging.getLogger("Test") log.setLevel(logging.DEBUG) |
if level: buf.write(pad + "modification. modifies: %s modificationFor: %s\n"\ % (self.modifies, self.modificationFor.startTime)) buf.write(pad + "event is: %s %s\n" % (self.displayName, self.startTime)) | try: if level: buf.write(pad + "modification. modifies: %s modificationFor: %s\n"\ % (self.modifies, self.modificationFor.startTime)) buf.write(pad + "event is: %s %s\n" % (self.displayName, self.startTime)) except: pass | def serializeMods(self, level=0, buf=None): if buf is None: buf = StringIO.StringIO() pad = " " * level if level: buf.write(pad + "modification. modifies: %s modificationFor: %s\n"\ % (self.modifies, self.modificationFor.startTime)) buf.write(pad + "event is: %s %s\n" % (self.displayName, self.startTime)) if self.mod... |
None) or item._repr_()).encode('utf8', 'replace') logger.info("...imported '%s' '%s' %s, data: %s" % \ (itemPath, displayName, item, data)) | None) or item._repr_()) debugString = u"...imported '%s' '%s' %s, data: %s" % \ (itemPath, displayName, item, data) logger.info(debugString.encode('utf8', 'replace')) | def _conditionalGetItem(self, contentView, itemPath, into=None, updateCallback=None, stats=None): """ Get an item from the server if we don't yet have it or our copy is out of date """ |
logger.error("...NOT able to import '%s'" % itemPath) | logger.error("...NOT able to import '%s'" % itemPath.encode('utf8', 'replace')) | def _conditionalGetItem(self, contentView, itemPath, into=None, updateCallback=None, stats=None): """ Get an item from the server if we don't yet have it or our copy is out of date """ |
item.endTime, indent, width)) | item.endTime, width, indent)) | def UpdateDrawingRects(self): item = self.GetItem() dayWidth = self._calendarCanvas.dayWidth if self._calendarCanvas.parent.blockItem.dayMode: # in day mode, canvasitems are drawn side-by-side maxDepth = self.GetMaxDepth() width = dayWidth / (maxDepth + 1) indent = width * self.GetIndentLevel() else: # in week mode, st... |
def GenerateBoundsRects(calendarCanvas, startTime, endTime, indent=0, width=0): | def GenerateBoundsRects(calendarCanvas, startTime, endTime, width, indent=0): | def GenerateBoundsRects(calendarCanvas, startTime, endTime, indent=0, width=0): """ Generate a bounds rectangle for each day period. For example, an event that goes from noon monday to noon wednesday would have three bounds rectangles: one from noon monday to midnight one for all day tuesday one from midnight wednesday... |
self._bgSelectionEndTime) | self._bgSelectionEndTime, self.dayWidth) | def DrawBackground(self, dc): styles = self.parent self._doDrawingCalculations() |
class CalendarEvent(CalendarEventMixin, Notes.Note): def __init__(self, name=None, parent=None, kind=None): if not kind: kind = Globals.repository.findPath("//parcels/osaf/contentmodel/calendar/CalendarEvent") super (CalendarEvent, self).__init__(name, parent, kind) self.participants = [] | def InitOutgoingAttributes (self): """ Init any attributes on ourself that are appropriate for a new outgoing item. """ try: super(CalendarEventMixin, self).InitOutgoingAttributes () except AttributeError: pass | |
self.monthButton = CollectionCanvas.CanvasTextButton(self, today.Format("%B %Y"), styles.monthLabelFont, styles.monthLabelColor, styles.bgColor) | self.monthText = wx.StaticText(self, -1) self.monthText.SetFont(styles.monthLabelFont) self.monthText.SetForegroundColour(styles.monthLabelColor) | def OnInit(self): self.SetBackgroundColour(self.parent.bgColor) |
monthSizer.Add(self.monthButton, 0) | monthSizer.Add(self.monthText, 0) | def OnInit(self): self.SetBackgroundColour(self.parent.bgColor) |
self.monthButton.SetLabel(monthText) | self.monthText.SetLabel(monthText) | def wxSynchronizeWidget(self): selectedDate = self.parent.blockItem.selectedDate startDate = self.parent.blockItem.rangeStart |
self.widget.wxSynchronizeWidget() | try: widget = self.widget except AttributeError: pass else: widget.wxSynchronizeWidget () | def onSelectItemEvent(self, event): """ Sets the block selection and synchronizes the widget. """ self.selection = event.arguments['item'] self.widget.wxSynchronizeWidget() |
logger.debug("%s: onSetContentsEvent: %s, %s", debugName(self), event.arguments['item'], event.arguments['collection']) | def onSetContentsEvent (self, event): logger.debug("%s: onSetContentsEvent: %s, %s", debugName(self), event.arguments['item'], event.arguments['collection']) Block.Block.finishEdits() self.setContentsOnBlock(event.arguments['item'], event.arguments['collection']) | |
application.dialogs.AccountPreferences.ShowAccountPreferencesDialog(wx.GetApp().mainFrame, view=self.view, modal=False) | application.dialogs.AccountPreferences.ShowAccountPreferencesDialog(wx.GetApp().mainFrame, rv=self.view, modal=False) | def Open(self): """ Open the Account preferences dialog window in non-modal mode """ # Have to do it the hard way since Account Preferences is modal by default import application application.dialogs.AccountPreferences.ShowAccountPreferencesDialog(wx.GetApp().mainFrame, view=self.view, modal=False) self.window = wx.Find... |
return str (item.itsParent.itsPath) != '//userdata' | return not str(item.itsPath).startswith('//userdata') | def ReadOnly (self, (item, attribute)): return str (item.itsParent.itsPath) != '//userdata' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.