rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
(x,y,width,height) = rect
def DrawEventRectangle(self, dc, rect, hasLeftRounded=False, hasTopRightRounded=True, hasBottomRightRounded=True, clipRightSide=False): """ Make a rounded 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 correc...
class wxRepositoryViewerEdit(wxSplitterWindow): """ An edit tab for the Repository viewer. """ __dirty=False def __init__(self, parent, id): wxSplitterWindow.__init__(self, parent, id) self.p2 = wxWindow(self, -1) box = wxBoxSizer(wxVERTICAL) b = wxButton(self.p2, -1, "Submit Changes") box.Add(b, 0, wxALIGN_CENTER|w...
def GetDetailItem(self): di = self.detailItem if (di == "") or (type(di) != type("")): return None else: an_item = app.repository.getRoots()[0] return an_item.find(di)
self.treeCtrl.AddColumn(_('Item Name')) self.treeCtrl.AddColumn(_('Display Name')) self.treeCtrl.AddColumn(_('Kind')) self.treeCtrl.AddColumn(_('UUID')) self.treeCtrl.AddColumn(_('URL'))
info = wxTreeListColumnInfo() labels=['Item Name', 'Display Name', 'Kind', 'UUID', '', 'URL'] colLabels = map(_, labels) colSize = [80, 80, 80, 120, 10, 120] for x in range(len(colLabels)): info.SetText(colLabels[x]) info.SetWidth(colSize[x]) self.treeCtrl.AddColumnInfo(info)
def OnInit(self): """ Initializes the repository viewer, setting up the layout and populating the tree ctrl. """ # @@@ sizer layout should be handled in xrc, but xrc # does not yet support wxTreeListCtrl
self.detail = wxRepositoryViewerDetail(self.splitter, -1, style=wxNO_FULL_REPAINT_ON_RESIZE | wxSUNKEN_BORDER)
self.viewTab = wxPanel(self.notebook, -1) self.detail = wxRepositoryViewerDetail(self.viewTab, -1, style=wxNO_FULL_REPAINT_ON_RESIZE | wxSUNKEN_BORDER)
def OnInit(self): """ Initializes the repository viewer, setting up the layout and populating the tree ctrl. """ # @@@ sizer layout should be handled in xrc, but xrc # does not yet support wxTreeListCtrl
self.splitter.SplitHorizontally(self.treeCtrl, self.detail, 200)
self.editTab= wxRepositoryViewerEdit(self.notebook, -1) self.notebook.AddPage(self.viewTab, "View", select=1) self.notebook.AddPage(self.editTab, "Edit") notebookContainer = wxBoxSizer(wxVERTICAL) notebookContainer.Add(wxNotebookSizer(self.notebook), 1, wxEXPAND, 0) self.notebookPanel.SetAutoLayout(1) self.notebook...
def OnInit(self): """ Initializes the repository viewer, setting up the layout and populating the tree ctrl. """ # @@@ sizer layout should be handled in xrc, but xrc # does not yet support wxTreeListCtrl
self.treeCtrl.SetItemText(node, str(item.getItemPath()), 4)
self.treeCtrl.SetItemText(node, str(item.getItemPath()), 5)
def LoadItem(self, item, node): """ Populates the tree's table with details of this particular item. """ displayName = str(item.getItemDisplayName()) if displayName == str(item.getItemName()): displayName = "(unnamed)" if item.hasAttributeValue('kind'): kind = item.kind.getItemName() else: kind = "(kindless)" self.tr...
if acceptedErrList is not None and str(e) in acceptedErrList: log.debug('Ignoring post connection error %s' %str(e))
err = messages.SSL_HOST_MISMATCH % {'expectedHost': e.expectedHost, 'actualHost': e.actualHost} if acceptedErrList is not None and err in acceptedErrList: log.debug('Ignoring post connection error %s' % err)
def postConnectionVerify(self, peerX509, expectedHost): #Do a post connection check on an SSL connection. This is done just #after the SSL connection has been established, but before exchanging #any real application data like username and password. # #This implementation checks to make sure that the certificate that th...
"TestSwitchTimezone.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) QAUITestAppLib.App_ns.itsView.check()
checked and "Stamped" or "Unstamped"))
checked and "Unstamped" or "Stamped"))
def synchronizeWidget(self, useHints=False): # toggle this icon to reflect the read only status of the selected item super(ReadOnlyIconBlock, self).synchronizeWidget(useHints)
pim_ns.masterEvents.reindexKeys(floatingKeys, 'recurrenceEnd')
keys = pim_ns.masterEvents.getIndex('recurrenceEnd') masterFloatingKeys = [i for i in floatingKeys if i in keys] pim_ns.masterEvents.reindexKeys(masterFloatingKeys, 'recurrenceEnd')
def reindexFloatingEvents(view): """ When floating timezone changes, floating events need to be reindexed in the events collection. """ pim_ns = schema.ns("osaf.pim", view) floatingKeys = list(pim_ns.floatingEvents.iterkeys()) pim_ns.events.reindexKeys(floatingKeys, 'effectiveStart', 'effectiveEnd') pim_ns.masterEvent...
pim_ns.masterEvents.reindexKeys(UTCKeys, 'recurrenceEndNoTZ')
masterUTCKeys = [i for i in UTCKeys if i in keys] pim_ns.masterEvents.reindexKeys(masterUTCKeys, 'recurrenceEndNoTZ')
def reindexFloatingEvents(view): """ When floating timezone changes, floating events need to be reindexed in the events collection. """ pim_ns = schema.ns("osaf.pim", view) floatingKeys = list(pim_ns.floatingEvents.iterkeys()) pim_ns.events.reindexKeys(floatingKeys, 'effectiveStart', 'effectiveEnd') pim_ns.masterEvent...
logger.error('Value %s of type %s in attribute %s on %s is owned by attribute %s on %s', value, type(value), name, item._repr_(), self._attribute, self._item)
logger.error('Value %s of type %s in attribute %s on %s is owned by attribute %s on %s', self, type(self), attribute, item._repr_(), self._attribute, self._item)
def _check(self, logger, item, attribute):
def OnTextEnter(self, event):
def SaveItem(self):
def OnTextEnter(self, event): if self.item != None: self.item.displayName = self.GetValue() self.Hide() event.Skip()
for toolbarItem in self.toolItemList:
for toolbarItem in self.blockItem.dynamicChildren:
def _item_named (self, toolbarItemName): for toolbarItem in self.toolItemList: if getattr(toolbarItem, 'blockName', None) == toolbarItemName: return toolbarItem return None
self.version = 0
self.version = Application.VERSION
def __init__(self): """ Create instances of other objects that belong to the application. Here are all the public attributes:
kindKind = self.findPath('//Schema/Core/Kind') allKinds = kindKind.iterItems() contentItemKind = ContentItem.getKind (self.itsView) contentItemKinds = [ aKind for aKind in allKinds if aKind.isKindOf (contentItemKind) ]
contentItemKind = ContentItem.getKind(self.itsView) contentItemKinds = set((contentItemKind,)) def collectSubKinds(aKind): subKinds = getattr(aKind, 'subKinds', None) if subKinds is not None: contentItemKinds.update(subKinds) map(collectSubKinds, subKinds) collectSubKinds(contentItemKind)
def _candidateStampedKinds (self): """ return the list of candidate kinds for stamping right now, we consider only ContentItems. """ kindKind = self.findPath('//Schema/Core/Kind') allKinds = kindKind.iterItems() contentItemKind = ContentItem.getKind (self.itsView) contentItemKinds = [ aKind for aKind in allKinds if aKi...
colls = len(getattr(master, 'appearsIn', []))
colls = len([i for i in getattr(master, 'appearsIn', []) if i not in self.ignoreCollections])
def Draw(self, dc, styles, selected, leftSideCutoff=False, rightSideCutOff=False): # @@@ add a general cutoff parameter? event = self.event # recurring items, when deleted or stamped non-Calendar, are sometimes # passed to Draw before wxSynchronize is called, ignore those items if (event.itsItem.isDeleted() or not has...
drawSwatches = (colls > 2 or (colls == 2 and (master not in allCollection or self.primaryCollection.itsUUID == allCollection.itsUUID)) )
drawSwatches = (colls > 1 or (colls == 1 and (self.primaryCollection.itsUUID == allCollection.itsUUID)))
def Draw(self, dc, styles, selected, leftSideCutoff=False, rightSideCutOff=False): # @@@ add a general cutoff parameter? event = self.event # recurring items, when deleted or stamped non-Calendar, are sometimes # passed to Draw before wxSynchronize is called, ignore those items if (event.itsItem.isDeleted() or not has...
master in i and i not in (self.collection, allCollection)]):
master in i and i is not self.collection and i not in self.ignoreCollections]):
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...
if name == 'inCollection': import pdb; pdb.set_trace()
def instantiateItem(self, name, parent, uuid, cls=None, version=0, withInitialValues=False, _noMonitors=False): """ Instantiate an existing item of this kind.
node = menuNode.GetNext()
node = node.GetNext()
def __init__(self): """ modulePath is the path to the module, which must exist. """ Parcel.__init__(self) module = sys.modules[self.__class__.__module__] self.modulename = os.path.basename (module.__file__) self.modulename = os.path.splitext (self.modulename)[0] self.modulePath = os.sep.join(module.__name__.split("."))...
I18nManager.discoverLocaleSet()
i18n.discoverLocaleSet()
def startup(**kwds): global view Globals.options = Utility.initOptions(**kwds) Globals.chandlerDirectory = Utility.locateChandlerDirectory() os.chdir(Globals.chandlerDirectory) I18nManager.discoverLocaleSet() profileDir = Globals.options.profileDir Utility.initLogging(Globals.options) parcelPath = Utility.initParce...
newResource = self._getServerHandle().blockUntil(
serverHandle = self._getServerHandle() if not self.resourceList.has_key(itemName): newResource = serverHandle.blockUntil(
def _putItem(self, item): """ putItem should publish an item and return etag/date, etc. """
if err.status == twisted.web.http.FORBIDDEN or \ err.status == twisted.web.http.CONFLICT:
if err.status in (twisted.web.http.FORBIDDEN, twisted.web.http.CONFLICT, twisted.web.http.PRECONDITION_FAILED):
def _putItem(self, item): """ putItem should publish an item and return etag/date, etc. """
def todayPlus(inc=0):
def mondayPlus(inc=0):
def todayPlus(inc=0): """return a m/d/yy date string equal to this Monday plus inc days""" today = datetime.date.today() monday = today - datetime.timedelta(days=today.weekday()) incDay = monday + datetime.timedelta(days=inc) y, m, d = incDay.timetuple()[:3] return '%s/%s/%s' % (m, d, str(y)[2:].zfill(2))
monday = today - datetime.timedelta(days=today.weekday())
daysUntilMonday = today.weekday() if daysUntilMonday == 6: daysUntilMonday = -1 monday = today - datetime.timedelta(days=daysUntilMonday)
def todayPlus(inc=0): """return a m/d/yy date string equal to this Monday plus inc days""" today = datetime.date.today() monday = today - datetime.timedelta(days=today.weekday()) incDay = monday + datetime.timedelta(days=inc) y, m, d = incDay.timetuple()[:3] return '%s/%s/%s' % (m, d, str(y)[2:].zfill(2))
evtDate = todayPlus() evtSecondDate = todayPlus(1) evtThirdDate = todayPlus(2) evtRecurrenceEnd = todayPlus(365)
evtDate = mondayPlus() evtSecondDate = mondayPlus(1) evtThirdDate = mondayPlus(2) evtRecurrenceEnd = mondayPlus(365)
def todayPlus(inc=0): """return a m/d/yy date string equal to this Monday plus inc days""" today = datetime.date.today() monday = today - datetime.timedelta(days=today.weekday()) incDay = monday + datetime.timedelta(days=inc) y, m, d = incDay.timetuple()[:3] return '%s/%s/%s' % (m, d, str(y)[2:].zfill(2))
newItems = kinds[0].itsView._newItems() if self.recursive or len(kinds) > 1: newItems = list(newItems) for item in self._run(kinds, newItems): yield item
view = kinds[0].itsView matches = set() changedItems = set()
def run(self, kinds):
def _run(self, kinds, newItems):
for item in view._log: if item._status & Item.NDIRTY: changedItems.add(item) for item in self._run(kinds, changedItems): if item not in matches: matches.add(item) yield item def _run(self, kinds, changedItems):
def _run(self, kinds, newItems):
for item in newItems:
for item in changedItems:
def _run(self, kinds, newItems):
yield item
if item not in changedItems: yield item
def _run(self, kinds, newItems):
for item in self._run(subKinds, newItems):
for item in self._run(subKinds, changedItems):
def _run(self, kinds, newItems):
('new_event_from_file_menu_for_performance', ' ('new_event_by_double_clicking_in_the_cal_view_for_performance', ' ('test_new_calendar_for_performance', ' ('importing_3000_event_calendar', ' ('creating_new_event_from_the_file_menu_after_l...
('new_event_from_file_menu_for_performance', ' ('new_event_by_double_clicking_in_the_cal_view_for_performance', ' ('test_new_calendar_for_performance', ' ('importing_3000_event_calendar', ' ('creating_new_event_fr...
def __init__(self): self._app_path = os.getcwd() self._options = { 'tbox_data': '.', # raw .perf files 'html_data': '.', # where to output generated .html 'perf_data': '.', # where to store processed data 'verbose': False, 'debug': False, 'cleanup': False, # remove .perf files when processed 'c...
'new_event_from_file_menu_for_performance': 1, 'new_event_by_double_clicking_in_the_cal_view_for_performance': 1, 'test_new_calendar_for_performance': 1, 'importing_3000_event_calendar': 30, 'creating_new_event_from_the_file_menu_after_l...
'new_event_from_file_menu_for_performance': 1, 'new_event_by_double_clicking_in_the_cal_view_for_performance': 1, 'test_new_calendar_for_performance': 1, 'importing_3000_event_calendar': 30, 'creating_new_event_fro...
def __init__(self): self._app_path = os.getcwd() self._options = { 'tbox_data': '.', # raw .perf files 'html_data': '.', # where to output generated .html 'perf_data': '.', # where to store processed data 'verbose': False, 'debug': False, 'cleanup': False, # remove .perf files when processed 'c...
except FlickrError, fe:
except flickr.FlickrError, fe:
def CreateCollectionFromUsername(repView, cpiaView): username = application.dialogs.Util.promptUser(wx.GetApp().mainFrame, "Username", "Enter a Flickr Username", "") if username: myPhotoCollection = PhotoCollection(view = repView) myPhotoCollection.username = username try: myPhotoCollection.getCollectionFromFlickr(repV...
except FlickrError, fe:
except flickr.FlickrError, fe:
def CreateCollectionFromTag(repView, cpiaView): tagstring = application.dialogs.Util.promptUser(wx.GetApp().mainFrame, "Tag", "Enter a Flickr Tag", "") if tagstring: myPhotoCollection = PhotoCollection(view = repView) myPhotoCollection.tag = Tag.getTag(repView, tagstring) try: myPhotoCollection.getCollectionFromFlickr(...
key = self.resolveAlias(alias) if key is not None: self._e_2_renames(key, alias, child)
if alias is not None: key = self.resolveAlias(alias) if key is not None: self._e_2_renames(key, alias, child)
def merge(version, (collection, child), ref): if collection == self._uuid: # the children collection
key = self.resolveAlias(alias) if key is not None: self._e_names(child, key, alias)
if alias is not None: key = self.resolveAlias(alias) if key is not None: self._e_names(child, key, alias)
def merge(version, (collection, child), ref): if collection == self._uuid: # the children collection
if delta.days < 8:
if delta.days < 14:
def churnData(self): tests = {} today = datetime.datetime.today()
if itemDate < startdate: startdate = itemDate if itemDate > enddate: enddate = itemDate if not tests.has_key(testname): tests[testname] = {} testitem = tests[testname] if not testitem.has_key(buildname): testitem[buildname] = {} builditem = testitem[buildname] if not builditem.has_key(itemDate): builditem[...
if runtime > 0.0: if itemDate < startdate: startdate = itemDate if itemDate > enddate: enddate = itemDate if not tests.has_key(testname): tests[testname] = {} testitem = tests[testname] if not testitem.has_key(buildname): testitem[buildname] = {} builditem = testitem[buildname] if not builditem.has_key(ite...
def churnData(self): tests = {} today = datetime.datetime.today()
tboxfile.write('<tr><th rowspan="2">Test</th><th rowspan="2">0.6<br/>Target</th>')
tboxfile.write('<tr><th rowspan="2">Test<br/>Latest results as of %s</th><th rowspan="2">0.6<br/>Target</th>' % latest)
def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runtime) ] }}}}
block.accel == "Back" and \
getattr(block, 'accel', None) == "Back" and \
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 wxID = event.GetId() block = Block.idToBlock.get (wxID, None) if block is not None:
collections = self.contents.collectionList widget = self.widget except AttributeError, e:
collections = getattr(self.contents, 'collectionList', [self.contents]) if item in collections: self.widget.RefreshCanvasItems() except AttributeError:
def onColorChanged(self, op, item, attribute): try: collections = self.contents.collectionList widget = self.widget except AttributeError, e: # sometimes self.contents hasn't been set yet, # or the widget hasn't been rendered yet return
if item in collections: widget.Refresh()
def onColorChanged(self, op, item, attribute): try: collections = self.contents.collectionList widget = self.widget except AttributeError, e: # sometimes self.contents hasn't been set yet, # or the widget hasn't been rendered yet return
separator = \ ToolbarItem.template('ToolbarItemSeparator', toolbarItemKind='Separator')
def makeMarkupBar(parcel, oldVersion): """ Build the markup bar. """ # Predeclare this - we'll flesh it out below. markupBar = MarkupBarBlock.template('MarkupBar').install(parcel) # The events. buttonPressed = \ BlockEvent.template('ButtonPressed', 'SendToBlockByReference', destinationBlockReference=markupBar).instal...
separator,
def makeMarkupBar(parcel, oldVersion): """ Build the markup bar. """ # Predeclare this - we'll flesh it out below. markupBar = MarkupBarBlock.template('MarkupBar').install(parcel) # The events. buttonPressed = \ BlockEvent.template('ButtonPressed', 'SendToBlockByReference', destinationBlockReference=markupBar).instal...
matches = [item for item in self.getItemParent() if item.isItemOf(self) and item.recognizes(value)]
query = KindQuery() matches = [i for i in query.run([self]) if i.recognizes(value)]
def findTypes(self, value): """Return a list of types recognizing value.
def recognizes(self, value): return type(value) in (self.getImplementationType(), unicode, str)
def recognizes(self, value):
def recognizes(self, value): return type(value) in (self.getImplementationType(), str)
def recognizes(self, value):
self.blockItem.postEventByName("SelectItemBroadcast", {'item':None})
totalItems = len(contents) newRowSelection = min(newRowSelection, totalItems - 1) self.blockItem.postEventByName("SelectItemBroadcast", {'item':contents[newRowSelection]})
def DeleteSelection (self): self.blockItem.contents.beginUpdate() topLeftList = self.GetSelectionBlockTopLeft() bottomRightList = self.GetSelectionBlockBottomRight() """ Clear the selection before removing the elements from the collection otherwise our delegate will get called asking for deleted items """ self.ClearSel...
def OnCloseEventUpdateUI(self, notification): notification.data['Enable'] = (len(self.tabNames) > 1)
def OnCloseEvent (self, notification): "Close the current tab" tabbedContainer = Globals.association[self.itsUUID] selection = tabbedContainer.GetSelection() self.tabNames.remove(self.tabNames[selection]) page = tabbedContainer.GetPage(selection) if selection > (len(self.tabNames) - 1): tabbedContainer.selectedTab = se...
self.p2 = wxWindow(self, -1)
self.p2 = wxSplitterWindow(self, -1) self.buttons = wxWindow(self.p2, -1) self.logtc = wxTextCtrl(self.p2, -1, style = wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL) self.p2.SplitHorizontally(self.buttons, self.logtc, 25)
def __init__(self, parent, id): wxSplitterWindow.__init__(self, parent, id) self.p2 = wxWindow(self, -1) box = wxBoxSizer(wxVERTICAL) b = wxButton(self.p2, -1, "Submit Changes") box.Add(b, 0, wxALIGN_CENTER|wxALL, 10) self.p2.SetAutoLayout(True) self.p2.SetSizer(box) EVT_BUTTON(self, b.GetId(), self.UpdateRepository) ...
b = wxButton(self.p2, -1, "Submit Changes")
b = wxButton(self.buttons, -1, "Submit Changes")
def __init__(self, parent, id): wxSplitterWindow.__init__(self, parent, id) self.p2 = wxWindow(self, -1) box = wxBoxSizer(wxVERTICAL) b = wxButton(self.p2, -1, "Submit Changes") box.Add(b, 0, wxALIGN_CENTER|wxALL, 10) self.p2.SetAutoLayout(True) self.p2.SetSizer(box) EVT_BUTTON(self, b.GetId(), self.UpdateRepository) ...
self.SplitVertically(self.p1, self.p2, 590) self.p1.Layout() def UpdateRepository(self, evt):
self.SplitVertically(self.p1, self.p2, 520) self.p2.SetMinimumPaneSize(10) self.SetMinimumPaneSize(20) self.log=logging.getLogger('parcels.OSAF.repositoryviewer') def DoLogString(self, message): """ Output events as feedback for the user, also use the logging module. """ import time self.log.debug(message) message = t...
def __init__(self, parent, id): wxSplitterWindow.__init__(self, parent, id) self.p2 = wxWindow(self, -1) box = wxBoxSizer(wxVERTICAL) b = wxButton(self.p2, -1, "Submit Changes") box.Add(b, 0, wxALIGN_CENTER|wxALL, 10) self.p2.SetAutoLayout(True) self.p2.SetSizer(box) EVT_BUTTON(self, b.GetId(), self.UpdateRepository) ...
self.p1.maxWidth = 600 self.p1.maxHeight = 1000
def DisplayItem(self, item=None): """ Layout the edit panel for the given item. First, destroy the existing widget panel, then create a new panel, populating it with widgets for each attribute of the item. """ self.item=item self.widgets={} p1 = wxScrolledWindow(self, -1)
self.p1.SetSizer(sizer) self.p1.SetAutoLayout(true) self.p1.Layout()
border = wxBoxSizer(wxVERTICAL) border.Add(sizer, 0, wxALL, 10) self.p1.SetSizer(border) self.p1.SetAutoLayout(True) self.p1.FitInside()
def DisplayItem(self, item=None): """ Layout the edit panel for the given item. First, destroy the existing widget panel, then create a new panel, populating it with widgets for each attribute of the item. """ self.item=item self.widgets={} p1 = wxScrolledWindow(self, -1)
if event: assert position == event.GetSashPosition()
def OnSashPositionChange(self, event=None): wxAllDay = self.GetAllDayWidget() position = wxAllDay.GetParent().GetSashPosition() sashsize = wxAllDay.GetParent().GetSashSize() if event: assert position == event.GetSashPosition()
if query == '': return False
def parseCommand(self, query): """ Parses the text in the quick item entry widget in the toolbar. Creates the items depending on the command and adds it to the appropriate collection. Also parses the date/time info and sets the start/end time or the reminder time. """ query = query.strip() msgFlag = False eventFlag =...
if (query != None) and (self.parseCommand(query) is False) and (query != ''):
if (query != None) and (self.parseCommand(query) is False) and (query.strip() != ''):
def onNewItem (self): """ Create a new collection with the results of the search to be added to the sidebar """ query = self.arguments['sender'].widget.GetValue() self.arguments['sender'].widget.SetValue('') # Check if the query is a quick item entry or not if (query != None) and (self.parseCommand(query) is False) an...
mousedown="EventTicklerMousedown"),
mousedown="EventTicklerMousedown", mousedownselected="EventTicklerMousedownSelected"),
def makeStates(self): states = [ BitmapInfo(stateName="SumEvent.Unstamped", normal=attributeEditors.IconAttributeEditor.noImage, selected=attributeEditors.IconAttributeEditor.noImage, rollover="EventTicklerRollover", rolloverselected="EventTicklerRolloverSelected", mousedown="EventTicklerMousedown"), BitmapInfo(stateNa...
normal="SumEventStamped", selected="SumEventStamped-Reversed",
normal="EventStamped", selected="EventStampedSelected",
def makeStates(self): states = [ BitmapInfo(stateName="SumEvent.Unstamped", normal=attributeEditors.IconAttributeEditor.noImage, selected=attributeEditors.IconAttributeEditor.noImage, rollover="EventTicklerRollover", rolloverselected="EventTicklerRolloverSelected", mousedown="EventTicklerMousedown"), BitmapInfo(stateNa...
for state in "Normal", "Selected", "Rollover", "RolloverSelected", "Mousedown":
for state in ("Normal", "Selected", "Rollover", "RolloverSelected", "Mousedown", "MousedownSelected"):
def addState(name, **kwds): args = {} for state in "Normal", "Selected", "Rollover", "RolloverSelected", "Mousedown": lcState = state.lower() if not kwds.has_key(lcState): # If a given state isn't specified, build the name automatically args[lcState] = "Mail%s%s" % (name, state != "Normal" and state or '') elif kwds[lc...
'mousedown': '%sMousedown' % namePrefix
'mousedown': '%sMousedown' % namePrefix, 'mousedownselected': '%sMousedownSelected' % namePrefix
def addState(name, **kwds): args = {} for state in "Normal", "Selected", "Rollover", "RolloverSelected", "Mousedown": lcState = state.lower() if not kwds.has_key(lcState): # If a given state isn't specified, build the name automatically args[lcState] = "Mail%s%s" % (name, state != "Normal" and state or '') elif kwds[lc...
number = float (value) except ValueError:
if d2["installdir"]: try: number = float (value) except ValueError: pass else: if number > self.version: self.version = number except KeyError:
def __init__ (self): # Find the newest version of Visual Studio that's installed self.version = 0 for base in HKEYS: d = read_keys(base, r"Software\Microsoft\VisualStudio") if d: for value in d: try: number = float (value) except ValueError: pass else: if number > self.version: self.version = number
else: if number > self.version: self.version = number
def __init__ (self): # Find the newest version of Visual Studio that's installed self.version = 0 for base in HKEYS: d = read_keys(base, r"Software\Microsoft\VisualStudio") if d: for value in d: try: number = float (value) except ValueError: pass else: if number > self.version: self.version = number
menuTitle = u'Add sharing sctivity log to Sidebar'
menuTitle = u'Add sharing activity log to Sidebar'
def onAddScriptsToSidebarEventUpdateUI(self, event): sidebar = Block.findBlockByName ("Sidebar").contents log = schema.ns('osaf.sharing', self.itsView).activityLog if log in sidebar: menuTitle = u'Show Sharing Activity' else: menuTitle = u'Add sharing sctivity log to Sidebar' event.arguments ['Text'] = menuTitle event....
image = wx.Image(self.icon, wx.BITMAP_TYPE_PNG)
image = wx.Image(os.path.join(Globals.chandlerDirectory, self.icon), wx.BITMAP_TYPE_PNG)
def instantiateWidget(self, parent, parentWindow): try: id = Block.getwxID(self) except AttributeError: id = 0
htmlWindow.LoadPage(self.url)
htmlWindow.LoadPage(os.path.join(Globals.chandlerDirectory, self.url))
def instantiateWidget (self, parent, parentWindow): htmlWindow = wxHTML(parentWindow, Block.getwxID(self), wx.DefaultPosition, (self.minimumSize.width, self.minimumSize.height)) if self.url: htmlWindow.LoadPage(self.url)
bitmap = wx.Image (self.bitmap, wx.BITMAP_TYPE_PNG).ConvertToBitmap()
bitmap = wx.Image (os.path.join(Globals.chandlerDirectory, self.bitmap), wx.BITMAP_TYPE_PNG).ConvertToBitmap()
def instantiateWidget (self, parent, parentWindow): # @@@ Must use self.toolbarLocation rather than wxMainFrame.GetToolBar() tool = None wxToolbar = Globals.wxApplication.mainFrame.GetToolBar() toolbar = Globals.repository.find(wxToolbar.counterpartUUID) id = Block.getwxID(self) if self.toolbarItemKind == 'Button': bit...
l1 = wx.StaticText( self, -1, "wx.ColumnHeader (1001)", (20, 20), (200, 20) )
cntlID = 1001 prompt = "wx.ColumnHeader (%d)" %(cntlID) l1 = wx.StaticText( self, -1, prompt, (20, 20), (200, 20) )
def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log
ch1 = wx.colheader.ColumnHeader( self, 1001, (20, 40), (350, colHeight), 0 ) ch1.AppendItem("Sun", wx.colheader.COLUMNHEADER_JUST_Center, 50, 1, 0, 1) ch1.AppendItem("Mon", wx.colheader.COLUMNHEADER_JUST_Center, 50, 0, 0, 1) ch1.AppendItem("Tue", wx.colheader.COLUMNHEADER_JUST_Center, 50, 0, 0, 1) ch1.AppendItem("Wed",...
ch1 = wx.colheader.ColumnHeader( self, cntlID, (20, 40), (350, colHeight), 0 ) dow = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ] for v in dow: ch1.AppendItem( v, wx.colheader.COLUMNHEADER_JUST_Center, 50, 0, 0, 1 ) ch1.SetSelectedItemIndex( 0 )
def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log
l2 = wx.StaticText( self, -1, "wx.ColumnHeader (1002)", (80, 70), (200, 20) )
cntlID = 1002 prompt = "wx.ColumnHeader (%d)" %(cntlID) l2 = wx.StaticText( self, -1, prompt, (80, 70), (200, 20) )
def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log
ch2 = wx.colheader.ColumnHeader( self, 1002, (80, 90), (270, colHeight), 0 ) ch2.AppendItem( "Juan", wx.colheader.COLUMNHEADER_JUST_Left, 90, 1, 1, 1 ) ch2.AppendItem( "Valdz", wx.colheader.COLUMNHEADER_JUST_Center, 90, 0, 1, 1 ) ch2.AppendItem( "coffee guy", wx.colheader.COLUMNHEADER_JUST_Right, 90, 0, 1, 1 )
ch2 = wx.colheader.ColumnHeader( self, cntlID, (80, 90), (270, colHeight), 0 ) coffeeNames = [ "Juan", "Valdz", "coffee guy" ] for i, v in enumerate( coffeeNames ): ch2.AppendItem( v, wx.colheader.COLUMNHEADER_JUST_Left + i, 90, 0, 1, 1 ) ch2.SetSelectedItemIndex( 0 )
def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log
ch.SetImageRef( itemCount, testBmp )
ch.SetBitmapRef( itemCount, testBmp )
def OnAddBitmapItemButton(self, event): ch = self.ch2 itemCount = ch.GetItemCount() ch.AppendItem( "", wx.colheader.COLUMNHEADER_JUST_Center, 40, 0, 0, 1 ) testBmp = images.getTest2Bitmap() ch.SetImageRef( itemCount, testBmp ) ch.SetSelectedItemIndex( itemCount ) ch.ResizeToFit() self.l0.SetLabel( "added bitmap item (%...
assert (len (children) <= 1)
def synchronizeView (self): wxMainFrame = app.association[id(app.model.mainFrame)] """ If it isn't in the association we need to construct it and put it in the association. """ if not app.association.has_key(id(self)): module = sys.modules[self.__class__.__module__] modulename = os.path.basename (module.__file__) modul...
del app.association[id(window.model)]
if window.__dict__.has_key("model"): del app.association[id(window.model)]
def synchronizeView (self): wxMainFrame = app.association[id(app.model.mainFrame)] """ If it isn't in the association we need to construct it and put it in the association. """ if not app.association.has_key(id(self)): module = sys.modules[self.__class__.__module__] modulename = os.path.basename (module.__file__) modul...
"""
def FindNameReturnIndex (menu, name): """ Searches a menu for a name (possibly translated) and returns an index to the item. """ index = 0 translatedName = _(name) for item in menu.GetMenuItems(): if item.GetLabel() == translatedName: return index index += 1 return wxNOT_FOUND
if self._resultSet is not []:
if self._resultSet:
def onItemLoad(self, view): self._callbacks = {} self.monitorCallbacks = {} try: if self._resultSet is not []: self._compile() self._queryStringIsStale = False self.stale = False else: self._queryStringIsStale = True except AttributeError: self._queryStringIsStale = True self.stale = True
scriptToExecute = "ReloadParcels, Quit"
scriptToExecute = "Quit"
def testLaunchChandler(self): """ Test Launching Chandler """
return str(item.body) converts from text to string
return str(item.body) converts from text lob to string
def ItemBodyString (self): """ return str(item.body) converts from text to string """ try: noteBody = self.body except AttributeError: noteBody = '' else: if isinstance(noteBody, Lob): # Read the unicode stream from the XML noteBody = noteBody.getInputStream().read() return noteBody
noteBody = noteBody.getInputStream().read()
noteBody = noteBody.getPlainTextReader().read()
def ItemBodyString (self): """ return str(item.body) converts from text to string """ try: noteBody = self.body except AttributeError: noteBody = '' else: if isinstance(noteBody, Lob): # Read the unicode stream from the XML noteBody = noteBody.getInputStream().read() return noteBody
hueName = hueMap.get(int(hue*360))
hueDegrees = int(hue*360) hueName = hueMap.get(hueDegrees) if hueName is None: hueName = hueMap.get(hueDegrees + 1)
def colorValWithDefault(hue, name): hueName = hueMap.get(int(hue*360)) if hueName is not None: val = confstyles.cfg.get('calendarcanvas', hueName + name) if val is not None: return float(val) return confstyles.cfg.getfloat('calendarcanvas', name)
def __init__(self, name=None, parent=None, kind=None,
def __init__(self, itsName=None, itsParent=None, itsKind=None,
def __init__(self, name=None, parent=None, kind=None, _uuid=None, _noMonitors=False, **values): """ Construct an Item.
@param name: The name of the item. It must be unique among the names this item's siblings. C{name} is optional, except for roots and is
@param itsName: The name of the item. It must be unique among the names this item's siblings. C{itsName} is optional, except for roots and is
def __init__(self, name=None, parent=None, kind=None, _uuid=None, _noMonitors=False, **values): """ Construct an Item.
@type name: a string or C{None} to create an anonymous item. @param parent: The parent of this item. All items require a parent
@type itsName: a string or C{None} to create an anonymous item. @param itsParent: The parent of this item. All items require a parent
def __init__(self, name=None, parent=None, kind=None, _uuid=None, _noMonitors=False, **values): """ Construct an Item.
@type parent: an item or the item's repository view. @param kind: The kind for this item. This kind has definitions for
@type itsParent: an item or the item's repository view. @param itsKind: The kind for this item. This kind has definitions for
def __init__(self, name=None, parent=None, kind=None, _uuid=None, _noMonitors=False, **values): """ Construct an Item.
@type kind: an item
@type itsKind: an item
def __init__(self, name=None, parent=None, kind=None, _uuid=None, _noMonitors=False, **values): """ Construct an Item.
self._name = name or None self._kind = kind
self._name = itsName or None self._kind = itsKind
def __init__(self, name=None, parent=None, kind=None, _uuid=None, _noMonitors=False, **values): """ Construct an Item.
if kind is not None: kind._setupClass(cls) if parent is None:
if itsKind is not None: itsKind._setupClass(cls) if itsParent is None:
def __init__(self, name=None, parent=None, kind=None, _uuid=None, _noMonitors=False, **values): """ Construct an Item.
if name is None and not parent._isItem():
if itsName is None and not itsParent._isItem():
def __init__(self, name=None, parent=None, kind=None, _uuid=None, _noMonitors=False, **values): """ Construct an Item.
self._setParent(parent) if kind is not None: kind.getInitialValues(self, self._values, self._references)
self._setParent(itsParent) if itsKind is not None: itsKind.getInitialValues(self, self._values, self._references)
def __init__(self, name=None, parent=None, kind=None, _uuid=None, _noMonitors=False, **values): """ Construct an Item.
if not (_noMonitors or (kind is None) or (Item._monitorsClass is None)):
if not (_noMonitors or (itsKind is None) or (Item._monitorsClass is None)):
def __init__(self, name=None, parent=None, kind=None, _uuid=None, _noMonitors=False, **values): """ Construct an Item.
contentType=contentType)
contentType=contentType, extraHeaders=extraHeaders)
def _putItem(self, item): """ putItem should publish an item and return etag/date, etc. """
if old is not None and old._isRefs(): wasRefs = True old._removeRefs()
if old is not None: if isItem and isuuid(old): if old == value.itsUUID: return value elif old._isRefs(): wasRefs = True old._removeRefs()
def setAttributeValue(self, name, value=None, _attrDict=None, otherName=None, setDirty=True, setAliases=False): """ Set a value on a Chandler attribute.
if len (item) == 0:
sidebarTPB = Block.Block.findBlockByName ("SidebarTPB") (filteredCollection, rerender) = sidebarTPB.trunkDelegate._mapItemToCacheKeyItem(item) if len (filteredCollection) == 0:
def Draw (self, grid, attr, dc, rect, row, col, isSelected): DrawingUtilities.SetTextColorsAndFont (grid, attr, dc, isSelected)
print "+++ %s +++" % (paramSet,)
def run_tests(tests, debug=testDebug, mask=testMask, logName=logFileName): """Method to execute cats tests, must be in Functional directory.""" logger = TestOutput(stdout=True, debug=debug, mask=mask, logName=logName) logger.startSuite(name='ChandlerFunctionalTestSuite') # We'll normally run individual tests with an ...
halfBakedEvents = [] for stat in stats: share = metaView.findUUID(stat['share']) for uuid in stat['added']:
if (isinstance(shares[0].conduit, WebDAVConduit) and isinstance(shares[1].conduit, CalDAVConduit)): share0 = metaView.findUUID(shares[0].itsUUID) share1 = metaView.findUUID(shares[1].itsUUID) for uuid in stats[0]['added']:
def mergeFunction(code, item, attribute, value): # 'value' is the one from the *this* view # getattr(item, attribute) is the value from a different view
if pim.has_stamp(item, pim.EventStamp): event = pim.EventStamp(item) if not hasattr(event, 'startTime'):
if uuid not in stats[1]['modified']: item = contentView.findUUID(uuid) if pim.has_stamp(item, pim.EventStamp):
def mergeFunction(code, item, attribute, value): # 'value' is the one from the *this* view # getattr(item, attribute) is the value from a different view
itemPath = share.conduit._getItemPath(item) share.conduit._addToManifest(itemPath, None)
itemPath = share0.conduit._getItemPath(item) share0.conduit._addToManifest(itemPath, None) logger.info("Incomplete event: '%s' %s" % (item.displayName, itemPath))
def mergeFunction(code, item, attribute, value): # 'value' is the one from the *this* view # getattr(item, attribute) is the value from a different view
SendMail(fromAddr, mailtoAddr, startTime, buildName, "status",
SendMail(fromAddr, mailtoAddr, startTime, buildName, status,
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...