rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
try: whichTimeAttribute = self.whichAttribute() if 'start' in whichTimeAttribute: item.ChangeStart (theDate) else: item.setAttributeValue(whichTimeAttribute, theDate) | return theDate def saveAttributeFromWidget(self, item, widget): """" Update the attribute from the user edited string in the widget. """ dateString = widget.GetValue().strip('?') theDate = self.parseDateTime (dateString) try: item.ChangeStart (theDate) | def saveAttributeFromWidget(self, item, widget): """" Update the attribute from the user edited string in the widget. """ dateString = widget.GetValue().strip('?') try: # convert to Date/Time theDate = DateTime.Parser.DateTimeFromString (dateString) except ValueError: pass except DateTime.RangeError: pass try: # save t... |
value = '' | value = 'yyyy-mm-dd HH:MM' | def loadAttributeIntoWidget(self, item, widget): """" Update the widget display based on the value in the attribute. """ try: dateTime = item.getAttributeValue(self.whichAttribute()) except AttributeError: value = '' else: value = dateTime.strftime (self.timeFormat) widget.SetValue (value) |
durationFormat = '%I:%M' | durationFormatShort = '%H:%M' durationFormatLong = '%d:%H:%M:%S' zeroDays = DateTime.DateTimeDelta (0) hundredDays = DateTime.DateTimeDelta (100) | def staticTextLabelValue (self, item): durationLabel = self.title + _(' ') return durationLabel |
try: | if self.hundredDays > theDuration > self.zeroDays: | def saveAttributeFromWidget(self, item, widget): """" Update the attribute from the user edited string in the widget. """ durationString = widget.GetValue().strip('?') try: # convert to Date/Time theDuration = DateTime.Parser.DateTimeDeltaFromString (durationString) except ValueError: pass try: # save the new duration ... |
except: durationString = dateString + '?' else: durationString = theDuration.strftime (self.durationFormat) | durationString = self.formattedDuration (theDuration, durationString) | def saveAttributeFromWidget(self, item, widget): """" Update the attribute from the user edited string in the widget. """ durationString = widget.GetValue().strip('?') try: # convert to Date/Time theDuration = DateTime.Parser.DateTimeDeltaFromString (durationString) except ValueError: pass try: # save the new duration ... |
value = theDuration.strftime (self.durationFormat) | if theDuration is not None: value = self.formattedDuration (theDuration, '') else: value = 'hh:mm' | def loadAttributeIntoWidget(self, item, widget): """" Update the widget display based on the value in the attribute. """ try: theDuration = item.duration except AttributeError: value = '?' else: value = theDuration.strftime (self.durationFormat) widget.SetValue (value) |
def formattedDuration (self, aDuration, originalString): """ Return a string containing the formatted duration. """ if self.hundredDays > aDuration > self.zeroDays: if aDuration.day == 0 and aDuration.second == 0: format = self.durationFormatShort else: format = self.durationFormatLong return aDuration.strftime (forma... | def loadAttributeIntoWidget(self, item, widget): """" Update the widget display based on the value in the attribute. """ try: theDuration = item.duration except AttributeError: value = '?' else: value = theDuration.strftime (self.durationFormat) widget.SetValue (value) | |
def importString(name, globalDict=defaultGlobalDict): | def importString(name, globalDict=__main__.__dict__): | def importString(name, globalDict=defaultGlobalDict): """Import an item specified by a string Example Usage:: attribute1 = importString('some.module:attribute1') attribute2 = importString('other.module:nested.attribute2') 'importString' imports an object from a module, according to an import specification string: a ... |
def convertToICUtzinfo(dt): | tzid_mapping = {} def convertToICUtzinfo(dt, view=None): | def convertToICUtzinfo(dt): """ This method returns a C{datetime} whose C{tzinfo} field (if any) is an instance of the ICUtzinfo class. @param dt: The C{datetime} whose C{tzinfo} field we want to convert to an ICUtzinfo instance. @type dt: C{datetime} """ oldTzinfo = dt.tzinfo if oldTzinfo is not None: def getICUIns... |
icuTzinfo = getICUInstance(getattr(oldTzinfo, '_tzid', None)) | tzical_tzid = getattr(oldTzinfo, '_tzid', None) icuTzinfo = getICUInstance(tzical_tzid) if tzical_tzid is not None: if tzid_mapping.has_key(tzical_tzid): icuTzinfo = tzid_mapping[tzical_tzid] | def getICUInstance(name): result = None if name is not None: result = ICUtzinfo.getInstance(name) if result is not None and \ result.tzid == 'GMT' and \ name != 'GMT': result = None return result |
icuTzinfo = getICUInstance(oldTzinfo.tzname(dt)) | if view is not None: info = TimeZoneInfo.get(view) well_known = (t[1].tzid for t in info.iterTimeZones()) else: well_known = [] for tzid in itertools.chain(well_known, PyICU.TimeZone.createEnumeration()): test_tzinfo = getICUInstance(tzid) if vobject.icalendar.tzinfo_eq(test_tzinfo, oldTzinfo, dt.year, dt.y... | def getICUInstance(name): result = None if name is not None: result = ICUtzinfo.getInstance(name) if result is not None and \ result.tzid == 'GMT' and \ name != 'GMT': result = None return result |
dtstart = convertToICUtzinfo(dtstart) | dtstart = convertToICUtzinfo(dtstart, view) | 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. |
tzinfo)) | tzinfo), view) | 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. |
clickDate = PreviousWeekday(clickDate, self.firstDayOfWeek) | clickDate = self.FirstDayOfWeek(clickDate) | def HitTest(self, pos): # we need to find out if the hit is on left arrow, on month or # on right arrow |
return PreviousWeekday(startDate, self.firstDayOfWeek) | return self.FirstDayOfWeek(startDate) | def GetStartDate(self): # roll back to the beginning of the month startDate = date(self.firstVisibleDate.year, self.firstVisibleDate.month, 1) |
n = wd + self.firstDayOfWeek + 1 | n = wd + self.firstDayOfWeek - 1 | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
weekDate = PreviousWeekday(weekDate, self.firstDayOfWeek) | weekDate = self.FirstDayOfWeek(weekDate) | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
if self.GetWindowStyle() & CAL_SHOW_BUSY: | if (self.GetWindowStyle() & CAL_SHOW_BUSY and weekDate.month == startDate.month): | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
return GetWeekOfMonth(targetDate, self.firstDayOfWeek) | return self.GetWeekOfMonth(targetDate) | def GetWeek(self, targetDate, useRelative=True): """ get the week (row, in range 1..WEEKS_TO_DISPLAY) for the given date """ if useRelative: # week of the month return GetWeekOfMonth(targetDate, self.firstDayOfWeek) |
targetDate = PreviousWeekday(targetDate, self.firstDayOfWeek) | targetDate = self.FirstDayOfWeek(targetDate) | def GetWeek(self, targetDate, useRelative=True): """ get the week (row, in range 1..WEEKS_TO_DISPLAY) for the given date """ if useRelative: # week of the month return GetWeekOfMonth(targetDate, self.firstDayOfWeek) |
triageStatusClickSequence = { 'now': 'done', 'done': 'later', 'later' : 'now' } | def getTriageStatusOrder(value): return triageStatusOrder[value] | |
return TriageEnum.values[(triageStatusOrder[value]+1) % len(TriageEnum.values)] | return triageStatusClickSequence[value] | def getNextTriageStatus(value): return TriageEnum.values[(triageStatusOrder[value]+1) % len(TriageEnum.values)] |
return objectToEncode | return viewStr | def EncodePythonObject(self, objectToEncode): viewStr = cPickle.dumps(objectToEncode) viewStr = base64.encodestring(viewStr) return objectToEncode |
event.Check (arguments.get ('Check', False)) | check = arguments.get ('Check', None) if check is not None: event.Check (check) | def OnCommand(self, event): """ Catch commands and pass them along to the blocks. Our events have ids greater than wx.ID_HIGHEST Delay imports to avoid circular references. """ from osaf.framework.blocks.Block import Block |
if key == 'channel': key = 'feed' if key == 'items': key = 'entries' | keymap = {'channel': 'feed', 'items': 'entries', 'guid': 'id', 'date': 'modified', 'date_parsed': 'modified_parsed'} key = keymap.get(key, key) | def __getitem__(self, key): if key == 'channel': key = 'feed' if key == 'items': key = 'entries' return UserDict.__getitem__(self, key) |
attrs = [(k.lower(), sgmllib.charref.sub(lambda m: unichr(int(m.groups()[0])), v).strip()) for k, v in attrs] | attrs = [(k.lower(), v) for k, v in attrs] | def unknown_starttag(self, tag, attrs): if _debug: sys.stderr.write('start %s with %s\n' % (tag, attrs)) # normalize attrs attrs = [(k.lower(), sgmllib.charref.sub(lambda m: unichr(int(m.groups()[0])), v).strip()) for k, v in attrs] attrs = [(k, k in ('rel', 'type') and v.lower() or v) for k, v in attrs] # track xml:b... |
if self.contentparams.get('mode') == 'escaped': data = data.replace('<', '<') data = data.replace('>', '>') data = data.replace('&', '&') data = data.replace('"', '"') data = data.replace(''', "'") | def decodeEntities(self, element, data): if self.contentparams.get('mode') == 'escaped': data = data.replace('<', '<') data = data.replace('>', '>') data = data.replace('&', '&') data = data.replace('"', '"') data = data.replace(''', "'") return data | |
if element in self.can_contain_relative_uris: output = _resolveRelativeURIs(output, self.baseuri, self.encoding) | if self.contentparams.get('type', 'text/html') in self.html_types: if element in self.can_contain_relative_uris: output = _resolveRelativeURIs(output, self.baseuri, self.encoding) | def pop(self, element): if not self.elementstack: return |
if element in self.can_contain_dangerous_markup: output = _sanitizeHTML(output, self.encoding) | if self.contentparams.get('type', 'text/html') in self.html_types: if element in self.can_contain_dangerous_markup: output = _sanitizeHTML(output, self.encoding) | def pop(self, element): if not self.elementstack: return |
pass | context = self._getContext() context['image']['url'] = value | def _end_url(self): value = self.pop('url') if self.inauthor: self._save_author('url', value) elif self.incontributor: self._save_contributor('url', value) elif self.inimage: # TODO pass elif self.intextinput: # TODO (map to link) pass |
pass | context = self._getContext() context['textinput']['link'] = value | def _end_url(self): value = self.pop('url') if self.inauthor: self._save_author('url', value) elif self.incontributor: self._save_contributor('url', value) elif self.inimage: # TODO pass elif self.intextinput: # TODO (map to link) pass |
self._save('date', value) self._save('date_parsed', parsed_value) | def _end_dcterms_modified(self): value = self.pop('modified') if _debug: sys.stderr.write('_end_dcterms_modified, value=' + value + '\n') parsed_value = _parse_date(value) self._save('date', value) self._save('date_parsed', parsed_value) self._save('modified_parsed', parsed_value) | |
self.entries[-1]['links'].append(attrsD) | self.entries[-1]['links'].append(FeedParserDict(attrsD)) | def _start_link(self, attrsD): attrsD.setdefault('rel', 'alternate') attrsD.setdefault('type', 'text/html') if attrsD.has_key('href'): attrsD['href'] = self.resolveURI(attrsD['href']) expectingText = self.infeed or self.inentry if self.inentry: self.entries[-1].setdefault('links', []) self.entries[-1]['links'].append(a... |
self.feeddata['links'].append(attrsD) | self.feeddata['links'].append(FeedParserDict(attrsD)) | def _start_link(self, attrsD): attrsD.setdefault('rel', 'alternate') attrsD.setdefault('type', 'text/html') if attrsD.has_key('href'): attrsD['href'] = self.resolveURI(attrsD['href']) expectingText = self.infeed or self.inentry if self.inentry: self.entries[-1].setdefault('links', []) self.entries[-1]['links'].append(a... |
self.push('guid', 1) | self.push('id', 1) | def _start_guid(self, attrsD): self.guidislink = (attrsD.get('ispermalink', 'true') == 'true') self.push('guid', 1) |
value = self.pop('guid') self._save('id', value) | value = self.pop('id') | def _end_guid(self): value = self.pop('guid') self._save('id', value) if self.guidislink: # guid acts as link, but only if "ispermalink" is not present or is "true", # and only if the item doesn't already have a link element self._save('link', value) |
self._save('guid', value) | def _end_id(self): value = self.pop('id') self._save('guid', value) | |
self.entries[-1]['enclosures'].append(attrsD) | self.entries[-1]['enclosures'].append(FeedParserDict(attrsD)) | def _start_enclosure(self, attrsD): if self.inentry: self.entries[-1].setdefault('enclosures', []) self.entries[-1]['enclosures'].append(attrsD) |
self.entries[-1]['source'] = attrsD | self.entries[-1]['source'] = FeedParserDict(attrsD) | def _start_source(self, attrsD): if self.inentry: self.entries[-1]['source'] = attrsD self.push('source', 1) |
if type(data) == types.UnicodeType: | if self.encoding and (type(data) == types.UnicodeType): | def feed(self, data): data = re.compile(r'<!((?!DOCTYPE|--|\[))', re.IGNORECASE).sub(r'<!\1', data) data = re.sub(r'<(\S+)/>', r'<\1></\1>', data) data = data.replace(''', "'") data = data.replace('"', '"') if type(data) == types.UnicodeType: data = data.encode(self.encoding) sgmllib.SGMLParser.feed(self, da... |
attrs = [(k.lower(), sgmllib.charref.sub(lambda m: unichr(int(m.groups()[0])), v).strip()) for k, v in attrs] | attrs = [(k.lower(), v) for k, v in attrs] if self.encoding: attrs = [(k, v.encode(self.encoding)) for k, v in attrs] | def normalize_attrs(self, attrs): # utility method to be called by descendants attrs = [(k.lower(), sgmllib.charref.sub(lambda m: unichr(int(m.groups()[0])), v).strip()) for k, v in attrs] attrs = [(k, k in ('rel', 'type') and v.lower() or v) for k, v in attrs] return attrs |
(http_content_type.startswith('text/') and http_content_type.endswith('+xml')): | (http_content_type.startswith('text/')): | def _parseHTTPContentType(content_type): """takes HTTP Content-Type header and returns (content type, charset) |
newdecl = unicode("""<?xml version='1.0' encoding='%s'?>""" % encoding, encoding) | if _debug: sys.stderr.write('successfully created declmatch\n') newdecl = """<?xml version='1.0' encoding='%s'?>""" % encoding if _debug: sys.stderr.write('successfully created newdecl\n') | def _changeEncodingDeclaration(data, encoding): """Changes an XML data stream on the fly to specify a new encoding data is a raw sequence of bytes (not Unicode) that is presumed to be in %encoding already encoding is a string recognized by encodings.aliases """ if _debug: sys.stderr.write('entering _changeEncodingDecl... |
def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, referrer=None): """Parse a feed from a URL, file, stream, or string""" result = FeedParserDict() f = _open_resource(url_file_stream_or_string, etag=etag, modified=modified, agent=agent, referrer=referrer) data = f.read() if hasattr(f, "headers")... | def _attempt_parse(data, result, baseuri, use_strict_parser, declared_encoding, proposed_encoding): | def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, referrer=None): """Parse a feed from a URL, file, stream, or string""" result = FeedParserDict() f = _open_resource(url_file_stream_or_string, etag=etag, modified=modified, agent=agent, referrer=referrer) data = f.read() if hasattr(f, "headers")... |
if _debug: sys.stderr.write('using an xml library that does not support DTDHandler (not a big deal)\n') | pass | def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, referrer=None): """Parse a feed from a URL, file, stream, or string""" result = FeedParserDict() f = _open_resource(url_file_stream_or_string, etag=etag, modified=modified, agent=agent, referrer=referrer) data = f.read() if hasattr(f, "headers")... |
if _debug: sys.stderr.write('using an xml library that does not support EntityResolver (not a big deal)\n') encoding_set = (result['encoding'] == xml_encoding) if not encoding_set: bozo_exception = None proposed_encodings = [result['encoding'], xml_encoding, 'utf-8', 'iso-8859-1', 'windows-1252'] tried_encodings = [] f... | pass | def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, referrer=None): """Parse a feed from a URL, file, stream, or string""" result = FeedParserDict() f = _open_resource(url_file_stream_or_string, etag=etag, modified=modified, agent=agent, referrer=referrer) data = f.read() if hasattr(f, "headers")... |
if _debug: sys.stderr.write('xml parsing failed\n') | if _debug: import traceback traceback.print_stack() traceback.print_exc() sys.stderr.write('xml parsing failed\n') | def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, referrer=None): """Parse a feed from a URL, file, stream, or string""" result = FeedParserDict() f = _open_resource(url_file_stream_or_string, etag=etag, modified=modified, agent=agent, referrer=referrer) data = f.read() if hasattr(f, "headers")... |
result['bozo'] = 1 result['bozo_exception'] = feedparser.bozo_exception use_strict_parser = 0 if not use_strict_parser: | raise feedparser.bozo_exception else: | def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, referrer=None): """Parse a feed from a URL, file, stream, or string""" result = FeedParserDict() f = _open_resource(url_file_stream_or_string, etag=etag, modified=modified, agent=agent, referrer=referrer) data = f.read() if hasattr(f, "headers")... |
self._boundsRects = list(self.GenerateBoundsRects(calendarCanvas)) | self._calendarCanvas = calendarCanvas def UpdateDrawingRects(self): self._boundsRects = list(self.GenerateBoundsRects(self._calendarCanvas)) | def __init__(self, item, calendarCanvas, *arguments, **keywords): super(ColumnarCanvasItem, self).__init__(None, item) self._boundsRects = list(self.GenerateBoundsRects(calendarCanvas)) self._bounds = self._boundsRects[0] |
yield self.MakeRectForRange(calendarCanvas, boundsStartTime, boundsEndTime) | try: yield self.MakeRectForRange(calendarCanvas, boundsStartTime, boundsEndTime) except ValueError: pass | def GenerateBoundsRects(self, calendarCanvas): """ 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 morning to noon wednesday """ # ... |
def Draw(self, dc, brushContainer): | def Draw(self, dc, boundingRect, brushContainer): | def Draw(self, dc, brushContainer): item = self._item |
rectCount = len(self._boundsRects) rectIndex = 0 | lastRect = len(self._boundsRects) - 1 | def Draw(self, dc, brushContainer): item = self._item |
oldLogicalFunction = dc.GetLogicalFunction() for itemRect in self._boundsRects: | for rectIndex, itemRect in enumerate(self._boundsRects): | def Draw(self, dc, brushContainer): item = self._item |
if rectIndex == rectCount - 1: | if rectIndex == lastRect: | def Draw(self, dc, brushContainer): item = self._item |
rectIndex += 1 | def Draw(self, dc, brushContainer): item = self._item | |
days = 1 | endDay = startDay + DateTime.RelativeDateTime(days = 1) | def DrawCells(self, dc): self._doDrawingCalculations() self.canvasItemList = [] |
days = 7 | endDay = startDay + self.parent.blockItem.rangeIncrement | def DrawCells(self, dc): self._doDrawingCalculations() self.canvasItemList = [] |
selectedBox = None endDay = startDay + DateTime.RelativeDateTime(days = days) | def DrawCells(self, dc): self._doDrawingCalculations() self.canvasItemList = [] | |
self.CheckConflicts() selectedBox = None for canvasItem in self.canvasItemList: canvasItem.UpdateDrawingRects() | def DrawCells(self, dc): self._doDrawingCalculations() self.canvasItemList = [] | |
if self.parent.blockItem.selection is item: | if self.parent.blockItem.selection is canvasItem.GetItem(): | def DrawCells(self, dc): self._doDrawingCalculations() self.canvasItemList = [] |
canvasItem.Draw(dc, self) | canvasItem.Draw(dc, boundingRect, self) | def DrawCells(self, dc): self._doDrawingCalculations() self.canvasItemList = [] |
selectedBox.Draw(dc, self) | selectedBox.Draw(dc, boundingRect, self) def CheckConflicts(self): for itemIndex, canvasItem in enumerate(self.canvasItemList): for innerItem in self.canvasItemList[itemIndex+1:]: if innerItem.GetItem().startTime >= canvasItem.GetItem().endTime: break canvasItem.AddConflict(innerItem) canvasItem.Calculat... | def DrawCells(self, dc): self._doDrawingCalculations() self.canvasItemList = [] |
endDay = startDay + self.parent.blockItem.rangeIncrement if datetime < startDay or \ datetime > endDay: raise ValueError, "Must be visible on the calendar" | def getPositionFromDateTime(self, datetime): if self.parent.blockItem.dayMode: startDay = self.parent.blockItem.selectedDate else: startDay = self.parent.blockItem.rangeStart delta = datetime - startDay x = (self.dayWidth * delta.day) + self.xOffset y = int(self.hourHeight * (datetime.hour + datetime.minute/float(60))... | |
control = wx.TextCtrl (parent, id, '', controlPosition) | control = myTextCtrl (parent, id, '', controlPosition) | def Create (self, parent, id): parentRect = parent.GetRect() controlPosition = wx.DefaultPosition controlSize = [parentRect.width, parentRect.height] # if the label belongs on the left, the control needs to be on the right. if self.labelStyle == "OnLeft": controlPosition = (self.editOffset, -1) # create the edit cont... |
from repository.persistence.RepositoryError import RepositoryOpenDeniedError, ExclusiveOpenDeniedError | def realMain(): if __debug__ and application.Globals.options.wing: """ Check for -wing command line argument; if specified, try to connect to an already-running WingIDE instance. See: http://wiki.osafoundation.org/bin/view/Chandler/DebuggingChandler#wingIDE". for details. """ import wingdbstub if __debug__ and applica... | |
self.ChangeHeightAndAdjustContainers(drawnHeight + (2 * self.vMargin)) | print "Setting new height to %s (%s)" % (drawnHeight + (2*self.vMargin), drawnHeight) if drawnHeight == 0: newHeight = 0 else: newHeight = drawnHeight + 2*self.vMargin self.ChangeHeightAndAdjustContainers(newHeight) | def wxSynchronizeWidget(self, useHints=False): # We now want the preview area to always appear. If the # calendar is visible, however, we always want the preview # area to describe today, rather than the currently selected # day. minical = Block.Block.findBlockByName("MiniCalendar") if isMainCalendarVisible() or not m... |
newFilterKind = None | def setPreferredKind (self, filterKind): if self.filterKind != filterKind: newFilterKind = None # We need to update the click state of the toolbar as well toolbar = Block.Block.findBlockByName("ApplicationBar") for button in toolbar.childrenBlocks: buttonEvent = getattr (button, 'event', None) if isinstance (buttonEven... | |
if ( (filterKind is None and buttonEvent.kindParameter is None) or (filterKind is not None and filterKind.isKindOf (buttonEvent.kindParameter)) ): | if (filterKind is not None and filterKind.isKindOf (buttonEvent.kindParameter)): | def setPreferredKind (self, filterKind): if self.filterKind != filterKind: newFilterKind = None # We need to update the click state of the toolbar as well toolbar = Block.Block.findBlockByName("ApplicationBar") for button in toolbar.childrenBlocks: buttonEvent = getattr (button, 'event', None) if isinstance (buttonEven... |
button.widget.selectTool() | buttonToSelect = button | def setPreferredKind (self, filterKind): if self.filterKind != filterKind: newFilterKind = None # We need to update the click state of the toolbar as well toolbar = Block.Block.findBlockByName("ApplicationBar") for button in toolbar.childrenBlocks: buttonEvent = getattr (button, 'event', None) if isinstance (buttonEven... |
@@@ this comment is applicable for all 3 ReleaseMouse calls in this routine A possible bug (either here in SideBar or perhaps within wxWidgets) causes this window to not have the mouse capture event though it never explicit released it. You can verify this by enabling (i.e., commenting in) this assert: | If we've got hoverImageRow that we must have captured the mouse """ | def stopHovering(): del self.hoverImageRow """ @@@ this comment is applicable for all 3 ReleaseMouse calls in this routine A possible bug (either here in SideBar or perhaps within wxWidgets) causes this window to not have the mouse capture event though it never explicit released it. You can verify this by enabling (i.e... |
""" if (gridWindow.HasCapture()): gridWindow.ReleaseMouse() | gridWindow.ReleaseMouse() | def stopHovering(): del self.hoverImageRow """ @@@ this comment is applicable for all 3 ReleaseMouse calls in this routine A possible bug (either here in SideBar or perhaps within wxWidgets) causes this window to not have the mouse capture event though it never explicit released it. You can verify this by enabling (i.e... |
assert not gridWindow.HasCapture() | def stopHovering(): del self.hoverImageRow """ @@@ this comment is applicable for all 3 ReleaseMouse calls in this routine A possible bug (either here in SideBar or perhaps within wxWidgets) causes this window to not have the mouse capture event though it never explicit released it. You can verify this by enabling (i.e... | |
if block.widget is not None: function() | def callback(): if block.widget is not None: function() return callback | def widgetGuardedCallback(block, function): """Call callback function only if the given object has a widget.""" if block.widget is not None: function() |
ch1.SetSelectedItemIndex( 0 ) | ch1.SetSelectedItem( 0 ) | def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log |
ch2.SetSelectedItemIndex( 0 ) | ch2.SetSelectedItem( 0 ) | def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log |
btn = wx.Button( self, -1, "Enable", (110, 200) ) self.Bind( wx.EVT_BUTTON, self.OnTestEnableButton, btn ) | cb1 = wx.CheckBox( self, -1, "Enable", (110, 200), (100, 20), wx.NO_BORDER ) self.Bind( wx.EVT_CHECKBOX, self.OnTestEnableButton, cb1 ) cb1.SetValue( True ) cb2 = wx.CheckBox( self, -1, "Allow Selections", (210, 200), (150, 20), wx.NO_BORDER ) self.Bind( wx.EVT_CHECKBOX, self.OnTestAllowSelections, cb2 ) cb2.SetValue(... | def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log |
self.l0.SetLabel( "clicked (%d) - selected (%ld)" %(event.GetId(), ch.GetSelectedItemIndex()) ) | self.l0.SetLabel( "clicked (%d) - selected (%ld)" %(event.GetId(), ch.GetSelectedItem()) ) | def OnColumnHeaderClick( self, event ): ch = event.GetEventObject() self.l0.SetLabel( "clicked (%d) - selected (%ld)" %(event.GetId(), ch.GetSelectedItemIndex()) ) # self.log.write( "Click! (%ld)\n" % event.GetEventType() ) |
self.l0.SetLabel( "resized (%d)" %(ch1.GetId()) ) | self.l0.SetLabel( "resized (%d)" %(self.ch1.GetId()) ) | def OnTestResizeButton(self, event): curWidth = self.ch1.GetTotalUIExtent() if (self.stepSize == 1): self.stepDir = (-1) else: if (self.stepSize == (-1)): self.stepDir = 1 self.stepSize = self.stepSize + self.stepDir self.ch1.DoSetSize( 20, 40, curWidth + 40 * self.stepSize, 20, 0 ) self.l0.SetLabel( "resized (%d)" %(c... |
ch.SetSelectedItemIndex( itemCount ) | ch.SetSelectedItem( itemCount ) | def OnTestAddBitmapItemButton( self, event ): ch = self.ch2 itemCount = ch.GetItemCount() ch.AppendItem( "", wx.colheader.COLUMNHEADER_JUST_Center, 40, 0, 0, 1 ) testBmp = images.getTest2Bitmap() ch.SetBitmapRef( itemCount, testBmp ) ch.SetSelectedItemIndex( itemCount ) ch.ResizeToFit() self.l0.SetLabel( "added bitmap ... |
itemIndex = ch.GetSelectedItemIndex() | itemIndex = ch.GetSelectedItem() | def OnTestDeleteItemButton( self, event ): ch = self.ch1 itemIndex = ch.GetSelectedItemIndex() if (itemIndex >= 0): ch.DeleteItem( itemIndex ) self.l0.SetLabel( "deleted item (%d) from (%d)" %(itemIndex, ch.GetId()) ) else: self.l0.SetLabel( "header (%d): no item selected" %(ch.GetId()) ) |
wx.minical.CAL_SHOW_SURROUNDING_WEEKS) | wx.minical.CAL_SHOW_SURROUNDING_WEEKS | wx.NO_BORDER) | def wxSynchronizeWidget(self): self.SetWindowStyle(wx.minical.CAL_SUNDAY_FIRST | wx.minical.CAL_SHOW_SURROUNDING_WEEKS) |
Block.Block.getWidgetID(self)) | Block.Block.getWidgetID(self), style = wx.NO_BORDER) | def instantiateWidget(self): return wxMiniCalendar(self.parentBlock.widget, Block.Block.getWidgetID(self)) |
self.connection.disconnect() print "couldnt register ", self.name | self.Logout() message = "Couldn't register %s as %s" % (self.name, self.jabberID) wxMessageBox(message) | def Login(self): if self.loggedIn or not self.HasLoginInfo(): return username = self.GetUsername() servername = self.GetServername() self.connection = Client(host=servername, debug=0) try: self.connection.connect() except IOError, e: print "couldnt connect: %s" % e self.connection = None return |
self.remoteLoadInProgress = true | self.remoteLoadInProgress = True | def _loadEvents(self): """Load the events from the repository, creating a ColumnarItem for every Event item. """ remoteAddress = self.model.columnarView.calendarView.remoteAddress overlay = self.model.columnarView.calendarView.overlayRemoteItems |
self.remoteLoadInProgress = false | self.remoteLoadInProgress = False | def _loadEvents(self): """Load the events from the repository, creating a ColumnarItem for every Event item. """ remoteAddress = self.model.columnarView.calendarView.remoteAddress overlay = self.model.columnarView.calendarView.overlayRemoteItems |
columnarItem.Show(true) | columnarItem.Show(True) | def _displayEvents(self): """Display all events in the current time range. """ # @@@ Currently a hack, we have a list of all events, # and hide/show events in the current time range # Note: set the bounds and visibility without doing a refresh, # we want one global refresh |
columnarItem.Show(false) | columnarItem.Show(False) | def _displayEvents(self): """Display all events in the current time range. """ # @@@ Currently a hack, we have a list of all events, # and hide/show events in the current time range # Note: set the bounds and visibility without doing a refresh, # we want one global refresh |
def ConvertDataObjectToDrawableObject(self, dataObject, x, y): | def ConvertDataObjectToDrawableObject(self, dataObject, x, y, move): | def ConvertDataObjectToDrawableObject(self, dataObject, x, y): # @@@ Not especially happy about this. The new item is essentially ignored # in the case where the item is moved about in the canvas. (item, hotx, hoty) = cPickle.loads(dataObject.GetData()) newTime = self.model.getDateTimeFromPos(wxPoint(x, y - hoty)) ... |
item.ChangeStart(newTime) | if (move): item.ChangeStart(newTime) else: newItem = copy.copy(item) newItem.ChangeStart(newTime) lr = Repository() lr.AddThing(newItem) item = newItem | def ConvertDataObjectToDrawableObject(self, dataObject, x, y): # @@@ Not especially happy about this. The new item is essentially ignored # in the case where the item is moved about in the canvas. (item, hotx, hoty) = cPickle.loads(dataObject.GetData()) newTime = self.model.getDateTimeFromPos(wxPoint(x, y - hoty)) ... |
path=path) | path=path, repositoryView=self.view) | def OnTestWebDAV(self, evt): self.__StoreFormData(self.currentPanelType, self.currentPanel, self.data[self.currentIndex]['values']) |
menuTitle = _(u'Put "%(collection)s" into My Items' % { 'collection' : collection.getItemDisplayName() }) | menuTitle = _(u'Put "%(collection)s" into My Items') % { 'collection': collection.getItemDisplayName()} | def onToggleMineEventUpdateUI(self, event): menuTitle = _(u"Toggle mine/not-mine") enabled = False |
menuTitle = _(u'Take "%(collection)s" out of My Items' % { 'collection' : collection.getItemDisplayName() }) | menuTitle = _(u'Take "%(collection)s" out of My Items') % { 'collection': collection.getItemDisplayName()} | def onToggleMineEventUpdateUI(self, event): menuTitle = _(u"Toggle mine/not-mine") enabled = False |
duration = duration.days * 24 + duration.seconds / 3600 | duration = duration.days * 24 + duration.seconds / float(3600) | 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 ... |
copyOther = copyFn(item, other, policy) if copyOther is not item.Nil: self[name] = SingleRef(copyOther.itsUUID) | if other is None: self.name = value else: copyOther = copyFn(item, other, policy) if copyOther is not item.Nil: self[name] = SingleRef(copyOther.itsUUID) | def _copy(self, orig, copyPolicy, copyFn): |
"Repository format version mismatch, expected version 0x%08x, but got 0x%08x" | __doc__ = "Repository format version mismatch, expected version 0x%08x, but got 0x%08x" | def __str__(self): return self.__doc__ %(self.args[0], self.args[1]) |
"Repository core schema version mismatch, expected version 0x%08x, but got 0x%08x" | __doc__ = "Repository core schema version mismatch, expected version 0x%08x, but got 0x%08x" | def __str__(self): return self.__doc__ %(self.args[0], self.args[1]) |
"No such item %s, version %d" | __doc__ = "No such item %s, version %d" | def __str__(self): return self.__doc__ %(self.args[0], self.args[1]) |
"(%s) merging %s failed because %s, reason code: %s" | __doc__ = "(%s) merging %s failed because %s, reason code: %s" | def __str__(self): return self.__doc__ % (self.args[0], self.args[1]) |
"While loading %s, %s" | __doc__ = "While loading %s, %s" | def getItem(self): return self.args[1] |
"Item %s is already being loaded" | __doc__ = "Item %s is already being loaded" | def __str__(self): return self.__doc__ %(self.args[0], self.args[1]) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.