rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
self.synchronizeWidget() | oldIgnoreSynchronizeWidget = Globals.wxApplication.ignoreSynchronizeWidget Globals.wxApplication.ignoreSynchronizeWidget = False try: self.synchronizeWidget() finally: Globals.wxApplication.ignoreSynchronizeWidget = oldIgnoreSynchronizeWidget | def render (self): try: instantiateWidgetMethod = getattr (self, "instantiateWidget") except AttributeError: return else: oldIgnoreSynchronizeWidget = Globals.wxApplication.ignoreSynchronizeWidget Globals.wxApplication.ignoreSynchronizeWidget = True try: widget = instantiateWidgetMethod() finally: Globals.wxApplication... |
decoded = Header.make_header(Header.decode_header(header)) unicodeStr = decoded.__unicode__() return constants.EMPTY.join(unicodeStr.splitlines()) | h = Header.decode_header(header) buf = [b[0].decode(b[1] or 'ascii') for b in h] return u''.join(buf) | def decodeHeader(header, charset=constants.DEFAULT_CHARSET): try: decoded = Header.make_header(Header.decode_header(header)) unicodeStr = decoded.__unicode__() return constants.EMPTY.join(unicodeStr.splitlines()) except(UnicodeError, UnicodeDecodeError, LookupError): return unicode("".join(header.splitlines()), c... |
while self.selectedDate > rangeEnd: | while self.selectedDate >= rangeEnd: | def setRange(self, date): """ We need to override CalendarBlock's because the cal ctrl always has its range over an entire week, even if a specific day is selected (and dayMode is true) """ assert self.daysPerView == 7, "daysPerView is a legacy variable, keep it at 7 plz" date = datetime.combine(date, time(tzinfo=ICUt... |
toolbar = wxToolBar(Globals.wxApplication.mainFrame, -1) | toolbar = Globals.wxApplication.mainFrame.CreateToolBar(wxTB_HORIZONTAL) | def renderOneBlock (self, parent, parentWindow): toolbar = wxToolBar(Globals.wxApplication.mainFrame, -1) toolbar.SetToolBitmapSize((self.toolSize.width, self.toolSize.height)) Globals.wxApplication.mainFrame.SetToolBar(toolbar) return toolbar, None, None |
Globals.wxApplication.mainFrame.SetToolBar(toolbar) | def renderOneBlock (self, parent, parentWindow): toolbar = wxToolBar(Globals.wxApplication.mainFrame, -1) toolbar.SetToolBitmapSize((self.toolSize.width, self.toolSize.height)) Globals.wxApplication.mainFrame.SetToolBar(toolbar) return toolbar, None, None | |
def onDestroyWidget (self): def showReentrant (block): block.isShown = True for child in block.childrenBlocks: showReentrant (child) super(DetailRootBlock, self).onDestroyWidget () showReentrant (self) | def onDestroyWidget (self): # Hack - @@@DLD - remove when wxWidgets issue is resolved. # set ourself to be shown, to work around Windows DetailView garbage problem. def showReentrant (block): block.isShown = True for child in block.childrenBlocks: showReentrant (child) super(DetailRootBlock, self).onDestroyWidget () sh... | |
self.control.SetSelection(0, self.control.GetLastPosition()) | self.control.SetSelection(-1, -1) | def onGainFocus(self, event): if self.showingSample: self.control.SetSelection(0, self.control.GetLastPosition()) event.Skip() |
control.SetSelection(0, len(text)) | control.SetSelection(-1, -1) | def __shadeBetween(shade, color1, color2): shade1 = shade(color1) shade2 = shade(color2) smaller = min(shade1, shade2) delta = abs(shade1 - shade2) return smaller + (delta / 2) |
control.SetSelection(0, control.GetLastPosition()) | control.SetSelection(-1, -1) | def onClick(self, event): """ Ignore clicks if we're showing the sample """ control = event.GetEventObject() if self.showingSample: if control == wx.Control.FindFocus(): # logger.debug("onClick: ignoring click because we're showing the sample.") control.SetSelection(0, control.GetLastPosition()) # Make sure the whole t... |
whoRedirect = item.getAttributeAspect('who', 'redirectTo') try: whoString = item.who except AttributeError: whoString = '' if len(whoString) > 0: | whoContacts = item.who whoString = '' if len(whoContacts) > 0: | def loadAttributeIntoWidget (self, item, widget): whoRedirect = item.getAttributeAspect('who', 'redirectTo') try: whoString = item.who # get redirected who list except AttributeError: whoString = '' if len(whoString) > 0: whoNames = [] for whom in whoString.values(): whoNames += (whom.getItemDisplayName(),) whoString =... |
for whom in whoString.values(): whoNames += (whom.getItemDisplayName(),) | for whom in whoContacts.values(): whoNames.append(whom.getItemDisplayName()) | def loadAttributeIntoWidget (self, item, widget): whoRedirect = item.getAttributeAspect('who', 'redirectTo') try: whoString = item.who # get redirected who list except AttributeError: whoString = '' if len(whoString) > 0: whoNames = [] for whom in whoString.values(): whoNames += (whom.getItemDisplayName(),) whoString =... |
emailAccountItem = Mail.EmailAccount("emailAccountItem") | def _verifyMailMessage(message): pass | |
self.assertEqual(emailAccountItem.itsKind, Mail.MailParcel.getEmailAccountKind()) | def _verifyMailMessage(message): pass | |
sizer.SetSizeHints(self) | def __init__(self, parent, id, tzCharacterStyle, *arguments, **keywords): super(wxCalendarControl, self).__init__(parent, id, *arguments, **keywords) app = wx.GetApp() self.allDayCloseArrowImage = app.GetImage("AllDayCloseArrow_whitebg.png") self.allDayOpenArrowImage = app.GetImage("AllDayOpenArrow_whitebg.png") | |
helpString = _(u'Remove the current selection from the current collection')), | helpString = _(u'Remove the current selection from the current collection'), wxId = wx.ID_DELETE), | def makeVisibleHourMenuItems(parcel): """ Create the 'Visible Hours' submenu. Should look like: Automatic --------- 5 hours 6 hours |
helpString = _(u'Move the current selection to the trash'), wxId = wx.ID_DELETE), | helpString = _(u'Move the current selection to the trash')), | def makeVisibleHourMenuItems(parcel): """ Create the 'Visible Hours' submenu. Should look like: Automatic --------- 5 hours 6 hours |
def onSetContentsEvent(self, event): """ The calendar control is responsible for re-broadcasting the selection when the contents change. """ super(CalendarControl, self).onSetContentsEvent(event) self.postSelectItemsBroadcast() | def onSetContentsEvent(self, event): """ The calendar control is responsible for re-broadcasting the selection when the contents change. | |
other.setDirty() | other.setDirty(attribute=otherName) | def detach(self, item, name, other, otherName): |
if isinstance(v, dict) or isinstance(v, list): | if (isinstance(v, dict) or isinstance(v, list) or isinstance(v, RefList)): | def formatReference(reference): """ Formats the a reference attribute to be clickable, etcetera """ |
work=True): | work=(self.fileStyle() == self.STYLE_SINGLE)): | 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. |
elif kind is Globals.repository.findPath("//parcels/osaf/contentmodel/notes/Note"): | elif kind is Globals.repository.findPath("//parcels/osaf/contentmodel/Note"): | def getHTMLText(self, item): |
self.needsUpdateUI = True | def OnInit(self): """ Main application initialization. """ util.timing.begin("wxApplication OnInit") #@@@Temporary testing tool written by Morgen -- DJA | |
self.mainFrame.SetSize(rememberSize) self.mainFrame.Show() Utility.initWakeup(self.UIRepositoryView) from osaf.mail import MailService Globals.mailService = MailService(self.UIRepositoryView) Globals.mailService.startup() util.timing.end("wxApplication OnInit") | def _displayHook(obj): if obj is not None: print repr(obj) | |
file = i18n.getImage(root + "-" + sys.platform + extension) | file = getImage(root + "-" + sys.platform + extension) | def GetRawImage (self, name): """ Return None if image isn't found, otherwise return the raw image. Also look first for platform specific images. """ |
file = i18n.getImage(name) | file = getImage(name) | def GetRawImage (self, name): """ Return None if image isn't found, otherwise return the raw image. Also look first for platform specific images. """ |
duration = (endTime - startTime) duration = duration.days * 24 + duration.seconds / float(3600) if duration <= 0.5: duration = 0.5 height = int(duration * self.hourHeight) | height = int(self.hourHeight * (endTime.hour + endTime.minute/60.0) - startY) | def MakeRectForRange(self, startTime, endTime): """ Turn a datetime range into a single rectangle that can be drawn on the screen """ startX, startY, width = self.getPositionFromDateTime(startTime) duration = (endTime - startTime) duration = duration.days * 24 + duration.seconds / float(3600) if duration <= 0.5: durat... |
pen = wx.Pen(color, 4, wx.DOT) | if '__WXMAC__' in wx.PlatformInfo: """ @@@ the dash array may need to be a global, due to wx persistance limitations pen = wx.Pen(color, 4, wx.USER_DASH) pen.SetDashes([255, 255, 0, 0, 255, 255, 0, 0]) else: pen = wx.Pen(color, 4, wx.DOT) | def GetStatusPen(self, color): # probably should use styles to determine a good pen color item = self.GetItem() if (item.transparency == "confirmed"): pen = wx.Pen(color, 4) elif (item.transparency == "fyi"): pen = wx.Pen(color, 1) elif (item.transparency == "tentative"): pen = wx.Pen(color, 4, wx.DOT) return pen |
cornerRadius = 0 | def Draw(self, dc, boundingRect, styles, brushOffset, selected): item = self._item | |
dc.SetPen(wx.BLACK_PEN) | def Draw(self, dc, boundingRect, styles, brushOffset, selected): item = self._item | |
dc.SetPen(wx.BLACK_PEN) | def Draw(self, dc, styles, brushOffset, selected): item = self._item itemRect = self._bounds gradientLeft, gradientRight, outlineColor, textColor = \ styles.blockItem.getEventColors(item, selected) if selected: brush = styles.brushes.GetGradientBrush(itemRect.x + brushOffset, itemRect.width, gradientLeft, gradientRig... | |
On mac, the brushes are relative to the toplevel window. We have | On Mac, the brushes are relative to the toplevel window. We have | def GetPlatformBrushOffset(self): """ On mac, the brushes are relative to the toplevel window. We have to walk up the parent window chain to find our offset within the parent window. Other platforms, the brush is offset from the current window. """ if '__WXMAC__' in wx.PlatformInfo: brushOffset = 0 p = self while not p... |
for calendar in vobject.readComponents(text, validate=False, | for calendar in vobject.readComponents(text, validate=True, | def itemsFromVObject(view, text, coerceTzinfo = None, filters = None, monolithic = True, updateCallback=None, stats=None): """ Take a string, create or update items from that stream. The filters argument is an optional sequence of attributes to not populate. monolithic is True for calendars that may contain multiple ... |
NotifyUIAsync(self.mailMessage, callable=key) | NotifyUIAsync(self.mailMessage, cl=key) | def _actionCompleted(self): if __debug__: trace("_actionCompleted") |
NotifyUIAsync("", callable='setStatusMessage') | NotifyUIAsync("", cl='setStatusMessage') | def _mailFailure(self, exc): """If the mail message was not sent update the mailMessage object""" |
if self.accountPanel.IsShown(): username = self.textUsername.GetValue() password = self.textPassword.GetValue() collection = sharing.subscribe(view, url, accountInfoCallback=self.accountInfoCallback, updateCallback=self.updateCallback, username=username, password=password) else: collection = sharing.subscribe(view, url... | collection = sharing.subscribe(view, url, accountInfoCallback=self.accountInfoCallback, updateCallback=self.updateCallback, username=username, password=password) | def OnSubscribe(self, evt): view = self.view url = self.textUrl.GetValue() url = url.strip() if url.startswith('webcal:'): url = 'http:' + url[7:] |
prompt = "Unicode build: [%d]" %(ch1.GetFlagUnicode()) | def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log | |
choice.SetSelection( 1 ) | choice.SetSelection( ch1.GetSelectionDrawStyle() ) | def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log |
cb1.SetValue( True ) | cb1.SetValue( ch1.IsEnabled() ) | def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log |
cb2.SetValue( True ) | cb2.SetValue( ch1.GetFlagVisibleSelection() ) | def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log |
cb3.SetValue( True ) | cb3.SetValue( ch1.GetFlagProportionalResizing() ) | def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log |
typeNames.append(key) | typeNames.append( (value['description'], key) ) | def __init__(self, parent, title, size=wx.DefaultSize, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE, resources=None, account=None, view=None): |
for name in typeNames: self.choiceNewType.Append(name) | for (description, name) in typeNames: newIndex = self.choiceNewType.Append(description) self.choiceNewType.SetClientData(newIndex, name) | def __init__(self, parent, title, size=wx.DefaultSize, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE, resources=None, account=None, view=None): |
accountType = self.choiceNewType.GetString(selection) | accountType = self.choiceNewType.GetClientData(selection) | def OnNewAccount(self, evt): |
elif self.aignment == "Right": | elif self.alignment == "Right": | def RenderOneBlock (self, parent, parentWindow): assert isinstance (parent, wxSizerPtr) #must be in a container if self.alignment == "Left": style = wxALIGN_LEFT elif self.alignment == "Center": style = wxALIGN_CENTRE elif self.aignment == "Right": style = wxALIGN_RIGHT |
try: testedEqual = hasattr(self.proxiedItem, name) and \ getattr(self.proxiedItem, name) == value except TypeError: testedEqual = False | testedEqual = False if hasattr(self.proxiedItem, name): oldValue = getattr(self.proxiedItem, name) oldTzinfo = getattr(oldValue, 'tzinfo', None) tzinfo = getattr(value, 'tzinfo', None) testedEqual = (oldTzinfo == tzinfo and oldValue == value) | def __setattr__(self, name, value): if name in self.proxyAttributes: object.__setattr__(self, name, value) elif self.proxiedItem.rruleset is None: setattr(self.proxiedItem, name, value) else: try: testedEqual = hasattr(self.proxiedItem, name) and \ getattr(self.proxiedItem, name) == value except TypeError: # datetimes ... |
for item in kind.iterItems(recursive=recursive): yield item | if kind is not None: for item in kind.iterItems(recursive=recursive): yield item | def ofKind(kindName, recursive=True): kind = getKind(kindName) for item in kind.iterItems(recursive=recursive): yield item |
self.SetMinSize(wx.Size(width, height)) | self.SetSize(wx.Size(width, height)) | def UpdateSize(self): """ Sizes the button to just fit the bitmap """ |
Currently does not work well on os x, widgets doesn't give us a button with no border. | Currently does not work well on MacOSX: wxWidgets doesn't implement a button with no border. | def UpdateSize(self): """ Sizes the button to just fit the bitmap """ |
self._logger.addHandler(logging.StreamHandler()) | if not self._logger.handlers: self._logger.addHandler(logging.StreamHandler()) | def __init__(self): |
ch1 = wx.colheader.wxColumnHeader(self, 711, (20, 40), (350, 20), 0) ch1.AppendItem("Sun", wx.colheader.wxCOLUMNHEADER_JUST_Center, 50, 1, 1) ch1.AppendItem("Mon", wx.colheader.wxCOLUMNHEADER_JUST_Center, 50, 0, 1) ch1.AppendItem("Tue", wx.colheader.wxCOLUMNHEADER_JUST_Center, 50, 0, 1) ch1.AppendItem("Wed", wx.colhead... | ch1 = wx.colheader.ColumnHeader(self, 711, (20, 40), (350, 20), 0) ch1.AppendItem("Sun", wx.colheader.COLUMNHEADER_JUST_Center, 50, 1, 1) ch1.AppendItem("Mon", wx.colheader.COLUMNHEADER_JUST_Center, 50, 0, 1) ch1.AppendItem("Tue", wx.colheader.COLUMNHEADER_JUST_Center, 50, 0, 1) ch1.AppendItem("Wed", wx.colheader.COLUM... | def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE) self.log = log |
ch2 = wx.colheader.wxColumnHeader(self, 711, (80, 90), (270, 20), 0) ch2.AppendItem("Juan", wx.colheader.wxCOLUMNHEADER_JUST_Left, 90, 1, 1) ch2.AppendItem("Valdz", wx.colheader.wxCOLUMNHEADER_JUST_Center, 90, 0, 1) ch2.AppendItem("coffeehead", wx.colheader.wxCOLUMNHEADER_JUST_Right, 90, 0, 1) | ch2 = wx.colheader.ColumnHeader(self, 711, (80, 90), (270, 20), 0) ch2.AppendItem("Juan", wx.colheader.COLUMNHEADER_JUST_Left, 90, 1, 1) ch2.AppendItem("Valdz", wx.colheader.COLUMNHEADER_JUST_Center, 90, 0, 1) ch2.AppendItem("coffeehead", wx.colheader.COLUMNHEADER_JUST_Right, 90, 0, 1) | def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE) self.log = log |
if item.getAttributeAspect (attributeName, "cardinality") == "list": | def GetElementValue (self, row, column): item = self.blockItem.contents [row] attributeName = self.blockItem.columnData [column] try: value = item.getAttributeValue (attributeName) except AttributeError: value = "" else: # @@@ getAttributeAspect of a indirectAttribute returns # the aspect of the indirectAttribute rathe... | |
try: for part in compoundValue: if value: value = value + ", " value = value + part.getItemDisplayName() except: return compoundValue | for part in compoundValue: if value: value = value + ", " value = value + part.getItemDisplayName() | def GetElementValue (self, row, column): item = self.blockItem.contents [row] attributeName = self.blockItem.columnData [column] try: value = item.getAttributeValue (attributeName) except AttributeError: value = "" else: # @@@ getAttributeAspect of a indirectAttribute returns # the aspect of the indirectAttribute rathe... |
if self.previousIndex != self.blockItem.contents.indexName: self.collapsedSections = set() self.previousIndex = self.blockItem.contents.indexName | def SynchronizeDelegate(self): """ its reasonably cheap to rebuild section indexes, as get_divisions is really optimized for this """ | |
if itemIndex > sectionIndex: | if itemIndex >= sectionIndex: | def IndexToRow(self, itemIndex): """ Find the row for the corresponding item. This is done with a linear search through the sections. Generally there aren't a lot of sections though so this should be reasonably fast. """ if len(self.sectionIndexes) == 0: return itemIndex |
if len(added) != 0 or len (removed) != 1: print "FAILED",origName, three.contactName.firstName, added,removed | def testNotifyUnion(self): """ Test notification of union query """ import osaf.contentmodel.tests.GenerateItems as GenerateItems | |
return self.map[key] | return self.map[long(key)] | def __getitem__(self, key): return self.map[key] |
self.map[key] = value | self.map[long(key)] = value | def __setitem__(self, key, value): self.map[key] = value |
del self.map[key] | del self.map[long(key)] | def __delitem__(self, key): del self.map[key] |
if '__WXGTK__' in wx.PlatformInfo: charStyle.fontSize = 10 elif '__WXMAC__' in wx.PlatformInfo: charStyle.fontSize = 11 elif '__WXMSW__' in wx.PlatformInfo: charStyle.fontSize = 9 | charStyle.fontSize = 11 | def __init__(self, *arguments, **keywords): super(wxPreviewArea, self).__init__(*arguments, **keywords) self.currentDaysItems = [] self.Bind(wx.EVT_PAINT, self.OnPaint) charStyle = Styles.CharacterStyle() #see Bug 3625 if '__WXGTK__' in wx.PlatformInfo: charStyle.fontSize = 10 elif '__WXMAC__' in wx.PlatformInfo: cha... |
if classParameter is MissingClass: classParameter = sidebar.filterClass if issubclass(classParameter, pim.Stamp): stampClass = classParameter else: stampClass = MissingClass | def onNewItemEvent(self, event): # Create a new Content Item allCollection = schema.ns('osaf.pim', self).allCollection sidebar = Block.findBlockByName("Sidebar") classParameter = event.classParameter | |
trunkSubtreeKind = self.findPath("//parcels/osaf/framework/blocks/detail/DetailTrunkSubtree") return trunkSubtreeKind, False | return DetailTrunkSubtree, 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) trunkSubtreeKind = self.findPath("//parcels/osaf/framework/blocks/detail/DetailT... |
from osaf.framework.blocks.detail import DetailTrunkSubtree | def _getSubtrees(self): """ Get a list of mappings from kind to subtree; by default, we generate it once at startup """ try: subtrees = self.subtreeList except AttributeError: from osaf.framework.blocks.detail import DetailTrunkSubtree subtrees = list(DetailTrunkSubtree.iterItems(self.itsView)) self.subtreeList = subtr... | |
keyItem.displayName == u"All filtered by Calendar Event Mixin Kind"): | keyItem.displayName != u"In filtered by Calendar Event Mixin Kind" and keyItem.displayName != u"Out filtered by Calendar Event Mixin Kind"): | def _makeTrunkForCacheKey(self, keyItem): if isinstance (keyItem, ItemCollection.ItemCollection): sidebar = Block.Block.findBlockByName ("Sidebar") if (sidebar.filterKind is self.findPath ("//parcels/osaf/contentmodel/calendar/CalendarEventMixin") and keyItem.displayName == u"All filtered by Calendar Event Mixin Kind")... |
"Building Windows Installer") return nsisScriptPath | "Building Windows Installer") installTargetFile = '%s.exe' % fileRoot installTarget = os.path.join(buildenv['root'], installTargetFile) if os.path.exists(installTarget): os.remove(installTarget) os.rename(os.path.join(nsisScriptPath, 'Setup.exe'), installTarget) elif buildenv['os'] == 'posix': specPath = os.p... | def makeInstaller(buildenv, directories, fileRoot): """This assumes that directory is an immediate child of the current dir""" # currently only windows is processed # TODO: added Linux (RPM) and OS X (dmg?) support if buildenv['os'] == 'win': nsisScriptPath = os.path.join(buildenv['root'], "internal", "installers", "wi... |
dirList = os.listdir(logDir) for file in dirList: if re.search("event\.log\.\d+", file): fname = os.path.join(logDir, file) logger.info("eventLogger.Uploader: Trying to upload %s", fname) self.uploadFile(fname) | if os.path.isdir (logDir): dirList = os.listdir(logDir) for file in dirList: if re.search("event\.log\.\d+", file): fname = os.path.join(logDir, file) logger.info("eventLogger.Uploader: Trying to upload %s", fname) self.uploadFile(fname) | def run(self): logger.info("eventLogger - receiveWakeupCall()") |
lastModified = resp.getheader('Last-Modified', None) self.lastModified = lastModified logger.info("...imported, new last modified: %s" % lastModified) | lastModified = resp.headers.getHeader('Last-Modified') self.lastModified = lastModified[-1] logger.info("...imported, new last modified: %s" % self.lastModified) | def get(self): self.connect() |
conduit = WebDAVConduit(view=view, shareName=shareName, account=account) | def newInboundShare(view, url): """ Create a new Share item for a URL this client is subscribing to. Finds a WebDAV account which matches this URL; if none match then prompt the user for username/password for that URL. If either of these result in finding/creating an account, then create a Share item and return it. ... | |
contact = GenerateItems.GenerateContact(view) contact.contactName.firstName = "Alexis" | def testNotifyUnion(self): """ Test notification of union query """ import osaf.contentmodel.tests.GenerateItems as GenerateItems | |
hBox.Add(self.listbox, 0, wxNORTH | wxWEST | wxSOUTH, 8) | self.listbox.SetSelection(0) hBox.Add(self.listbox, 0, wxNORTH | wxWEST | wxSOUTH, 8) | def RenderWidgets(self): hBox = wxBoxSizer(wxHORIZONTAL) |
unittest.main() | from util import test_finder unittest.main(testLoader=test_finder.ScanningLoader()) | def additional_tests(): return unittest.TestSuite( [ test_stamping_doc(), ] ) |
self.colHeaderBg = wx.WHITE | self.colHeaderBgPen = wx.WHITE_PEN self.colHeaderBgBrush = wx.WHITE_BRUSH self.mainColour = wx.Colour(0, 0, 0) self.lightColour = wx.Colour(255, 255, 255) self.highlightColour = wx.Colour(204, 204, 204) self.highlightColourBrush = wx.Brush(self.highlightColour) self.highlightColourPen = wx.Pen(self.highlightColour) l... | def Init(self): |
dc.SetPen(wx.Pen(wx.LIGHT_GREY, 1, wx.SOLID)) | dc.SetPen(wx.LIGHT_GREY_PEN) | def OnMiniCalPaint(self, event): dc = wx.PaintDC(self) |
dc.SetBrush(wx.Brush(wx.BLACK, wx.SOLID)) dc.SetPen(wx.Pen(wx.BLACK, 1, wx.SOLID)) | dc.SetBrush(wx.BLACK_BRUSH) dc.SetPen(wx.BLACK_PEN) | def OnMiniCalPaint(self, event): dc = wx.PaintDC(self) |
dc.SetPen(wx.Pen(wx.BLACK, 1, wx.SOLID)) | dc.SetPen(wx.BLACK_PEN) | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
dc.SetBrush(wx.Brush(self.colHeaderBg, wx.SOLID)) dc.SetPen(wx.Pen(self.colHeaderBg, 1, wx.SOLID)) | dc.SetBrush(self.colHeaderBgBrush) dc.SetPen(self.colHeaderBgPen) | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
mainColour = wx.Colour(0, 0, 0) lightColour = wx.Colour(255, 255, 255) highlightColour = wx.Colour(204, 204, 204) lineColour = wx.Colour(229, 229, 229) busyColour = wx.Colour(127, 191, 255) dc.SetTextForeground(mainColour) | dc.SetTextForeground(self.mainColour) | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
dc.SetTextBackground(highlightColour) dc.SetBrush(wx.Brush(highlightColour, wx.SOLID)) | dc.SetTextBackground(self.highlightColour) dc.SetBrush(self.highlightColourBrush) | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
dc.SetPen(wx.Pen(highlightColour, 1, wx.SOLID)) | dc.SetPen(self.highlightColourPen) | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
dc.SetTextBackground(busyColour) dc.SetBrush(wx.Brush(busyColour, wx.SOLID)) | dc.SetTextBackground(self.busyColour) dc.SetBrush(self.busyColourBrush) | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
dc.SetPen(wx.Pen(busyColour, 1, wx.SOLID)) | dc.SetPen(self.busyColourPen) | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
dc.SetTextForeground(lightColour) | dc.SetTextForeground(self.lightColour) | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
dc.SetBrush(wx.Brush(wx.BLACK, wx.SOLID)) dc.SetPen(wx.Pen(wx.BLACK, 1, wx.SOLID)) | dc.SetBrush(wx.BLACK_BRUSH) dc.SetPen(wx.BLACK_PEN) | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
dc.SetTextForeground(mainColour) | dc.SetTextForeground(self.mainColour) | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
pen = wx.Pen(lineColour, 2, wx.SOLID) pen.SetCap(wx.CAP_BUTT) dc.SetPen(pen) | dc.SetPen(self.lineColourPen) | def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK); |
else: print "<namespace %s> being used in %s" %(namespace, parcelFile) | def startElementNS(self, (uri, local), qname, attrs): if local == "namespace" and uri == CORE: if attrs.has_key((None, 'value')): value = attrs.getValue((None, 'value')) self.namespace = value if local == "namespaceMap" and uri == CORE: if attrs.has_key((None, 'key')): key = attrs.getValue((None, 'key')) if attrs.has_k... | |
link = children._get(child, False) | link = children._get(child) | def applyChange(self, children, changes, child, oldAlias): |
self.addURLButton = wxButton(self, 10, "Add") self.addURLButton.SetSize((45, -1)) | self.addURLButton = wxButton(self, -1, "Add", style=wxBU_EXACTFIT) | def OnInit(self): self.titleFont = wxFont(16, wxSWISS, wxNORMAL, wxNORMAL, false, "Arial") #create splitter window self.twoPane = wxSplitterWindow(self, -1) self.twoPane.SetMinimumPaneSize(100) # prevent unsplitting #create main UI elements self.titleText = wxStaticText(self, -1, self.model.displayName) self.titleTex... |
self.twoPane.SplitHorizontally(self.RSSIndexView, self.RSSItemView) self.twoPane.SetSashPosition(250) | self.twoPane.SplitHorizontally(self.RSSIndexView, self.RSSItemView, 250) wxCallAfter(self.RSSIndexView.Refresh) wxCallAfter(self.urlTextArea.SetFocus) | def OnInit(self): self.titleFont = wxFont(16, wxSWISS, wxNORMAL, wxNORMAL, false, "Arial") #create splitter window self.twoPane = wxSplitterWindow(self, -1) self.twoPane.SetMinimumPaneSize(100) # prevent unsplitting #create main UI elements self.titleText = wxStaticText(self, -1, self.model.displayName) self.titleTex... |
aFrame = self while not isinstance(aFrame,wxFrame): aFrame = aFrame.GetParent() self.frame = aFrame self.RSSItemView.SetRelatedFrame(aFrame,_("ZaoBao - your daily fix")) | self.frame = wxGetTopLevelParent(self) self.RSSItemView.SetRelatedFrame(self.frame,_("ZaoBao - your daily fix")) | def OnInit(self): self.titleFont = wxFont(16, wxSWISS, wxNORMAL, wxNORMAL, false, "Arial") #create splitter window self.twoPane = wxSplitterWindow(self, -1) self.twoPane.SetMinimumPaneSize(100) # prevent unsplitting #create main UI elements self.titleText = wxStaticText(self, -1, self.model.displayName) self.titleTex... |
if len(value) < key: | if key < len(value): | def getValue(self, attribute, key, default=None, _attrDict=None): 'Get a value from a multi-valued attribute.' |
field.SetSelection(-1, -1) | field.SelectAll() | def SelectFirstField(self): for entry in self.fieldList: key, field, type = entry if type != 'boolean': field.SetFocus() field.SetSelection(-1, -1) return |
field.SetSelection(-1, -1) | field.SelectAll() | def OnKeystroke(self, event): keycode = event.GetKeyCode() # handle return and tab by bumping to the next field if keycode == 13 or keycode == 9: newIndex = self.index + 1 if newIndex >= len(self.dialog.fieldList): newIndex = 0 key, field, type = self.dialog.fieldList[newIndex] field.SetFocus() field.SetSelection(-1, -... |
self.CheckEditableBlock("EditCalendarStartDate", "start date", dict[field]) | self.CheckEditableBlock("EditCalendarStartDate", "start date", self.formatDate(dict[field])) | def Check_DetailView(self, dict): """ Check expected values by comparation to the data diplayed in the detail view @type dict : dictionnary @param dict : dictionnary with expected item attributes values for checking {"attributeName":"expected value",...} """ self.logger.SetChecked(True) self.SelectItem() # call the che... |
self.CheckEditableBlock("EditCalendarEndDate", "end date", dict[field]) | self.CheckEditableBlock("EditCalendarEndDate", "end date", self.formatDate(dict[field])) | def Check_DetailView(self, dict): """ Check expected values by comparation to the data diplayed in the detail view @type dict : dictionnary @param dict : dictionnary with expected item attributes values for checking {"attributeName":"expected value",...} """ self.logger.SetChecked(True) self.SelectItem() # call the che... |
self.CheckEditableBlock("EditRecurrenceEnd", "recurrence end", dict[field]) | self.CheckEditableBlock("EditRecurrenceEnd", "recurrence end", self.formatDate(dict[field])) | def Check_DetailView(self, dict): """ Check expected values by comparation to the data diplayed in the detail view @type dict : dictionnary @param dict : dictionnary with expected item attributes values for checking {"attributeName":"expected value",...} """ self.logger.SetChecked(True) self.SelectItem() # call the che... |
s_date = "%s/%s/%s" %(startTime.month, startTime.day, startTime.year) if not dict[field] == s_date : self.logger.ReportFailure("(On start date Checking) || object start date = %s ; expected start date = %s" %(s_date, dict[field])) | s_date = self.formatDate("%s/%s/%s" %(startTime.month, startTime.day, startTime.year) ) dictDate = self.formatDate(dict[field]) if not dictDate == s_date : self.logger.ReportFailure("(On start date Checking) || object start date = %s ; expected start date = %s" %(s_date, dictDate)) | def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionnary @param dict : dictionnary with expected item attributes values for checking {"attributeName":"expected value",...} """ self.logger.SetChecked(True) # check the changing values for... |
e_date = "%s/%s/%s" %(endTime.month, endTime.day, endTime.year) if not dict[field] == e_date : self.logger.ReportFailure("(On end date Checking) || object end date = %s ; expected end date = %s" %(e_date, dict[field])) | e_date = self.formatDate("%s/%s/%s" %(endTime.month, endTime.day, endTime.year)) dictDate = self.formatDate(dict[field]) if not dictDate == e_date : self.logger.ReportFailure("(On end date Checking) || object end date = %s ; expected end date = %s" %(e_date, dictDate)) | def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionnary @param dict : dictionnary with expected item attributes values for checking {"attributeName":"expected value",...} """ self.logger.SetChecked(True) # check the changing values for... |
allDay and | (allDay or anyTime) and | def getDayItemsByDate(self, date): items = [] nextDate = date + DateTime.RelativeDateTime(days=1) for item in self.contents: try: allDay = item.allDay except AttributeError: allDay = False if (item.hasLocalAttributeValue('startTime') and allDay and (item.startTime >= date) and (item.startTime < nextDate)): items.append... |
(not allDay) and | (not allDay and not anyTime) and | def getItemsByDate(self, date): """ Convenience method to look for the items in the block's contents that appear on the given date. @@@ We may push this work down into ItemCollections and/or Queries. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.