rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
def ReadOnly (self, (item, attribute)): return False
def ReadOnly (self, (item, attribute)): return False
dc.DrawRectangle(0, y, self.GetClientSize().x, self.heightRow)
dc.DrawRectangle(0, y-1, self.GetClientSize().x, self.heightRow+2)
def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK);
busyColour = wx.Colour(0, 0, 0)
busyColour = wx.Colour(127, 191, 255)
def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK);
height = (self.heightRow - 8) * busyPercentage
if '__WXMAC__' in wx.PlatformInfo: YAdjust = 7 else: YAdjust = 6 height = (self.heightRow - YAdjust) * busyPercentage
def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK);
YAdjust = -2
def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK);
YAdjust = 0 dc.DrawRectangle(x-3, y + self.heightRow - height - 4 + YAdjust, 2, height)
dc.DrawRectangle(x-3, y + self.heightRow - height - 2, 2, height)
def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK);
dc.DrawText(dayStr, x, y + 1)
if '__WXMAC__' in wx.PlatformInfo: YAdjust = 2 else: YAdjust = 1 dc.DrawText(dayStr, x, y + YAdjust)
def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK);
existingValue = control.GetClientData(control.GetSelection())
existingSelectionIndex = control.GetSelection() existingValue = (existingSelectionIndex != wx.NOT_FOUND) \ and control.GetClientData(existingSelectionIndex) \ or None
def SetControlValue (self, control, value): """ Select the choice that matches this value ('none', 'before', 'after', or 'custom') """ # Populate the menu if necessary existingValue = control.GetClientData(control.GetSelection()) hasStart = hasattr(self.item, 'startTime') if existingValue != value or control.GetCount()...
self._head = self._createNode(0) self._tail = self._createNode(0)
self._head = self._createNode(1) self._tail = self._createNode(1)
def __init(self):
def sendInvitation(repository, url, collectionName, sendToList):
def sendInvitation(repository, url, itemCollection, sendToList):
def sendInvitation(repository, url, collectionName, sendToList): """Sends a sharing invitation via SMTP to a list of recipients @param repository: The repository we're using @type repository: C{Repository} @param url: The url to share @type url: C{str} @param collectionName: The name of the collection @type collecti...
@param collectionName: The name of the collection @type collectionName: C{str}
@param itemCollection: An ItemCollection Instance @type itemCollection: C{itemCollection}
def sendInvitation(repository, url, collectionName, sendToList): """Sends a sharing invitation via SMTP to a list of recipients @param repository: The repository we're using @type repository: C{Repository} @param url: The url to share @type url: C{str} @param collectionName: The name of the collection @type collecti...
@param sendToList: List of email addresses to invite
@param sendToList: List of EmailAddress Items
def sendInvitation(repository, url, collectionName, sendToList): """Sends a sharing invitation via SMTP to a list of recipients @param repository: The repository we're using @type repository: C{Repository} @param url: The url to share @type url: C{str} @param collectionName: The name of the collection @type collecti...
SMTPInvitationSender(repository, url, collectionName, sendToList).sendInvitation()
SMTPInvitationSender(repository, url, itemCollection, sendToList).sendInvitation()
def sendInvitation(repository, url, collectionName, sendToList): """Sends a sharing invitation via SMTP to a list of recipients @param repository: The repository we're using @type repository: C{Repository} @param url: The url to share @type url: C{str} @param collectionName: The name of the collection @type collecti...
class SMTPInvitationSender(TwistedRepositoryViewManager.RepositoryViewManager): """Sends an invitation via SMTP. Use the osaf.mail.sharing.sendInvitation method do not call this class directly"""
class SMTPInvitationSender: """Sends an invitation via SMTP."""
def sendInvitation(repository, url, collectionName, sendToList): """Sends a sharing invitation via SMTP to a list of recipients @param repository: The repository we're using @type repository: C{Repository} @param url: The url to share @type url: C{str} @param collectionName: The name of the collection @type collecti...
def __init__(self, repository, url, collectionName, sendToList, account=None):
def __init__(self, repository, url, itemCollection, sendToList, account=None):
def __init__(self, repository, url, collectionName, sendToList, account=None):
if isinstance(collectionName, unicode): collectionName = collectionName.encode(constants.DEFAULT_CHARSET)
def __init__(self, repository, url, collectionName, sendToList, account=None):
assert isinstance(collectionName, str), "collectionName must be a String or Unicode"
self.fromAddress = None self.url = url self.sendToList = sendToList self.repository = repository
def __init__(self, repository, url, collectionName, sendToList, account=None):
viewName = "SMTPInvitationSender_%s" % str(UUID.UUID())
if isinstance(itemCollection.displayName, unicode): self.collectionName = itemCollection.displayName.encode(constants.DEFAULT_CHARSET)
def __init__(self, repository, url, collectionName, sendToList, account=None):
super(SMTPInvitationSender, self).__init__(repository, viewName)
else: self.collectionName = itemCollection.displayName
def __init__(self, repository, url, collectionName, sendToList, account=None):
self.account = None self.from_addr = None self.url = url self.collectionName = collectionName self.sendToList = sendToList self.accountUUID = None
def __init__(self, repository, url, collectionName, sendToList, account=None):
if account is not None: self.accountUUID = account.itsUUID
try: self.collectionBody = utils.textToStr(itemCollection.body) except ItemError.NoValueForAttributeError: self.collectionBody = u"" if account is None: accountUUID = None else: accountUUID = account.itsUUID self.account, self.fromAddress = Mail.MailParcel.getSMTPAccount(self.repository.view, \ accountUUID)
def __init__(self, repository, url, collectionName, sendToList, account=None):
if __debug__: self.printCurrentView("sendInvitation")
smtp.SMTPSender(self.repository, self.account, self.__createMessage()).sendMail()
def sendInvitation(self): if __debug__: self.printCurrentView("sendInvitation")
reactor.callFromThread(self.execInView, self.__sendInvitation)
def __createMessage(self): self.repository.view.refresh()
def sendInvitation(self): if __debug__: self.printCurrentView("sendInvitation")
def __sendInvitation(self): if __debug__: self.printCurrentView("__sendInvitation") self.__getData() messageText = self.__createMessageText() d = defer.Deferred().addCallbacks(self.__invitationSuccessCheck, self.__invitationFailure) smtp.SMTPSender.sendMailMessage(self.from_addr, self.sendToList, messageText, \ d,...
def __sendInvitation(self):
messageObject = utils.getChandlerTransportMessage()
m = Mail.MailMessage(view=self.repository.view)
def __createMessageText(self): #XXX: Tnis needs to be base 64 encoded sendStr = "%s%s%s" % (self.url, constants.SHARING_DIVIDER, self.collectionName)
messageObject[getChandlerSharingHeader()] = sendStr
def __createMessageText(self): #XXX: Tnis needs to be base 64 encoded sendStr = "%s%s%s" % (self.url, constants.SHARING_DIVIDER, self.collectionName)
message.populateStaticHeaders(messageObject)
m.subject = self.__createSubject() m.fromAddress = self.fromAddress
def __createMessageText(self): #XXX: Tnis needs to be base 64 encoded sendStr = "%s%s%s" % (self.url, constants.SHARING_DIVIDER, self.collectionName)
return messageObject.as_string()
m.chandlerHeaders[message.createChandlerHeader(constants.SHARING_HEADER)] = sendStr
def __createMessageText(self): #XXX: Tnis needs to be base 64 encoded sendStr = "%s%s%s" % (self.url, constants.SHARING_DIVIDER, self.collectionName)
def __getData(self): """If accountUUID is None will return the first SMTPAccount found""" self.account, replyToAddress = Mail.MailParcel.getSMTPAccount(self.getCurrentView(), \ self.accountUUID) self.from_addr = replyToAddress.emailAddress
for address in self.sendToList: assert isinstance(address, Mail.EmailAddress), \ "sendToList can only contain EmailAddres Object" m.toAddress.append(address)
def __getData(self): """If accountUUID is None will return the first SMTPAccount found""" self.account, replyToAddress = Mail.MailParcel.getSMTPAccount(self.getCurrentView(), \ self.accountUUID) self.from_addr = replyToAddress.emailAddress
'developer' : ["Developers' distribution", "If you're a developer and want to run Chandler in debugging mode, this distribution contains debug versions of the binaries. Assertions are active, the __debug__ global is set to True, and memory leaks are listed upon exit. You can also use this distribution to develop your...
'developer' : ["Debug distribution", "If you're a developer and want to run Chandler in debugging mode, this distribution contains debug versions of the binaries. It runs a lot slower than the end-users release. Assertions are active, the __debug__ global is set to True, and memory leaks are listed upon exit. You may a...
def main(): parser = OptionParser(usage="%prog [options] type release-num target-dir", version="%prog 2.0") (options, args) = parser.parse_args() if len(args) != 3: parser.print_help() parser.error("You must provide [M | R | C], relase number and a directory name: M 0.5.03 0_5_03") rType = args[0] release = args[1] t...
wxGetApp().UIRepositoryView,
Globals.wxApplication.UIRepositoryView,
def blockUntil(self, callable, *args, **keywds): # Since there can be several errors in a connection, we must keep # trying until we either get a successful connection or the user # decides to cancel/disconnect, or there is an error we don't know # how to deal with. while True: try: return zanshin.util.blockUntil(calla...
if not hasattr(item, attrName) or \ (value != item.getAttributeValue(attrName)): logger.debug( "for %s setting %s to %s" % \ (item.getItemDisplayName().encode('utf8'), attrName, value)) item.setAttributeValue(attrName, value) else: logger.debug( "for %s skipping %s of %s" % \ (item.getItemDisplayName().encode('utf8'), ...
logger.debug( "for %s setting %s to %s" % \ (item.getItemDisplayName().encode('utf8'), attrName, value)) item.setAttributeValue(attrName, value)
def __importNode(self, node, item=None):
"%s\nhas invited you to subscribe to '%s'\n" \
"%s\nhas invited you to subscribe to\n'%s'\n\n" \
def _sharingUpdateCallback(self, url, collectionName, fromAddress): # When we receive the event, display a dialog print "Received invite from %s; collection '%s' at %s" % (fromAddress, collectionName, url) collection = collectionFromSharedUrl(url) if collection is not None: # @@@ For 0.4 we will silently eat re-invites...
self.monthButton = CollectionCanvas.CanvasTextButton(self, "",
self.monthButton = CollectionCanvas.CanvasTextButton(self, today.Format("%B %Y"),
def OnInit(self): # Setup the navigation buttons today = DateTime.today() self.prevButton = CollectionCanvas.CanvasBitmapButton(self, "application/images/backarrow.png") self.nextButton = CollectionCanvas.CanvasBitmapButton(self, "application/images/forwardarrow.png") self.todayButton = CollectionCanvas.CanvasTextButt...
self.monthButton = CollectionCanvas.CanvasTextButton(self, "",
self.monthButton = CollectionCanvas.CanvasTextButton(self, today.Format("%B %Y"),
def OnInit(self):
for item in activeView.childrenBlocks: for canvas in item.childrenBlocks: if isinstance(canvas, CollectionCanvas.CollectionBlock): printObject = Printing.Printing(wx.GetApp().mainFrame, canvas.widget) if isPreview: printObject.OnPrintPreview() else: printObject.OnPrint() return
for canvas in activeView.childrenBlocks: if isinstance(canvas, CollectionCanvas.CollectionBlock): printObject = Printing.Printing(wx.GetApp().mainFrame, canvas.widget) if isPreview: printObject.OnPrintPreview() else: printObject.OnPrint() return
def printEvent(self, isPreview): try: activeView = Globals.views [1] except IndexError: pass else: for item in activeView.childrenBlocks: for canvas in item.childrenBlocks: if isinstance(canvas, CollectionCanvas.CollectionBlock): printObject = Printing.Printing(wx.GetApp().mainFrame, canvas.widget) if isPreview: printO...
blockItem = self.buttonOwner return (blockItem.filterClass not in blockItem.disallowOverlaysForFilterClasses and item in blockItem.checkedItems)
return (item in self.buttonOwner.checkedItems)
def getChecked (self, item): blockItem = self.buttonOwner return (blockItem.filterClass not in blockItem.disallowOverlaysForFilterClasses and item in blockItem.checkedItems)
Util.ok(self, _(u'Warning'), _(u'This collection is read-only. You add items to read-only collections'))
Util.ok(self, _(u'Warning'), _(u'This collection is read-only. You cannot add items to read-only collections'))
def WarnReadOnlyAdd(self, collection): Util.ok(self, _(u'Warning'), _(u'This collection is read-only. You add items to read-only collections'))
Tag, otherName="itemsWithTag", displayName=u"Tag", initialValue=None
Tag, displayName=u"Tag", initialValue=None
def getPhotoByFlickrTitle(view, title): photos = KindCollection('FlickrPhotoQuery', FlickrPhotoMixin) filteredPhotos = FilteredCollection('FilteredFlicrkPhotoQuery', photos) for x in filteredPhotos: return x
source_modules += find_packages('parcels', exclude=['*.tests'])
def generateDocs(options, outputDir): if options.verbose: verbosity = 4 else: verbosity = 1 chandlerBin = os.getenv('CHANDLERBIN') targetDir = os.path.join(outputDir, 'api') if not os.path.isdir(targetDir): _mkdirs(targetDir) # This is the options dictionary # It is used by most of the epydoc routines and # the con...
print 'find_packages: ', source_modules
parcels = find_packages('parcels', exclude=['*.tests']) map(schema.importString, parcels) for name,module in sys.modules.items(): if module is not None and name.rsplit('.', 1)[0] in parcels: source_modules += [name]
def generateDocs(options, outputDir): if options.verbose: verbosity = 4 else: verbosity = 1 chandlerBin = os.getenv('CHANDLERBIN') targetDir = os.path.join(outputDir, 'api') if not os.path.isdir(targetDir): _mkdirs(targetDir) # This is the options dictionary # It is used by most of the epydoc routines and # the con...
msg = e.getJavaException().getMessage() if msg is not None: if msg.find("DB_LOCK_DEADLOCK") >= 0: raise DBLockDeadlockError, msg elif msg.find("IllegalArgumentException") >= 0: raise DBInvalidArgError, msg
je = e.getJavaException() msg = je.getMessage() if msg is not None and msg.find("DB_LOCK_DEADLOCK") >= 0: raise DBLockDeadlockError, msg if je.getClass().getName() == 'java.lang.IllegalArgumentException': raise DBInvalidArgError, msg
def commitIndexWriter(self, writer):
self.detail = wxHtmlWindow(self.splitter, -1,
self.detail = wxRepositoryViewerDetail(self.splitter, -1,
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
htmlString = "<html><body><h5>Item</h5><ul>" htmlString = htmlString + "<li><b>Path:</b> %s" % item.getItemPath() htmlString = htmlString + "<li><b>UUID:</b> %s" % item.getUUID() htmlString = htmlString + "</ul><h5>Attributes</h5><ul>" for attribute in item.iterAttributes(): key = attribute[0] if isinstance(attribute[...
self.detail.DisplayItem(item)
def DisplayItem(self, item): """Display the given Item's details in an HTML window. """ htmlString = "<html><body><h5>Item</h5><ul>" htmlString = htmlString + "<li><b>Path:</b> %s" % item.getItemPath() htmlString = htmlString + "<li><b>UUID:</b> %s" % item.getUUID() htmlString = htmlString + "</ul><h5>Attributes</h5><u...
displayName = item.getItemDisplayName()
displayName = str(item.getItemDisplayName()) if displayName == str(item.getItemName()): displayName = "(unnamed)"
def LoadItem(self, item, node): """Populates the tree's table with details of this particular item. """
if not itemRect.IsEmpty():
if not itemRect.IsEmpty() and itemRect.width > 2:
def Draw(self, dc, styles, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self.item # recurring items, when deleted or stamped non-Calendar, are sometimes # passed to Draw before wxSynchronize is called, ignore those items CalendarEventKind = Calendar.CalendarEventMixin.getKind(item.itsV...
def DeleteSelection (self, DeleteItemCallback):
def DeleteSelection (self, DeleteItemCallback=None): def DefaultCallback(item, collection=self.blockItem.contents): collection.remove(item) if DeleteItemCallback is None: DeleteItemCallback = DefaultCallback
def DeleteSelection (self, DeleteItemCallback): 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.ClearSelection() # build ...
dashIndex = completionString.find(' - ')
dashIndex = completionString.find(' : ')
def finishCompletion(self, completionString): if completionString is not None: dashIndex = completionString.find(' - ') if dashIndex != -1: # could be 'tomorrow - 08/02/2006' completionString = completionString[dashIndex + 3:] return super(DateAttributeEditor, self).finishCompletion(completionString)
pathList = [] if module_name != "Chandler": pathList.append(os.path.join(buildenv['root'], modulename)) pathList.append(os.path.join(buildenv['root'], "Chandler", "parcels")) paths = os.pathsep.join(pathList) buildenv['pythonpath'] = paths print paths
def test(buildenv, module_name): """ This needs to be fleshed out a bit more, but it will invoke all tests under the folder "module_name" that live in any folder called "tests" and that has a file named "Test*.py" """ pathList = [] if module_name != "Chandler": pathList.append(os.path.join(buildenv['root'], modulename)...
if buildenv.has_key('pythonpath') and buildenv['pythonpath']: pythonpaths.append(buildenv['pythonpath'])
def setupEnvironment(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'release' + os.sep + 'bin' + \ os.pathsep + buildenv[...
os.putenv('PYTHONPATH', os.pathsep.join(pythonpaths)) os.putenv('CHANDLERDIR', buildenv['root']+os.sep+"Chandler") os.putenv('CHANDLERHOME', buildenv['root'])
pythonpaths.append(os.path.join(buildenv['root'], "Chandler", "parcels")) pythonpath = os.pathsep.join(pythonpaths)
def setupEnvironment(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'release' + os.sep + 'bin' + \ os.pathsep + buildenv[...
if (sys.platform == 'cygwin' and '.'.join(map(str, sys.version_info[:3])) < '2.3.0'):
if (sys.platform == 'cygwin'):
def setupEnvironment(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'release' + os.sep + 'bin' + \ os.pathsep + buildenv[...
cygpath = os.popen("/bin/cygpath -wp \"" + path + "\"", "r") path = cygpath.readline() path = path[:-1]
if('.'.join(map(str, sys.version_info[:3])) < '2.3.0'): cygpath = os.popen("/bin/cygpath -wp \"" + path + "\"", "r") path = cygpath.readline() path = path[:-1] cygpath.close() cygpath = os.popen("/bin/cygpath -wp \"" + pythonpath + "\"", "r") pythonpath = cygpath.readline() pythonpath = pythonpath[:-1]
def setupEnvironment(buildenv): if buildenv['version'] == 'debug': path = buildenv['root'] + os.sep + 'debug' + os.sep + 'bin' + \ os.pathsep + buildenv['path'] os.putenv('BUILDMODE', 'debug') if buildenv['version'] == 'release': path = buildenv['root'] + os.sep + 'release' + os.sep + 'bin' + \ os.pathsep + buildenv[...
(self.GetWeek(weekDate, False) == self.GetWeek(self.selectedDate, False))) or
(self.CompareWeeks(weekDate, self.selectedDate))) or
def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK);
style = wxTE_PROCESS_ENTER
style = 0
def renderOneBlock(self, parent, parentWindow): style = wxTE_PROCESS_ENTER if self.textAlignmentEnum == "Left": style |= wxTE_LEFT elif self.textAlignmentEnum == "Center": style |= wxTE_CENTRE elif self.textAlignmentEnum == "Right": style |= wxTE_RIGHT
return True
chanUUID = Globals.repository[self.counterpartUUID].rootPath.getUUID() changedUUID = notification.data['uuid'] if chanUUID == changedUUID: self.scheduleUpdate = True
def NeedsUpdate(self, notification): return True
return True
item = Globals.repository.find(notification.data['uuid']) if item.kind == RSSData.ZaoBaoParcel.getRSSChannelKind(): self.scheduleUpdate = True
def NeedsUpdate(self, notification): return True
if grid.GetElementCount(): item = grid.blockItem.contents [grid.GetGridCursorRow()]
elements = grid.GetElementCount() cursorRow = grid.GetGridCursorRow() if elements and elements > cursorRow: item = grid.blockItem.contents [cursorRow]
def GetColLabelValue (self, column): grid = self.GetView() if grid.GetElementCount(): item = grid.blockItem.contents [grid.GetGridCursorRow()] else: item = None return grid.GetColumnHeading (column, item)
if firstSelectedRow is None: firstSelectedRow = range[0] self.SetGridCursor (firstSelectedRow, 0) self.SelectBlock (range[0], 0, range[1], newColumns, True)
if range[0] < self.currentRows: if firstSelectedRow is None: firstSelectedRow = range[0] self.SetGridCursor (firstSelectedRow, 0) self.SelectBlock (range[0], 0, range[1], newColumns, True) else: invalidRanges.append(range) for badRange in invalidRanges: self.blockItem.selection.remove(badRange)
def wxSynchronizeWidget(self, **hints): """ A Grid can't easily redisplay its contents, so we write the following helper function to readjust everything after the contents change """ #Trim/extend the control's rows and update all values
if getattr(self, 'ticket', False): extraHeaders = { 'Ticket' : self.ticket } else: extraHeaders = None
def _putItem(self, item): """ putItem should publish an item and return etag/date, etc. """
extraHeaders = { 'Ticket' : self.ticket } else: extraHeaders = None
def _putItem(self, item): """ putItem should publish an item and return etag/date, etc. """
contentType=contentType, extraHeaders=extraHeaders)
contentType=contentType)
def _putItem(self, item): """ putItem should publish an item and return etag/date, etc. """
'biological weapons).</p>'
'biological weapons).</p>\n'
def CreateIndex(outputDir, newDirName, nowString, buildName): """ Generates HTML files that contain links and hash information for downloadable files. """ newPrefix = outputDir + os.sep + newDirName + os.sep head1 = '<html>\n<head>\n' +\ '<META HTTP-EQUIV="Pragma" CONTENT="no-cache">\n' +\ '<title>Download Chandler '...
elif event.RightUp(): self.ContextMenu(position) def ContextMenu(self, position):
else: event.Skip() def OnContextMenu(self, event): position = self.ScreenToClient(event.GetPosition())
def OnMouseEvent(self, event): """ Handles mouse events, calls overridable methods related to: 1. Selecting an item 2. Dragging/moving an item 3. Resizing an item """ # ignore entering and leaving events if (event.Entering() or event.Leaving()): event.Skip() return
self.blockItem.postEventByName ('RequestSelectSidebarItem', {'itemName':u"All"})
def OnWXDoubleClick(self, event): # Tell the sidebar we want to go to the All collection self.blockItem.postEventByName ('RequestSelectSidebarItem', {'itemName':u"All"})
doCopyLog("***Error during tests***", workingDir, logPath, log)
doCopyLog("***Error during unit tests***", workingDir, logPath, log)
def doTests(hardhatScript, mode, workingDir, outputDir, buildVersion, log): testDir = os.path.join(workingDir, "chandler") os.chdir(testDir) try: print "Testing " + mode log.write(separator) log.write("Testing " + mode + " ...\n") cmd = ['./tools/do_tests.sh', '-u', '-m %s' % mode] outputList = hardhatutil.executeCo...
log.write("exit code=%s\n" % exitCode)
if exitCode == 0: err = '' else: err = '***Error ' log.write("%sexit code=%s\n" % (err, exitCode))
def dumpTestLogs(log, chandlerLog, FuncTestLog, exitCode=0): # make sure functional test logs are not appended to tinderbox log #if FuncTestLog: #log.write("FunctionalTestSuite.log:\n") #try: #CopyLog(FuncTestLog, log) #except: #pass #log.write(separator) if chandlerLog: log.write("chandler.log:\n") try: CopyLog(chand...
log.write("exit code=%s\n" % e.args)
if e.args == 0: err = '' else: err = '***Error ' log.write("%sexit code=%s\n" % (err, e.args))
def doPerformanceTests(hardhatScript, mode, workingDir, outputDir, buildVersion, log): chandlerDir = os.path.join(workingDir, "chandler") testDir = os.path.join(chandlerDir, 'tools', 'QATestScripts', 'Performance') logDir = os.path.join(chandlerDir, 'test_profile') chandlerLog = os.path.join(logDir, 'chan...
cls.idle()
def emulate_typing(cls, string, ctrlFlag = False, altFlag = False, shiftFlag = False): """ emulate_typing the string into the current focused widget """ cls.idle() #experiment to see if this helps with bug 5109 success = True def set_event_info(event): # setup event info for a keypress event event.m_keyCode = keyCode e...
border = border or RectType(2, 2, 2, 2)
border = border or RectType(2, 2, 2, 2) try: resyncEvent = parcel['Resynchronize'] except KeyError: resyncEvent = schema.ns(__name__, parcel.itsView).Resynchronize
def makeEditor(parcel, name, viewAttribute, border=None, baseClass=DetailSynchronizedAttributeEditorBlock, characterStyle=None, presentationStyle=None, **kwds): """ Make an Attribute Editor block template for the detail view. """ blocks = schema.ns("osaf.framework.blocks", parcel.itsView) ps = presentationStyle is not ...
event=parcel['Resynchronize'], **kwds)
event=resyncEvent, **kwds)
def makeEditor(parcel, name, viewAttribute, border=None, baseClass=DetailSynchronizedAttributeEditorBlock, characterStyle=None, presentationStyle=None, **kwds): """ Make an Attribute Editor block template for the detail view. """ blocks = schema.ns("osaf.framework.blocks", parcel.itsView) ps = presentationStyle is not ...
not UserCollection (item).outOfTheBoxCollection):
not (item is not None and UserCollection (item).outOfTheBoxCollection)):
def _mapItemToCacheKeyItem(self, item, hints): assert item is None or isinstance (item, ContentCollection) # The sidebar can only contain ContentCollections key = item sidebar = Block.Block.findBlockByName ("Sidebar") """ collectionList should be in the order that the source items are overlayed in the Calendar view
calname = ""
calname = None
def itemsFromVObject(view, text, coerceTzinfo = None, filters = None, monolithic = True, changes=None, previousView=None, updateCallback=None): """ Take a string, create or update items from that stream. The updating of items uses Sharing.importValue; changes, previousView and updateCallback are all optional pass-thro...
if calname == "": calname = calendar.getChildValue('x_wr_calname')
if calname is None: calname = calendar.getChildValue('x_wr_calname')
def itemsFromVObject(view, text, coerceTzinfo = None, filters = None, monolithic = True, changes=None, previousView=None, updateCallback=None): """ Take a string, create or update items from that stream. The updating of items uses Sharing.importValue; changes, previousView and updateCallback are all optional pass-thro...
if calname == "":
if calname is None:
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.
if iAmStart: if not item.anyTime:
if not item.anyTime: if iAmStart:
def SetAttributeValue(self, item, attributeName, valueString): newValueString = valueString.replace('?','').strip() iAmStart = attributeName == 'startTime' changed = False forceReload = False if len(newValueString) == 0: # Clearing an event's start time (removing the value in it, causing # it to show "HH:MM") will remo...
global buildscriptFile, fromAddr, mailtoAddr, alertAddr, adminAddr, defaultDomain
global buildscriptFile, fromAddr, mailtoAddr, alertAddr, adminAddr, defaultDomain, defaultRsyncServer
def main(): global buildscriptFile, fromAddr, mailtoAddr, alertAddr, adminAddr, defaultDomain 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 script reports\n" " [defa...
"192.168.101.46:continuous/" + buildNameNoSpaces])
rsyncServer + ":continuous/" + buildNameNoSpaces])
def main(): global buildscriptFile, fromAddr, mailtoAddr, alertAddr, adminAddr, defaultDomain 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 script reports\n" " [defa...
msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromAddr, toAddr)) msg += "Subject: " + status + " from " + buildName + "\n"
subject = "[tindertest] " + status + " from " + buildName msg = ("From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (fromAddr, toAddr, subject))
def SendMail(fromAddr, toAddr, startTime, buildName, status, treeName, logContents): nowTime = str(int(time.time())) msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromAddr, toAddr)) msg += "Subject: " + status + " from " + buildName + "\n" msg += "tinderbox: tree: " + treeName + "\n" msg += "tinderbox: buildname: " + buildN...
None, html, False, False)
None, html, True, False)
def onAboutEvent(self, event): # The "Help | About Chandler..." menu item """ Show the splash screen in response to the about command """ import version pageLocation = os.path.join ('application', 'welcome.html') html = '' for line in open(pageLocation): if line.find('@@buildid@@') >= 0: line = "<p>Build identifier: '%...
event.arguments['Enable'] = self.canRenameSelection()
event.arguments['Enable'] = \ not self.selectedItemToView.outOfTheBoxCollection
def onRenameEventUpdateUI (self, event): event.arguments['Enable'] = self.canRenameSelection()
self.rosterNotified = false
def __init__(self, application): self.application = application self.jabberID = None self.password = '' self.connection = None self.roster = None self.connected = false self.loggedIn = false self.timer = None self.presenceStateMap = {} self.nameMap = {} self.accessibleViews = {} self.openPeers = {}
if self.rosterParcel != None: self.rosterParcel.SynchronizePresence()
def __init__(self, application): self.application = application self.jabberID = None self.password = '' self.connection = None self.roster = None self.connected = false self.loggedIn = false self.timer = None self.presenceStateMap = {} self.nameMap = {} self.accessibleViews = {} self.openPeers = {}
return ConfigParser.SafeConfigParser.get(self, *args, **kwargs) except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
entry = self[unicode(section)][unicode(option)] if isinstance(entry, list): entry = u", ".join(entry) elif not (isinstance(entry, str) or isinstance(entry, unicode)): entry = unicode(entry) if entry.startswith(u"rgb"): entry = u" return entry except:
def get(self, *args, **kwargs): try: return ConfigParser.SafeConfigParser.get(self, *args, **kwargs) except (ConfigParser.NoSectionError, ConfigParser.NoOptionError): return None
address.fullName = section.fullName
try: address.fullName = section.fullName except AttributeError: pass
def saveAttributeFromWidget(self, item, widget, validate): if validate: section = item.getAttributeValue (self.whichAttribute()) widgetString = widget.GetValue() processedAddresses, validAddresses = self.parseEmailAddresses (item, widgetString) section.setAttributeValue('emailAddresses', validAddresses) for address in ...
del self.manifest[path]
try: del self.manifest[path] except: pass
def __removeFromManifest(self, path): del self.manifest[path]
headerLabels = ["Week", "S", "M", "Tu", "W", "Th", "F", "S", "+"]
headerLabels = ["Week", "S", "M", "Tu", "W", "Th", "F", "S", '']
def __init__(self, *arguments, **keywords): super(wxCalendarControl, self).__init__(*arguments, **keywords)
self.weekColumnHeader.AppendItem(header, wx.colheader.CH_JUST_Center, 5, bSortEnabled=False)
self.weekColumnHeader.AppendItem(header, wx.colheader.CH_JUST_Center, 0, bSortEnabled=False) self.weekColumnHeader.SetBitmapJustification(8, wx.colheader.CH_JUST_Center) self.weekColumnHeader.SetBitmapRef(8, self.allDayOpenArrowImage)
def __init__(self, *arguments, **keywords): super(wxCalendarControl, self).__init__(*arguments, **keywords)
pass
self.weekColumnHeader.SetBitmapRef(8, self.allDayOpenArrowImage)
def OnSashPositionChange(self, event=None): ## TODO: hook up something like EVT_SPLITTER_SASH_POS_CHANGED to this #wxAllDay = self.blockItem.calendarContainer.allDayEventsCanvas.widget wxAllDay = self.GetAllDayWidget() position = wxAllDay.GetParent().GetSashPosition() if position == wxAllDay.collapsedHeight: #print 'se...
pass
self.weekColumnHeader.SetBitmapRef(8, self.allDayCloseArrowImage)
def OnSashPositionChange(self, event=None): ## TODO: hook up something like EVT_SPLITTER_SASH_POS_CHANGED to this #wxAllDay = self.blockItem.calendarContainer.allDayEventsCanvas.widget wxAllDay = self.GetAllDayWidget() position = wxAllDay.GetParent().GetSashPosition() if position == wxAllDay.collapsedHeight: #print 'se...
item.endTime, indent))
item.endTime, indent, width))
def UpdateDrawingRects(self): item = self.GetItem() indent = self.GetIndentLevel() * 5 self._boundsRects = list(self.GenerateBoundsRects(self._calendarCanvas, item.startTime, item.endTime, indent)) self._bounds = self._boundsRects[0]
def GenerateBoundsRects(calendarCanvas, startTime, endTime, indent):
def GenerateBoundsRects(calendarCanvas, startTime, endTime, indent=0, width=0):
def GenerateBoundsRects(calendarCanvas, startTime, endTime, indent): """ 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...
rect.width -= indent
rect.width -= width
def GenerateBoundsRects(calendarCanvas, startTime, endTime, indent): """ 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...
self._bgSelectionEndTime, 0)
self._bgSelectionEndTime)
def DrawBackground(self, dc): self._doDrawingCalculations()
def profile_me(): self.profiler.runcall(method)
def profile_me(*args): self.profiler.runcall(method, *args)
def profile_me(): self.profiler.runcall(method)
log = open(HHlogFile, "r") logContents += log.read() log.close()
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...
log.close() log = open(HHlogFile, "r") logContents += log.read()
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...
if isinstance(contents, pim.SmartCollection) and \ not hasattr(contents, 'inclusions'): contents._setup()
def _get(self, previousView=None, updateCallback=None, getPhrase=None):
text = unicode(widgetText, 'utf-8', 'ignore').encode('ascii', 'ignore')
if not isinstance(widgetText, unicode): widgetText = unicode(widgetText, 'utf-8', 'ignore') text = widgetText.encode('ascii', 'ignore')
def saveAttributeFromWidget (self, item, widget, validate): if validate: attributeName = GetRedirectAttribute(item, 'body'); textType = item.getAttributeAspect(attributeName, 'type') widgetText = widget.GetValue() if widgetText: #XXX: Ensures that any non-ascii text entered in to the detail view # is properly encod...
createNewRepository = self.version != Application.VERSION
def __setstate__(self, dict): """ Data often lives a long time, even longer than code and we may need to update it over time as it's structure changes. A convienent way to do this is to check for an old version in __setstate__, which is called each time the object is loaded, and update the data as necessary. Until the ...