rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
self.parent.blockItem.itsView.commit() | def OnCreateItem(self, unscrolledPosition): # @@@ this code might want to live somewhere else, refactored # if a region is selected, then use that for the event span if (self._bgSelectionStartTime): newTime = self._bgSelectionStartTime duration = self._bgSelectionEndTime - self._bgSelectionStartTime else: newTime = se... | |
def onRemoveItemEvent(self, event): | def onRemoveEvent(self, event): | def onRemoveItemEvent(self, event): """ Permanently remove the collection - we eventually need a user confirmation here """ def deleteItem(item): # TODO: for item collectionsactually call item.delete(), # and also delete any items that exist only in the # doomed itemcollection (garbage collection would be a # big help ... |
onDeleteItemEvent = onRemoveItemEvent | onDeleteEvent = onRemoveEvent | def deleteItem(item): # TODO: for item collectionsactually call item.delete(), # and also delete any items that exist only in the # doomed itemcollection (garbage collection would be a # big help here) |
self._totalConflictDepth = 1 | def __init__(self, *args, **keywords): super(CalendarCanvasItem, self).__init__(*args, **keywords) self._parentConflicts = [] self._childConflicts = [] # the rating of conflicts - i.e. how far to indent this self._conflictDepth = 0 # the total depth of all conflicts - i.e. the maximum simultaneous # conflicts with thi... | |
if not self._parentConflicts: return 0 | def CalculateConflictDepth(self): if not self._parentConflicts: return 0 # We'll find out the depth of all our parents, and then # see if there's an empty gap we can fill # this relies on parentDepths being sorted, which # is true because the conflicts are added in # the same order as the they appear in the calendar p... | |
indent = self.GetIndentLevel() * 5 width = self.GetMaxDepth() * 5 | dayWidth = self._calendarCanvas.dayWidth if self._calendarCanvas.parent.blockItem.dayMode: maxDepth = self.GetMaxDepth() width = dayWidth / (maxDepth + 1) indent = width * self.GetIndentLevel() else: indent = self.GetIndentLevel() * 5 width = dayWidth - self.GetMaxDepth() * 5 | def UpdateDrawingRects(self): item = self.GetItem() indent = self.GetIndentLevel() * 5 width = self.GetMaxDepth() * 5 self._boundsRects = list(self.GenerateBoundsRects(self._calendarCanvas, item.startTime, item.endTime, indent, width)) self._bounds = self._boundsRects[0] |
rect.width -= width | rect.width = width | 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... |
class ClosureTimer(wx.Timer): """ Helper class because targets may need to recieve multiple different timers """ def __init__(self, callback, *args, **kwargs): super(ClosureTimer, self).__init__(*args, **kwargs) self._callback = callback def Notify(self): self._callback() | def OnToday(self, event): today = date.today() today = datetime(today.year, today.month, today.day) self.blockItem.setRange(today) self.blockItem.postDateChanged() self.wxSynchronizeWidget() | |
self.scrollTimer = ClosureTimer(self.OnDragTimer) | self.scrollTimer = wx.PyTimer(self.OnDragTimer) | def StartDragTimer(self): self.scrollTimer = ClosureTimer(self.OnDragTimer) self.scrollTimer.Start(100, wx.TIMER_CONTINUOUS) |
messageObject.set_payload(mailMessage.body.encode('utf-8')) | messageObject.set_payload(bodyText.encode('utf-8')) | def kindToMessageObject(mailMessage): """ This method converts a email message string to a Chandler C{Mail.MailMessage} object @param messageObject: A C{email.Message} object representation of a mail message @type messageObject: C{email.Message} @return: C{Message.Message} """ assert isinstance(mailMessage, Mail.Mai... |
'bodyText': mailMessage.body | 'bodyText': bodyText | def kindToMessageObject(mailMessage): """ This method converts a email message string to a Chandler C{Mail.MailMessage} object @param messageObject: A C{email.Message} object representation of a mail message @type messageObject: C{email.Message} @return: C{Message.Message} """ assert isinstance(mailMessage, Mail.Mai... |
icsPayload.add_header("Content-Disposition", "attachment", filename=_(u"event.ics")) | fname = Header.Header(_(u"event.ics")).encode() icsPayload.add_header("Content-Disposition", "attachment", filename=fname) | def kindToMessageObject(mailMessage): """ This method converts a email message string to a Chandler C{Mail.MailMessage} object @param messageObject: A C{email.Message} object representation of a mail message @type messageObject: C{email.Message} @return: C{Message.Message} """ assert isinstance(mailMessage, Mail.Mai... |
if os.name not in ['nt', 'os2'] and sys.platform != 'cygwin': | if os.name not in ['nt', 'os2']: | def executeCommandReturnOutput(args): args[0] = escapeSpaces(args[0]) args = map(escapeBackslashes, args) if not os.path.exists(args[0]): raise CommandNotFound # all args need to be quoted # args = map(quoteString, args) args_str = ' '.join(args) print args_str if os.name not in ['nt', 'os2'] and sys.platform != 'c... |
output = os.popen(args_str, 'r') outputList = output.readlines() exitCode = output.close() | i,k = os.popen4(args_str) i.close() outputList = k.readlines() exitCode = k.close() | def executeCommandReturnOutput(args): args[0] = escapeSpaces(args[0]) args = map(escapeBackslashes, args) if not os.path.exists(args[0]): raise CommandNotFound # all args need to be quoted # args = map(quoteString, args) args_str = ' '.join(args) print args_str if os.name not in ['nt', 'os2'] and sys.platform != 'c... |
m = __import__(module, globals(), locals(), name) | m = __import__(module, globals(), locals(), ['__name__']) | def loadClass(cls, name, module=None): |
parent=parent) | parent=parent, view=self.itsView) | def onImportIcalendarEvent(self, event): # triggered from "Test | Import iCalendar" Menu parent = self.findPath("//userdata/contentitems") |
conduit=conduit, format=format) | conduit=conduit, format=format, view=self.itsView) | def onImportIcalendarEvent(self, event): # triggered from "Test | Import iCalendar" Menu parent = self.findPath("//userdata/contentitems") |
if ical.exportFile(ical.OUTFILE, repository): | if ical.exportFile(ical.OUTFILE, self.itsView): | def onExportIcalendarEvent(self, event): # triggered from "Test | Export Events as iCalendar" Menu logger = self.itsView.getLogger() self.setStatusMessage ("Exporting to " + ical.OUTFILE) try: if ical.exportFile(ical.OUTFILE, repository): self.setStatusMessage ("Export completed") else: logger.info("Failed exportFile")... |
if platform.machine() == 'i386': | if platform.processor() == 'i386' and platform.machine() == 'i386': | def getPlatformName(): import platform platformName = 'Unknown' if os.name == 'nt': platformName = 'Windows' elif os.name == 'posix': if sys.platform == 'darwin': if platform.machine() == 'i386': platformName = 'Mac OS X (intel)' else: platformName = 'Mac OS X (ppc)' elif sys.platform == 'cygwin': platformName = 'Win... |
_transformFilesXslt(buildenv, os.path.join(buildenv['root'],"Chandler","model","schema","html_transform.xml"), os.path.join(buildenv['root'],"Chandler"), os.path.join(buildenv['root'],buildenv['version'],"docs"), [ os.path.join("parcels","OSAF","calendar","model","calendar.xml"), os.path.join("parcels","OSAF","contacts... | 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... | |
imageName = self.GetAttributeValue(item, attributeName) | imageName = self.GetAttributeValue(item, attributeName) + ".png" | def Draw (self, dc, rect, item, attributeName, isSelected): dc.DrawRectangleRect(rect) # always draw the background imageName = self.GetAttributeValue(item, attributeName) image = wx.GetApp().GetImage(imageName) if image is not None: x = rect.GetLeft() + (rect.GetWidth() - image.GetWidth()) / 2 y = rect.GetTop() + (rec... |
position = self.GetBoundsRects()[0].GetPosition() | position = self.GetBoundsRects()[0].GetPosition() + self.textOffset | def GetEditorPosition(self): """ This returns a location to show the editor. By default it is the same as the default bounding box """ position = self.GetBoundsRects()[0].GetPosition() # now offset to account for the time position += (self.textMargin + 3, self.timeHeight + self.textMargin) return position |
position += (self.textMargin + 3, self.timeHeight + self.textMargin) | position += (0, self.timeHeight) | def GetEditorPosition(self): """ This returns a location to show the editor. By default it is the same as the default bounding box """ position = self.GetBoundsRects()[0].GetPosition() # now offset to account for the time position += (self.textMargin + 3, self.timeHeight + self.textMargin) return position |
if not rightSideCutOff: self.DrawDRectangle(dc, itemRect, hasTopRightRounded, hasBottomRightRounded) elif rightSideCutOff: r = itemRect; x,y,w,h = r.x, r.y, r.width, r.height dc.DrawLines(((x+w, y), (x+1,y), (x+1,y+h-1), (x+w,y+h-1))) dc.SetPen(wx.TRANSPARENT_PEN) dc.DrawRectangle(x,y+1,w,h-2) pen = self.GetStatusPen... | hasLeftRounded = (item.startTime == item.endTime) self.DrawEventRectangle(dc, itemRect, hasLeftRounded, hasTopRightRounded, hasBottomRightRounded, rightSideCutOff) if not hasLeftRounded: pen = self.GetStatusPen(outlineColor) pen.SetCap(wx.CAP_BUTT) dc.SetPen(pen) dc.DrawLine(itemRect.x+1, itemRect.y, itemRect.x+1, ... | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item |
x = itemRect.x + self.textMargin + 3 y = itemRect.y + self.textMargin width = itemRect.width - (self.textMargin + 10) | self.textOffset = wx.Point(self.textMargin, self.textMargin) if hasLeftRounded: cornerRadius = 8 self.textOffset.x += cornerRadius else: self.textOffset.x += 3 x = itemRect.x + self.textOffset.x y = itemRect.y + self.textOffset.y width = itemRect.width - self.textOffset.x - (self.textMargin + 10) | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item |
itemRect.height - lostHeight - self.textMargin) | itemRect.height - lostHeight - self.textOffset.y) | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item |
def DrawDRectangle(self, dc, rect, hasTopRightRounded=True, hasBottomRightRounded=True): """ Make a D-shaped rectangle, optionally specifying if the top and bottom | def DrawEventRectangle(self, dc, rect, hasLeftRounded=False, hasTopRightRounded=True, hasBottomRightRounded=True, clipRightSide=False): """ Make a rounded rectangle, optionally specifying if the top and bottom | def DrawDRectangle(self, dc, rect, hasTopRightRounded=True, hasBottomRightRounded=True): """ Make a D-shaped rectangle, optionally specifying if the top and bottom right side of the rectangle should have rounded corners. Uses clip rect tricks to make sure it is drawn correctly Side effect: Destroys the clipping region... |
roundRect.x -= radius roundRect.width += radius | if not hasLeftRounded: roundRect.x -= radius roundRect.width += radius if clipRightSide: roundRect.width += radius; | def DrawDRectangle(self, dc, rect, hasTopRightRounded=True, hasBottomRightRounded=True): """ Make a D-shaped rectangle, optionally specifying if the top and bottom right side of the rectangle should have rounded corners. Uses clip rect tricks to make sure it is drawn correctly Side effect: Destroys the clipping region... |
dc.DrawLine(rect.x, rect.y, rect.x, rect.y + rect.height) | if not hasLeftRounded: dc.DrawLine(rect.x, rect.y, rect.x, rect.y + rect.height) | def DrawDRectangle(self, dc, rect, hasTopRightRounded=True, hasBottomRightRounded=True): """ Make a D-shaped rectangle, optionally specifying if the top and bottom right side of the rectangle should have rounded corners. Uses clip rect tricks to make sure it is drawn correctly Side effect: Destroys the clipping region... |
(cellWidth, cellHeight) = (calendarCanvas.dayWidth, int(duration * calendarCanvas.hourHeight)) | if duration == 0: duration = 0.5; (cellWidth, cellHeight) = \ (calendarCanvas.dayWidth, int(duration * calendarCanvas.hourHeight)) | def MakeRectForRange(calendarCanvas, startTime, endTime): """ Turn a datetime range into a rectangle that can be drawn on the screen This is a static method, and can be used outside this class """ startPosition = calendarCanvas.getPositionFromDateTime(startTime) # ultimately, I'm not sure that we should be asking the ... |
value = unicode(value) | if type(value) is not unicode: if encoding: value = unicode(value, encoding) else: value = unicode(value) | def _importElement(self, element, item=None, changes=None, previousView=None, updateCallback=None): |
encoding = attrElement.get('encoding') | def _importElement(self, element, item=None, changes=None, previousView=None, updateCallback=None): | |
import os if not os.environ.get('CHANDLER_NO_DnD_WORKAROUND'): compositeObject = wx.DataObjectComposite() compositeObject.Add(dataObject) return compositeObject | def CopyData(self): """ Called to get a widget's data at the beginning of a Copy or DnD. Returns a wxDataObject variant for use in Drag and Drop, or Cut and Paste. This implementation returns a Text data object. """ dataObject = wx.TextDataObject() dataObject.SetText(self.GetStringSelection()) # There's a bug on the Ma... | |
exec scriptCode in builtIns, {} | exec scriptCode in builtIns | def run_script(scriptText, fileName=""): """ exec the supplied script, in an environment equivalent to what you get when you say: from scripting.Helpers import * """ assert len(scriptText) > 0, _("Empty script") # compile the code scriptCode = compile(scriptText, fileName, 'exec') # next, build a dictionary of names ... |
stringSuccess = True | success = True def set_event_info(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) | def emulate_typing(cls, string, ctrlFlag = False, altFlag = False, shiftFlag = False): """ emulate_typings the string into the current focused widget, returns True if successful """ stringSuccess = True for char in string: try: keyPressMethod = wx.Window_FindFocus().EmulateKeyPress except AttributeError: return False e... |
try: keyPressMethod = wx.Window_FindFocus().EmulateKeyPress except AttributeError: return False | keyCode = ord(char) if keyCode == wx.WXK_RETURN: cls.emulate_return() elif keyCode == wx.WXK_TAB: cls.emulate_tab(shiftFlag=shiftFlag) | def emulate_typing(cls, string, ctrlFlag = False, altFlag = False, shiftFlag = False): """ emulate_typings the string into the current focused widget, returns True if successful """ stringSuccess = True for char in string: try: keyPressMethod = wx.Window_FindFocus().EmulateKeyPress except AttributeError: return False e... |
keyCode = ord(char) | widget = wx.Window_FindFocus() | def emulate_typing(cls, string, ctrlFlag = False, altFlag = False, shiftFlag = False): """ emulate_typings the string into the current focused widget, returns True if successful """ stringSuccess = True for char in string: try: keyPressMethod = wx.Window_FindFocus().EmulateKeyPress except AttributeError: return False e... |
keyPress.m_keyCode = keyCode keyPress.m_shiftDown = char.isupper() or shiftFlag keyPress.m_controlDown = keyPress.m_metaDown = ctrlFlag keyPress.m_altDown = altFlag charSuccess = keyPressMethod(keyPress) stringSuccess = stringSuccess and charSuccess wx.GetApp().Yield() return stringSuccess | set_event_info(keyPress) downWorked = widget.ProcessEvent(keyPress) keyUp = wx.KeyEvent(wx.wxEVT_KEY_UP) set_event_info(keyUp) upWorked = widget.ProcessEvent(keyUp) if not (downWorked or upWorked): emulateMethod = getattr(widget, 'EmulateKeyPress', lambda k: False) if '__WXMSW__' in wx.PlatformInfo: emulateMethod = la... | def emulate_typing(cls, string, ctrlFlag = False, altFlag = False, shiftFlag = False): """ emulate_typings the string into the current focused widget, returns True if successful """ stringSuccess = True for char in string: try: keyPressMethod = wx.Window_FindFocus().EmulateKeyPress except AttributeError: return False e... |
try: theApp.LoadMainViewRoot (delete=True) except Exception: self.LogTheException("Exception Loading the Main View." ) | theApp.LoadMainViewRoot (delete=True) | def onReloadParcelsEvent(self, event): theApp = wx.GetApp() theApp.UnRenderMainView () |
if item.fromAddress == u'': | if unicode(item.fromAddress).strip() == u'': | def onSendShareItemEvent(self, event): """ Send or share the selected items """ selectedItems = self.__getSelectedItems() if len(selectedItems) == 0: return |
stamped.rollover = "%sRollover" % self.icon stamped.disabled = "%sDisabled" % self.icon stamped.selected = "%sPressed" % self.icon | stamped.rollover = "%sStampedRollover" % self.icon stamped.disabled = "%sStampedDisabled" % self.icon stamped.selected = "%sStampedPressed" % self.icon | def instantiateWidget(self): id = self.getWidgetID() parentWidget = self.parentBlock.widget if self.buttonKind == "Text": button = wx.Button (parentWidget, id, self.title, wx.DefaultPosition, (self.minimumSize.width, self.minimumSize.height)) elif self.buttonKind == "Image": bitmap = wx.GetApp().GetImage (self.icon) bu... |
else: self.event = itemOrEvent.itsItem | def __init__(self, bounds, itemOrEvent): """ @param bounds: the bounds of the item as drawn on the canvas. @type bounds: wx.Rect @param item: the item drawn on the canvas in these bounds @type itemOrEvent: C{Item} or C{EventStamp} """ # @@@ scaffolding: resize bounds is the lower 5 pixels self._bounds = bounds if isi... | |
ret = Do(hardhatScript, releaseMode, workingDir, outputDir, | ret = doTests(hardhatScript, releaseMode, workingDir, outputDir, | 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 Do(hardhatScript, mode, workingDir, outputDir, cvsVintage, buildVersion, log): | def doTests(hardhatScript, mode, workingDir, outputDir, cvsVintage, buildVersion, log): | def Do(hardhatScript, mode, workingDir, outputDir, cvsVintage, buildVersion, log): testDir = os.path.join(workingDir, "chandler") os.chdir(testDir) if mode == "debug": dashT = '-dvt' else: dashT = '-vrt' try: # test print "Testing " + mode log.write("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n") ... |
return DetailTrunkSubtree, False | trunkSubtreeKind = self.findPath("//parcels/osaf/framework/blocks/detail/DetailTrunkSubtree") return trunkSubtreeKind, False | def _mapItemToCacheKeyItem(self, item): """ Overrides to use the item's kind as our cache key """ if item is None: # We use the subtree kind itself as the key for displaying nothing # (Mimi wants a particular look when no item is selected) return DetailTrunkSubtree, False else: return item.itsKind, False |
fillColorLozengeType = 'UnselectedGradientRight' | fillColorLozengeType = 'UnSelectedGradientRight' | def DrawCollectionSwatches(self, dc, topLeft, bottomRight, vertical=True): """ topLeft and bottomRight must be vectors (lists which can be added and subtracted like vectors) """ master = self.event.getMaster().itsItem app_ns = schema.ns('osaf.app', self.event.itsItem.itsView) sidebarCollections = app_ns.sidebarCollecti... |
timezones = TimeZoneInfo.get(self.itsView) self.itsView.watchItem(self, timezones, 'onTZListChange') | def render(self, *args, **kwds): super(CalendarControl, self).render(*args, **kwds) | |
pass | self._clearIndexDirties() | def _clearDirties(self): pass |
new_view = view.repository.createView(name, version) | new_view = view.repository.createView( name or getattr(item_or_view, 'itsName', None), version ) | def fork_item(item_or_view, name=None, version=None): """ Return a version of `item_or_view` that's in a new repository view This is a shortcut for creating a new view against the same repository as the original item or view, and then looking up the item or view by UUID in the new view. It is typically used when star... |
'undo': ('', '--undo', 's', None, None, 'undo <n> versions'), | 'undo': ('', '--undo', 's', None, None, 'undo <n> versions or until <check> or <repair> passes'), | def initOptions(**kwds): """ Load and parse the command line options, with overrides in **kwds. Returns options """ #XXX i18n parcelPath, profileDir could have non-ascii paths # option name, (value, short cmd, long cmd, type flag, default, environment variable, help text) _configItems = { 'parcelPath': ('-p', '--pa... |
view.check(True) | if view.check(True): view.commit() | def initRepository(directory, options, allowSchemaView=False): if options.uuids: input = file(options.uuids) loadUUIDs([UUID(uuid.strip()) for uuid in input if len(uuid) > 1]) input.close() repository = DBRepository(directory) kwds = { 'stderr': options.stderr, 'ramdb': options.ramdb, 'create': True, 'recover': opti... |
if options.undo == 'check': | if options.undo in ('check', 'repair'): repair = options.undo == 'repair' | def initRepository(directory, options, allowSchemaView=False): if options.uuids: input = file(options.uuids) loadUUIDs([UUID(uuid.strip()) for uuid in input if len(uuid) > 1]) input.close() repository = DBRepository(directory) kwds = { 'stderr': options.stderr, 'ramdb': options.ramdb, 'create': True, 'recover': opti... |
if view.check(): | if view.check(repair): if repair: view.commit() | def initRepository(directory, options, allowSchemaView=False): if options.uuids: input = file(options.uuids) loadUUIDs([UUID(uuid.strip()) for uuid in input if len(uuid) > 1]) input.close() repository = DBRepository(directory) kwds = { 'stderr': options.stderr, 'ramdb': options.ramdb, 'create': True, 'recover': opti... |
m.headers['Content-Transfer-Encoding'] = "7bit" | m.headers['Content-Transfer-Encoding'] = "8bit" | def __getMailMessage(self): if self.__mailMessage is not None: return self.__mailMessage |
detailRoot = self.blockItem.findBlockByName("DetailRoot") if detailRoot: detailRoot.focus() | def CreateEmptyEvent(self, **initialValues): """ shared routine to create an event, using the current view also forces consumers to specify important fields """ view = self.blockItem.itsView | |
def __init__(self, delegate=None, *args, **kwargs): | def __init__(self, staticControlDelegate=None, *args, **kwargs): | def __init__(self, delegate=None, *args, **kwargs): super(StringAttributeEditor, self).__init__(*args, **kwargs) self.staticControlDelegate = delegate |
self.staticControlDelegate = delegate | self.staticControlDelegate = staticControlDelegate | def __init__(self, delegate=None, *args, **kwargs): super(StringAttributeEditor, self).__init__(*args, **kwargs) self.staticControlDelegate = delegate |
control.SetValue(text) | control.SetValue(u'%s %s' % (addrString, indicatorString)) | def SetStaticControl(self, control, text): # update the static text control with a representation of 'text' control.SetValue(text) |
def shortenAddressList(self, list, control): | def shortenAddressList(self, control, addressText): | def shortenAddressList(self, list, control): """ Parse a string with a list of email addresses (no validity check, just commas) and return both a new string with a list that will fit in the given control's bounds, and the number of omitted addresses, in a tuple. """ (ign, addressList, ign2) = Mail.EmailAddress.parseEma... |
(ign, addressList, ign2) = Mail.EmailAddress.parseEmailAddresses(self.item, list) | logger.debug("shortenAddressList(%s)", addressText) (ignored, addressList, ignored2) = Mail.EmailAddress.parseEmailAddresses(self.item, addressText) | def shortenAddressList(self, list, control): """ Parse a string with a list of email addresses (no validity check, just commas) and return both a new string with a list that will fit in the given control's bounds, and the number of omitted addresses, in a tuple. """ (ign, addressList, ign2) = Mail.EmailAddress.parseEma... |
if unrenderedCount > 0: (controlWidth, controlHeight) = control.GetClientSize() controlWidth -= 22; | addrOnlyString = u'' indicatorString = u'' unrenderedFormat = u'[+%d]' (controlWidth, controlHeight) = control.GetClientSize() if unrenderedCount > 0 and controlWidth > 0: controlWidth -= wx.SystemSettings.GetMetric(wx.SYS_VSCROLL_X); def addressFitsInControl(addr): return (control.GetTextExtent(addr... | def shortenAddressList(self, list, control): """ Parse a string with a list of email addresses (no validity check, just commas) and return both a new string with a list that will fit in the given control's bounds, and the number of omitted addresses, in a tuple. """ (ign, addressList, ign2) = Mail.EmailAddress.parseEma... |
addrString = unicode(addressList.pop(0)) | addrOnlyString = unicode(addressList.pop(0)) | def shortenAddressList(self, list, control): """ Parse a string with a list of email addresses (no validity check, just commas) and return both a new string with a list that will fit in the given control's bounds, and the number of omitted addresses, in a tuple. """ (ign, addressList, ign2) = Mail.EmailAddress.parseEma... |
if unrenderedCount > 0: indicatorString = ' [+%d]' % unrenderedCount addrString = u'%s %s' % (addrOnlyString, indicatorString) if not addressFitsInControl(addrString): addrString = u'' indicatorString = u'[%d addresses]' % unrenderedCount | def shortenAddressList(self, list, control): """ Parse a string with a list of email addresses (no validity check, just commas) and return both a new string with a list that will fit in the given control's bounds, and the number of omitted addresses, in a tuple. """ (ign, addressList, ign2) = Mail.EmailAddress.parseEma... | |
newAddrString = u'%s, %s [+%d]' % (addrString, unicode(addr), unrenderedCount) if control.GetTextExtent(newAddrString)[0] > controlWidth: | baseAddrString = u'%s, %s' % (addrOnlyString, unicode(addr)) unrenderedCount -= 1 if unrenderedCount > 0: indicatorString = unrenderedFormat % unrenderedCount lengthCheckString = u'%s %s' % (baseAddrString, indicatorString) else: indicatorString = u'' lengthCheckString = baseAddrString if addressFitsInControl(lengthChe... | def shortenAddressList(self, list, control): """ Parse a string with a list of email addresses (no validity check, just commas) and return both a new string with a list that will fit in the given control's bounds, and the number of omitted addresses, in a tuple. """ (ign, addressList, ign2) = Mail.EmailAddress.parseEma... |
else: unrenderedCount -= 1 addrString = newAddrString return (addrString, unrenderedCount) | else: addrOnlyString = addressText unrenderedCount = 0 return (addrOnlyString, indicatorString, unrenderedCount) | def shortenAddressList(self, list, control): """ Parse a string with a list of email addresses (no validity check, just commas) and return both a new string with a list that will fit in the given control's bounds, and the number of omitted addresses, in a tuple. """ (ign, addressList, ign2) = Mail.EmailAddress.parseEma... |
u'itemCollectionResults', u'itemCollectionInclusions', u'itemCollectionInclusions' | u'itemCollectionResults', u'itemCollectionInclusions', | 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... |
buildenv['python'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'bin' + os.sep + 'python' buildenv['python_d'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'bin' + os.sep + 'python_d' | CHANDLERHOME, CHANDLERBIN = getCHANDLERvars() | def init(buildenv): """ Initialize the build environment, which is a dictionary containing various values for OS type, PATH, compiler, debug/release setting, etc. Parameters: root: fully qualified path to the top of the build hierarchy Returns: buildenv: a dictionary containing the following environment settings: - ro... |
buildenv['python'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'bin' + os.sep + 'python.exe' buildenv['python_d'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'bin' + os.sep + 'python_d.exe' | buildenv['python'] = os.path.join(CHANDLERBIN, 'release', 'bin', 'python.exe') buildenv['python_d'] = os.path.join(CHANDLERBIN, 'debug', 'bin', 'python_d.exe') | def init(buildenv): """ Initialize the build environment, which is a dictionary containing various values for OS type, PATH, compiler, debug/release setting, etc. Parameters: root: fully qualified path to the top of the build hierarchy Returns: buildenv: a dictionary containing the following environment settings: - ro... |
buildenv['swig'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'bin' + os.sep + 'swig.exe' buildenv['swig_d'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'bin' + os.sep + 'swig.exe' | buildenv['swig'] = os.path.join(CHANDLERBIN, 'release', 'bin', 'swig.exe') buildenv['swig_d'] = os.path.join(CHANDLERBIN, 'debug', 'bin', 'swig.exe') | def init(buildenv): """ Initialize the build environment, which is a dictionary containing various values for OS type, PATH, compiler, debug/release setting, etc. Parameters: root: fully qualified path to the top of the build hierarchy Returns: buildenv: a dictionary containing the following environment settings: - ro... |
buildenv['swig'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'bin' + os.sep + 'swig' buildenv['swig_d'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'bin' + os.sep + 'swig' | buildenv['python'] = os.path.join(CHANDLERBIN, 'release', 'bin', 'python') buildenv['python_d'] = os.path.join(CHANDLERBIN, 'debug', 'bin', 'python_d') buildenv['swig'] = os.path.join(CHANDLERBIN, 'release', 'bin', 'swig') buildenv['swig_d'] = os.path.join(CHANDLERBIN, 'debug', 'bin', 'swig') | def init(buildenv): """ Initialize the build environment, which is a dictionary containing various values for OS type, PATH, compiler, debug/release setting, etc. Parameters: root: fully qualified path to the top of the build hierarchy Returns: buildenv: a dictionary containing the following environment settings: - ro... |
buildenv['swig'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'bin' + os.sep + 'swig' buildenv['swig_d'] = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'bin' + os.sep + 'swig' buildenv['python'] = os.path.join(buildenv['root'], 'chandler', 'release', 'Library', '... | buildenv['python'] = os.path.join(CHANDLERBIN, 'release', 'Library', 'Frameworks', 'Python.framework', 'Versions', 'Current', 'Resources', 'Python.app', 'Contents', 'MacOS', 'Python') buildenv['python_d'] = os.path.join(CHANDLERBIN, 'debug', 'Library', 'Frameworks', 'Python.framework', 'Versions', 'Current', 'Resource... | def init(buildenv): """ Initialize the build environment, which is a dictionary containing various values for OS type, PATH, compiler, debug/release setting, etc. Parameters: root: fully qualified path to the top of the build hierarchy Returns: buildenv: a dictionary containing the following environment settings: - ro... |
lib_dir_release = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'lib' + os.sep + 'python2.3' lib_dir_debug = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'lib' + os.sep + 'python2.3' | lib_dir_release = os.path.join(CHANDLERBIN, 'release', 'lib', 'python2.3') lib_dir_debug = os.path.join(CHANDLERBIN, 'debug', 'lib', 'python2.3') | def init(buildenv): """ Initialize the build environment, which is a dictionary containing various values for OS type, PATH, compiler, debug/release setting, etc. Parameters: root: fully qualified path to the top of the build hierarchy Returns: buildenv: a dictionary containing the following environment settings: - ro... |
lib_dir_release = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'bin' + os.sep + 'Lib' lib_dir_debug = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'bin' + os.sep + 'Lib' | lib_dir_release = os.path.join(CHANDLERBIN, 'release', 'bin', 'Lib') lib_dir_debug = os.path.join(CHANDLERBIN, 'debug', 'bin', 'Lib') | def init(buildenv): """ Initialize the build environment, which is a dictionary containing various values for OS type, PATH, compiler, debug/release setting, etc. Parameters: root: fully qualified path to the top of the build hierarchy Returns: buildenv: a dictionary containing the following environment settings: - ro... |
lib_dir_release = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + \ 'Library/Frameworks/Python.framework/Versions/Current/lib/python2.3' lib_dir_debug = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + \ 'Library/Frameworks/Python.framework/Versions/Current/lib/python2.3' | lib_dir_release = os.path.join(CHANDLERBIN, 'release', 'Library', 'Frameworks', 'Python.framework', 'Versions', 'Current', 'lib', 'python2.3') lib_dir_debug = os.path.join(CHANDLERBIN, 'debug', 'Library', 'Frameworks', 'Python.framework', 'Versions', 'Current', 'lib', 'python2.3') | def init(buildenv): """ Initialize the build environment, which is a dictionary containing various values for OS type, PATH, compiler, debug/release setting, etc. Parameters: root: fully qualified path to the top of the build hierarchy Returns: buildenv: a dictionary containing the following environment settings: - ro... |
chandler_debug = os.sep + 'chandler' + os.sep + 'debug' chandler_release = os.sep + 'chandler' + os.sep + 'release' | chandler_debug = os.path.join(CHANDLERBIN, 'debug') chandler_release = os.path.join(CHANDLERBIN, 'release') | def recursiveTest(buildenv, path): path = os.path.abspath(path) os.chdir(path) testFiles = glob.glob('Test*.py') for testFile in testFiles: fullTestFilePath = os.path.join(path, testFile) runTest(buildenv, testFile, fullTestFilePath) chandler_debug = os.sep + 'chandler' + os.sep + 'debug' chandler_release = os.sep +... |
if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release' + os.sep + 'bin' + \ os.pathsep ... | CHANDLERHOME, CHANDLERBIN = getCHANDLERvars() os.putenv('CHANDLERHOME', CHANDLERHOME) os.putenv('CHANDLERBIN', CHANDLERBIN) path = [ os.path.join(CHANDLERHOME, buildenv['version'], 'bin'), buildenv['path'] ] path = os.pathsep.join(path) os.putenv('BUILDMODE', buildenv['version']) | def setupEnvironment(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release'... |
if buildenv['os'] == 'win': os.putenv('CHANDLERHOME', buildenv['root_dos']+"\\chandler") else: os.putenv('CHANDLERHOME', buildenv['root']+os.sep+"chandler") | def setupEnvironment(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release'... | |
ld_library_path = os.environ.get('LD_LIBRARY_PATH', '') | ld_library_path = os.getenv('LD_LIBRARY_PATH', '') | def setupEnvironment(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release'... |
additional_path=os.path.join(buildenv['root'],'chandler',ver,'lib')+\ os.pathsep + os.path.join(buildenv['root'],'chandler',ver,'db','lib')+\ os.pathsep + os.path.join(buildenv['root'],'chandler',ver,'dbxml','lib') ld_library_path = additional_path + os.pathsep + ld_library_path | additional_paths = [ os.path.join(CHANDLERBIN, ver, 'lib'), os.path.join(CHANDLERBIN, ver, 'db', 'lib'), os.path.join(CHANDLERBIN, ver, 'dbxml', 'lib'), ld_library_path ] ld_library_path = os.pathsep.join(additional_paths) | def setupEnvironment(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release'... |
dyld_library_path = os.environ.get('DYLD_LIBRARY_PATH', '') | dyld_library_path = os.getenv('DYLD_LIBRARY_PATH', '') | def setupEnvironment(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release'... |
additional_path=os.path.join(buildenv['root'],'chandler',ver,'lib')+\ os.pathsep + os.path.join(buildenv['root'],'chandler',ver,'db','lib')+\ os.pathsep + os.path.join(buildenv['root'],'chandler',ver,'dbxml','lib') dyld_library_path = additional_path + os.pathsep + dyld_library_path | additional_paths = [ os.path.join(CHANDLERBIN, ver, 'lib'), os.path.join(CHANDLERBIN, ver, 'db', 'lib'), os.path.join(CHANDLERBIN, ver, 'dbxml', 'lib'), dyld_library_path ] dyld_library_path = os.pathsep.join(additional_paths) | def setupEnvironment(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release'... |
dyld_framework_path = os.environ.get('DYLD_FRAMEWORK_PATH', '') additional_path = os.path.join( buildenv['root'], 'chandler', ver, 'Library', 'Frameworks') dyld_framework_path = additional_path + os.pathsep + dyld_framework_path | dyld_framework_path = os.getenv('DYLD_FRAMEWORK_PATH', '') additional_paths = [ os.path.join(CHANDLERBIN, ver, 'Library', 'Frameworks'), dyld_framework_path ] dyld_framework_path = os.pathsep.join(additional_paths) | def setupEnvironment(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'chandler' + os.sep + 'release'... |
'--scriptTimeout=600', | '--scriptTimeout=720', | def doFunctionalTests(releaseMode, workingDir, log): chandlerDir = os.path.join(workingDir, 'chandler') logDir = os.path.join(chandlerDir, 'test_profile') chandlerLog = os.path.join(logDir, 'chandler.log') FuncTestLog = os.path.join(logDir, 'FunctionalTestSuite.log') if buildenv['os'] == 'win': runChan... |
"TestSharing.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) |
default=skipRsync, help="Skip rsync step \n" | default=False, help="Skip rsync step \n" | 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... |
[rsyncProgram, "-e", "ssh", "-avzp", "--delete", | [rsyncProgram, "-e", "ssh", "-avzp", | 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... |
fileOut = file(outputDir+os.sep+"index.html", "w") | fileOut = file(outputDir+os.sep+buildName+"_index.html", "w") | def CreateIndex(outputDir, newDirName, nowString, buildName): """Generates an index.html page from the hint files that hardhat creates which contain the actual distro filenames""" fileOut = file(outputDir+os.sep+"index.html", "w") fileOut.write("<html><head><META HTTP-EQUIV=Pragma CONTENT=no-cache><link rel=Stylesheet ... |
deltaDays = (position.x - self.xOffset) / self.dayWidth | if self.dayWidth > 0: deltaDays = (position.x - self.xOffset) / self.dayWidth else: deltaDays = 0 | def getDateTimeFromPosition(self, position): startDay = self.parent.blockItem.getStartDay() deltaDays = (position.x - self.xOffset) / self.dayWidth deltaHours = (position.y) / self.hourHeight deltaMinutes = ((position.y % self.hourHeight) * 60) / self.hourHeight deltaMinutes = int(deltaMinutes/15) * 15 newTime = startD... |
return self.snoozedUntil or \ | result = self.snoozedUntil or \ | def getNextReminderTimeFor(self, remindable): """ Get the time for this remindable's next reminder """ return self.snoozedUntil or \ (self.getBaseTimeFor(remindable) + self.delta) |
method = focusedWidget.blockItem.finishSelectionChanges() | method = focusedWidget.blockItem.finishSelectionChanges | def onRunSelectedScriptEvent(self, event): # Triggered from "Tests | Run a Script" items = self.__getSelectedItems() if len(items) > 0: for item in items: if hasattr(item, 'execute'): # in case the user was just editing the script, # ask the focus to finish changes, if it can focusedWidget = wx.Window_FindFocus() try: ... |
return collection.hasAttributeValue('sharedURL') and collection.sharedURL | return collection.hasAttributeValue('sharedURL') and (collection.sharedURL is not None) | def isShared(collection): # @@@ Temporary hack until there is a better way to test for isShared return collection.hasAttributeValue('sharedURL') and collection.sharedURL |
sideBarLevel[name] = URLTreeEntry(parcel, false, itemId, {}, false) | sideBarLevel[name] = URLTreeEntry(parcel, false, {}, false) | def __UpdateURLTree(self, sideBarLevel, parentUri, parentItem, wasEmpty=false): """ Synchronizes the sideBar's URLTree with the application's URLTree. The sideBar only stores a dict mapping visible items in the sideBar to their instances in the application. """ wxWindow = app.association[id(self)] uriList = app.model... |
sideBarLevel[name].wxId = itemId | def __UpdateURLTree(self, sideBarLevel, parentUri, parentItem, wasEmpty=false): """ Synchronizes the sideBar's URLTree with the application's URLTree. The sideBar only stores a dict mapping visible items in the sideBar to their instances in the application. """ wxWindow = app.association[id(self)] uriList = app.model... | |
itemId = sideBarLevel[name].wxId | itemId = wxWindow.uriDictMap[uri] | def __UpdateURLTree(self, sideBarLevel, parentUri, parentItem, wasEmpty=false): """ Synchronizes the sideBar's URLTree with the application's URLTree. The sideBar only stores a dict mapping visible items in the sideBar to their instances in the application. """ wxWindow = app.association[id(self)] uriList = app.model... |
wxWindow.Delete(item.wxId) | itemId = wxWindow.uriDictMap[uriToDelete] wxWindow.Delete(itemId) del wxWindow.uriDictMap[uriToDelete] | def __UpdateURLTree(self, sideBarLevel, parentUri, parentItem, wasEmpty=false): """ Synchronizes the sideBar's URLTree with the application's URLTree. The sideBar only stores a dict mapping visible items in the sideBar to their instances in the application. """ wxWindow = app.association[id(self)] uriList = app.model... |
def __init__(self, instance, isOpen, wxId, children, isMarked): | def __init__(self, instance, isOpen, children, isMarked): | def __init__(self, instance, isOpen, wxId, children, isMarked): self.instance = instance self.isOpen = isOpen self.wxId = wxId self.children = children self.isMarked = isMarked |
self.wxId = wxId | def __init__(self, instance, isOpen, wxId, children, isMarked): self.instance = instance self.isOpen = isOpen self.wxId = wxId self.children = children self.isMarked = isMarked | |
strings = [] for k, v in self.value.iteritems(): strings.append("%s:%s" %(k, v)) return ",".join(strings) | return ",".join(["%s:%s" %(k, v) for k, v in value.iteritems()]) | def makeString(self, value): |
encoding='utf-8', mimeType='text/plain', compression='bz2'): | encoding='utf-8', mimetype='text/plain', compression='bz2'): | def makeValue(self, data, encoding='utf-8', mimeType='text/plain', compression='bz2'): |
self._logDL(1) | self._logDL(19) | def loadRef(self, view, uCol, version, uRef): |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.