rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
self.CheckButton("CalendarStamp", "calendar stamp", dict[field])
self.CheckButton("CalendarStamp", "calendar stamp", value)
def Check_DetailView(self, dict): """ Check expected values by comparation to the data diplayed in the detail view @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) self.SelectItem() ...
for field in dict.keys():
for field,value in dict.iteritems():
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
if not dict[field] == d_name : if self.logger: self.logger.ReportFailure("(On display name Checking) || object title = %s ; expected title = %s" %(d_name, dict[field]))
if not value == d_name : if self.logger: self.logger.ReportFailure("(On display name Checking) || object title = %s ; expected title = %s" %(d_name, value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
dictDate = self.formatDate(dict[field])
dictDate = self.formatDate(value)
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
if not dict[field] == s_time : if self.logger: self.logger.ReportFailure("(On start time Checking) || object start time = %s ; expected start time = %s" %(s_time, dict[field]))
if not value == s_time : if self.logger: self.logger.ReportFailure("(On start time Checking) || object start time = %s ; expected start time = %s" %(s_time, value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
if not dict[field] == e_time : if self.logger: self.logger.ReportFailure("(On end time Checking) || object end time = %s ; expected end time = %s" %(e_time, dict[field]))
if not value == e_time : if self.logger: self.logger.ReportFailure("(On end time Checking) || object end time = %s ; expected end time = %s" %(e_time, value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
if not dict[field] == loc : if self.logger: self.logger.ReportFailure("(On location Checking) || object location = %s ; expected location = %s" %(loc, dict[field]))
if not value == loc : if self.logger: self.logger.ReportFailure("(On location Checking) || object location = %s ; expected location = %s" %(loc, value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
if not dict[field] == body : if self.logger: self.logger.ReportFailure("(On body Checking) || object body = %s ; expected body = %s" %(body, dict[field]))
if not value == body : if self.logger: self.logger.ReportFailure("(On body Checking) || object body = %s ; expected body = %s" %(body, value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
if not dict[field] == f : if self.logger: self.logger.ReportFailure("(On from address Checking) || object from address = %s ; expected from address = %s" %(f, dict[field]))
if not value == f : if self.logger: self.logger.ReportFailure("(On from address Checking) || object from address = %s ; expected from address = %s" %(f, value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
if not dict[field] == t : if self.logger: self.logger.ReportFailure("(On to address Checking) || object to address = %s ; expected to address = %s" %(t, dict[field]))
if not value == t : if self.logger: self.logger.ReportFailure("(On to address Checking) || object to address = %s ; expected to address = %s" %(t, value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
if not dict[field] == status : if self.logger: self.logger.ReportFailure("(On status Checking) || object status = %s ; expected status = %s" %(status, dict[field]))
if not value == status : if self.logger: self.logger.ReportFailure("(On status Checking) || object status = %s ; expected status = %s" %(status, value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
if not dict[field] == timeZone : if self.logger: self.logger.ReportFailure("(On time zone Checking) || object time zone = %s ; expected time zone = %s" %(timeZone, dict[field]))
if not value == timeZone : if self.logger: self.logger.ReportFailure("(On time zone Checking) || object time zone = %s ; expected time zone = %s" %(timeZone, value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
field = timedelta(minutes = string.atoi(dict[field]))
field = timedelta(minutes = string.atoi(value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
if not dict[field] == allDay : if self.logger: self.logger.ReportFailure("(On all Day Checking) || object all day = %s ; expected all day = %s" %(allDay, dict[field]))
if not value == allDay : if self.logger: self.logger.ReportFailure("(On all Day Checking) || object all day = %s ; expected all day = %s" %(allDay, value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
kind = "%s" %self.item.getKind() if not string.find(kind, "MailMessage") == -1:
if "MailMessage" in str(self.item.getKind()):
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
if not dict[field] == stampMail : if self.logger: self.logger.ReportFailure("(On Mail Stamp Checking) || object Mail Stamp = %s ; expected Mail Stamp = %s" %(stampMail, dict[field]))
if not value == stampMail : if self.logger: self.logger.ReportFailure("(On Mail Stamp Checking) || object Mail Stamp = %s ; expected Mail Stamp = %s" %(stampMail, value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
kind = "%s" %self.item.getKind() if not string.find(kind, "Task") == -1:
if "Task" in str(self.item.getKind()):
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
if not dict[field] == stampTask : if self.logger: self.logger.ReportFailure("(On Task Stamp Checking) || object Task Stamp = %s ; expected Task Stamp = %s" %(stampTask, dict[field]))
if not value == stampTask : if self.logger: self.logger.ReportFailure("(On Task Stamp Checking) || object Task Stamp = %s ; expected Task Stamp = %s" %(stampTask, value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
kind = "%s" %self.item.getKind() if not string.find(kind, "CalendarEvent") == -1:
if "CalendarEvent" in str(self.item.getKind()):
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
if not dict[field] == stampEvent : if self.logger: self.logger.ReportFailure("(On Event Stamp Checking) || object Event Stamp = %s ; expected Event Stamp = %s" %(stampEvent, dict[field]))
if not value == stampEvent : if self.logger: self.logger.ReportFailure("(On Event Stamp Checking) || object Event Stamp = %s ; expected Event Stamp = %s" %(stampEvent, value))
def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) # check the chang...
self.accountTypeIndex = {'SMTP': 3, 'IMAP': 1, 'POP': 2, 'WebDAV': 4} SMTPfields = {'displayName': 3, 'address': 5, 'host': 7, 'username': 17, 'password': 19, 'security': 9, 'port':13, 'authentication': 15} IMAPfields = {'displayName': 3, 'email': 5, 'name': 7, 'host': 9, 'username': 11, 'password': 13, 'security': 15...
def __init__(self, logger=None): self.view = App_ns.itsView self.logger = logger self.window = None self.accountTypeIndex = {'SMTP': 3, 'IMAP': 1, 'POP': 2, 'WebDAV': 4} SMTPfields = {'displayName': 3, 'address': 5, 'host': 7, 'username': 17, 'password': 19, 'security': 9, 'port':13, 'authentication': 15} IMAPfields =...
if not ((buildenv['os'] == 'win') and (buildenv['version'] == 'debug')): os.chdir(os.path.join("model","util","ext")) if buildenv['version'] == 'debug': python = buildenv['python_d'] if buildenv['version'] == 'release': python = buildenv['python']
os.chdir(os.path.join("model","util","ext")) if buildenv['version'] == 'debug': python = buildenv['python_d']
def build(buildenv): if buildenv['os'] == 'posix': os.chdir("distrib/linux/launcher") if buildenv['version'] == 'release': hardhatlib.executeCommand( buildenv, info['name'], [buildenv['make']], "Making launcher programs") hardhatlib.copyFile("chandler_bin", buildenv['root'] + \ os.sep + "release") hardhatlib.copyFile(...
[python, "setup.py", "install"], "Building UUID Extension" ) os.chdir("../../..")
[python, "setup.py", "build", "--debug"], "Building UUID Extension" ) if buildenv['version'] == 'release': python = buildenv['python'] hardhatlib.executeCommand( buildenv, info['name'], [python, "setup.py", "build"], "Building UUID Extension" ) hardhatlib.executeCommand( buildenv, info['name'], [python, "setup.py", "in...
def build(buildenv): if buildenv['os'] == 'posix': os.chdir("distrib/linux/launcher") if buildenv['version'] == 'release': hardhatlib.executeCommand( buildenv, info['name'], [buildenv['make']], "Making launcher programs") hardhatlib.copyFile("chandler_bin", buildenv['root'] + \ os.sep + "release") hardhatlib.copyFile(...
system_tz = ICUtzinfo(TimeZone.createDefault()) calendar.setTime(date.replace(tzinfo=system_tz))
calendar.setTimeZone(ICUtzinfo.default._timezone) calendar.setTime(date)
def setRange(self, date): """ Sets the range to include the given date, given the current view. For week view, it will start the range at the beginning of the week. For day view, it will set the range to start at the given date
system_tz = ICUtzinfo(TimeZone.createDefault()) calendar.setTime(date.replace(tzinfo=system_tz))
calendar.setTimeZone(ICUtzinfo.default._timezone) calendar.setTime(date)
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"
resyncEvent = schema.ns(__name__, parcel.itsView).Resynchronize
detailParcelPath = '.'.join(__name__.split('.')[:-1]) resyncEvent = schema.ns(detailParcelPath, 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 ...
uAttr, vFlags, data = values.c.loadValue(txn, uValue)
if uValue is not None: uAttr, vFlags, data = values.c.loadValue(txn, uValue)
def undoItem(self, txn, indexReader, indexSearcher): store = self.repository.store items = store._items values = store._values refs = store._refs lobs = store._lobs indexes = store._indexes
if withSchema: offset = self.skipSymbol(0, data) else: offset = 0 flags = ord(data[offset]) offset += 1 if flags & DBItemWriter.VALUE: if isNew: for uLob in self.iterLobs(flags, data): lobs.purgeLob(txn, uLob) for uIndex in self.iterIndexes(flags, data): indexes.undoIndex(txn, uIndex, version) elif flags & DBItemWri...
if withSchema: offset = self.skipSymbol(0, data) else: offset = 0 flags = ord(data[offset]) offset += 1 if flags & DBItemWriter.VALUE: if isNew: for uLob in self.iterLobs(flags, data): lobs.purgeLob(txn, uLob)
def undoItem(self, txn, indexReader, indexSearcher): store = self.repository.store items = store._items values = store._values refs = store._refs lobs = store._lobs indexes = store._indexes
import traceback
def __init__(self, *args, **kw): super(CalendarEventMixin, self).__init__(*args, **kw) import traceback self.occurrenceFor = self if not kw.has_key('icalUID'): self.icalUID = unicode(self.itsUUID)
def _transformFilesXslt(buildenv, transformFile, srcDir, destDir, fileList):
def _transformFilesXslt(buildenv, transformFile, srcDir, destDir, outFile, fileList):
def _transformFilesXslt(buildenv, transformFile, srcDir, destDir, fileList): """ Run the list of files through an XSLT transform """ hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Running XSLT processor") if buildenv['version'] == 'debug': python = buildenv['python_d'] sitePkg = buildenv['pythonli...
"Running XSLT processor")
"Running XSLT processor using " + transformFile)
def _transformFilesXslt(buildenv, transformFile, srcDir, destDir, fileList): """ Run the list of files through an XSLT transform """ hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Running XSLT processor") if buildenv['version'] == 'debug': python = buildenv['python_d'] sitePkg = buildenv['pythonli...
"--outfile="+destDir+os.sep+file,
"--outfile="+destFile,
def _transformFilesXslt(buildenv, transformFile, srcDir, destDir, fileList): """ Run the list of files through an XSLT transform """ hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Running XSLT processor") if buildenv['version'] == 'debug': python = buildenv['python_d'] sitePkg = buildenv['pythonli...
def simplePrint(item, conf): print item.itsPath
def processItem(item, handler, conf): if item.itsName is None: # Skip all the unnamed items, otherwise they'll flood your disk over # time unless you completely blow away the doc tree before each publish return handler(item, conf) for child in item.iterChildren(): processItem(child, handler, conf)
'tools',
def generateDocs(options, outputDir): if options.verbose: verbosity = 4 else: verbosity = 1 if sys.platform == 'cygwin' or os.name == 'nt': chandlerdb = 'release/bin/Lib/site-packages/chandlerdb' queryparser = 'release/bin/Lib/site-packages/QueryParser.py' pyicu = 'release/bin/Lib/site-packages/PyICU.py' pyluce...
def progress_callback(path, numfiles=numfiles, progress=None, cancel=None, num=[1]):
def progress_callback(path):
def progress_callback(path, numfiles=numfiles, progress=None, cancel=None, num=[1]): (dir, file) = os.path.split(path) (root, d) = os.path.split(dir)
now = datetime.now()
now = datetime.now(ICUtzinfo.default)
def dismissReminder(self, reminder): """ Dismiss this reminder. """ # Make sure the next one's around, so we'll prime the reminder- # watching mechanism to alert us about it. We also check that # reminders for past events don't trigger this one. now = datetime.now()
self.Destory()
self.Destroy()
def OnSubscribe(self, evt): view = self.view url = self.textUrl.GetValue() url = url.strip() if url.startswith('webcal:'): url = 'http:' + url[7:]
idebarCollection.add (collection)
sidebarCollection.add (collection)
def GenerateCollection(view, mainView, args): """ Generate one Collection Item """ appNameSpace = schema.ns('osaf.app', self) collection = pim.ListCollection(view=view) collection.color = appNameSpace.collectionColors.nextColor() sidebarCollection = appNameSpace.sidebarCollection if args[0]=='*': # semi-random data wh...
self.failUnless(schema.reset().check(), "check() failed")
self.failUnless(self.view.check(), "check() failed")
def tearDown(self): self.failUnless(schema.reset().check(), "check() failed")
trash = ListCollection(itsView=self.view)
trash = self.trash
def testSmartCollection(self): trash = ListCollection(itsView=self.view) coll1 = SmartCollection(itsView=self.view, trash=trash) coll2 = SmartCollection(itsView=self.view, trash=trash) coll3 = SmartCollection(itsView=self.view, trash=trash) note = pim.Note(itsView=self.view)
trash = ListCollection(itsView=self.view)
trash = self.trash
def testRemoveItem(self): # Simulate removing an item from a not-mine collection, ensuring it # doesn't go into the All collection, but rather moves to the Trash # if it's not in any other collections
Data: Version: 1 (0x0) Serial Number: 02:ad:66:7e:4e:45:fe:5e:57:6f:3c:98:19:5e:dd:c0 Signature Algorithm: md2WithRSAEncryption Issuer: C=US, O=RSA Data Security, Inc., OU=Secure Server Certification Authority Validity Not Before: Nov 9 00:00:00 1994 GMT Not After : Jan 7 23:59:59 2010 GMT Subject: C=US, O=RSA Data S...
Data: Version: 1 (0x0) Serial Number: 02:ad:66:7e:4e:45:fe:5e:57:6f:3c:98:19:5e:dd:c0
def exactlyOneSidebarCollectionNamed(name): """ Look for a sidebar collection with name, otherwise return False """ entries = [] sidebarWidget = app_ns().sidebar.widget for i in range(sidebarWidget.GetNumberRows()): collection = sidebarWidget.GetTable().GetValue(i,0)[0] if collection.displayName == name: entries.append...
65:dd:7e:e1:b2:ec:b0:e2:3a:e0:ec:71:46:9a:19:11:b8:d3: c7:a0:b4:03:40:26:02:3e:09:9c:e1:12:b3:d1:5a:f6:37:a5: b7:61:03:b6:5b:16:69:3b:c6:44:08:0c:88:53:0c:6b:97:49: c7:3e:35:dc:6c:b9:bb:aa:df:5c:bb:3a:2f:93:60:b6:a9:4b: 4d:f2:20:f7:cd:5f:7f:64:7b:8e:dc:00:5c:d7:fa:77:ca:39: 16:59:6f:0e:ea:d3:b5:83:7f:4d:4d:42:56:76:b4:...
Issuer: C=US, O=RSA Data Security, Inc., OU=Secure Server Certification Authority Validity Not Before: Nov 9 00:00:00 1994 GMT Not After : Jan 7 23:59:59 2010 GMT Subject: C=US, O=RSA Data Security, Inc., OU=Secure Server Certification Authority Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public ...
def exactlyOneSidebarCollectionNamed(name): """ Look for a sidebar collection with name, otherwise return False """ entries = [] sidebarWidget = app_ns().sidebar.widget for i in range(sidebarWidget.GetNumberRows()): collection = sidebarWidget.GetTable().GetValue(i,0)[0] if collection.displayName == name: entries.append...
cert.CheckEditableBlock('TrustAttribute', 'trust', '3')
def exactlyOneSidebarCollectionNamed(name): """ Look for a sidebar collection with name, otherwise return False """ entries = [] sidebarWidget = app_ns().sidebar.widget for i in range(sidebarWidget.GetNumberRows()): collection = sidebarWidget.GetTable().GetValue(i,0)[0] if collection.displayName == name: entries.append...
cert.SetEditableBlock('TrustAttribute', 'trust', '0', True)
cert.SetEditableBlock('TrustAttribute', 'trust', '0', False)
def exactlyOneSidebarCollectionNamed(name): """ Look for a sidebar collection with name, otherwise return False """ entries = [] sidebarWidget = app_ns().sidebar.widget for i in range(sidebarWidget.GetNumberRows()): collection = sidebarWidget.GetTable().GetValue(i,0)[0] if collection.displayName == name: entries.append...
initialHeight = self.todayHeight + self.heightPreview
initialHeight = self.todayHeight
def HitTest(self, pos): # we need to find out if the hit is on left arrow, on month or # on right arrow
height = self.todayHeight + self.heightPreview + VERT_MARGIN
height = self.todayHeight + VERT_MARGIN
def GetHeaderSize(self):
y += self.heightPreview
def OnMiniCalPaint(self, event): dc = wx.PaintDC(self)
width = DAYS_PER_WEEK * self.widthCol height = (self.todayHeight + self.heightPreview + VERT_MARGIN +
width = DAYS_PER_WEEK * self.widthCol + 2 * SEPARATOR_MARGIN height = (self.todayHeight + VERT_MARGIN +
def DoGetBestSize(self): self.RecalcGeometry()
self.rowOffset + EXTRA_MONTH_HEIGHT) + 15) if self.HasFlag(wx.BORDER_NONE): height += 6
self.rowOffset + EXTRA_MONTH_HEIGHT) + 17) if "__WXMAC__" in wx.PlatformInfo:
def DoGetBestSize(self): self.RecalcGeometry()
self.heightPreview = 0
def RecalcGeometry(self, dc=None): """ (re)calc self.widthCol and self.heightRow """ if dc is None: dc = wx.ClientDC(self)
x = weekDay * self.widthCol + (self.widthCol - width) / 2
columnStart = SEPARATOR_MARGIN + weekDay * self.widthCol x = columnStart + (self.widthCol - width) / 2
def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK);
startX = weekDay * self.widthCol if weekDay == 0: startX += SEPARATOR_MARGIN
startX = columnStart
def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK);
if weekDay == DAYS_PER_WEEK-1: width -= (SEPARATOR_MARGIN)
def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK);
dc.DrawRectangle(x-3, y + self.heightRow - height - 2, 2, height)
dc.DrawRectangle(columnStart + 1, y + self.heightRow - height - 1, 2, height)
def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK);
DAYS_PER_WEEK * self.widthCol - SEPARATOR_MARGIN,
self.GetClientSize().x - SEPARATOR_MARGIN,
def DrawMonth(self, dc, startDate, y, highlightDate = False): """ draw a single month return the updated value of y """ dc.SetTextForeground(wx.BLACK);
self.todayHeight + EXTRA_MONTH_HEIGHT + self.rowOffset + self.heightPreview)
self.todayHeight + EXTRA_MONTH_HEIGHT + self.rowOffset)
def RefreshDate(self, date): """ redraw the given date """
dc.SetBrush(wx.Brush(wx.Colour(128, 128, 128))) dc.SetPen(wx.Pen(wx.Colour(153, 153, 153)))
dc.SetBrush(wx.Brush(wx.Colour(153, 153, 153))) dc.SetPen(wx.Pen(wx.Colour(128, 128, 128)))
def DrawDay(self, dc, date, rect): # Scaffolding, we'll get more sophisticated here
menuTitle = _('Share collection "%s"') \
menuTitle = _('Share "%s" collection') \
def onShareCollectionEventUpdateUI (self, event): """ Update the menu to reflect the selected collection name """ # Only enable if user has set their webdav account up if not Sharing.isWebDAVSetUp(self.itsView): event.arguments ['Enable'] = False return
menuTitle = _('%s collection "%s"') % (verb, collection.displayName)
menuTitle = _('%s "%s" collection') % (verb, collection.displayName)
def _onShareOrManageSidebarCollectionEventUpdateUI (self, event, doManage): """ Update the menu to reflect the selected collection name """ collection = self.getSidebarSelectedCollection () verb = (doManage and _('Manage') or _('Share')) if collection is not None: # event.arguments['Enable'] = True menuTitle = _('%s c...
menuTitle = _('Sync collection "%s"') % collection.displayName
menuTitle = _('Sync "%s" collection') % collection.displayName
def onSyncCollectionEventUpdateUI (self, event): """ Update the menu to reflect the selected collection name """ collection = self.getSidebarSelectedCollection () if collection is not None: menuTitle = _('Sync collection "%s"') % collection.displayName if Sharing.isShared(collection): event.arguments['Enable'] = True e...
self.ClearSelection()
def DeleteSelection(self): self.ClearSelection() for item in self.selection: item.removeFromCollection(self.contents.collectionList[0])
if status == 'FYI' or item.anyTime: status = 'CANCELLED'
if status == 'FYI' or (not item.allDay and item.anyTime): status = 'CANCELLED'
def makeDateTimeValue(dt, asDate=False): if asDate: return dt.date() elif dt.tzinfo is ICUtzinfo.floating: return dt.replace(tzinfo=None) else: return dt
for fb in vfreebusy.freebusy_list:
for fb in getattr(vfreebusy, 'freebusy_list', []):
def updateFreebusyFromVObject(view, text, busyCollection, updateCallback=None): """ Take a string, create or update freebusy events in busyCollection from that stream. Truncate differing existing freebusy events that overlap the start or end times. Returns (freebusystart, freebusyend, calname). """ newItemParent = ...
log.write("skipping rsync to staging area, no dir")
log.write("skipping rsync to staging area, no dir\n")
def UploadToStaging(nowString, log, rsyncProgram, rsyncServer): timestamp = nowString.replace("-", "") timestamp = timestamp.replace(":", "") timestamp = timestamp.replace(" ", "") if not os.path.isdir(timestamp): print "skipping rsync to staging area, no dir", timestamp log.write("skipping rsync to staging area, no d...
right now, we consider all kinds
right now, we consider only ContentItems.
def CandidateStampedKinds(self): """ return the list of candidate kinds for stamping right now, we consider all kinds """ kindKind = Globals.repository.findPath('//Schema/Core/Kind') allKinds = Query.KindQuery().run([kindKind]) return allKinds
return allKinds
contentItemKinds = [] contentItemKind = ContentModel.getContentItemKind () for aKind in allKinds: if aKind.isKindOf (contentItemKind): contentItemKinds.append (aKind) return contentItemKinds
def CandidateStampedKinds(self): """ return the list of candidate kinds for stamping right now, we consider all kinds """ kindKind = Globals.repository.findPath('//Schema/Core/Kind') allKinds = Query.KindQuery().run([kindKind]) return allKinds
if len(selectedItems) > 0:
enable = False states = set() for item in selectedItems: enable = isinstance(item, Note) if not enable: break
def onFocusStampEventUpdateUI(self, event): selectedItems = self.__getSelectedItems() stampClass = event.classParameter if len(selectedItems) > 0: # Collect the states of all the items, so that we can change all # the items if they're all in the same state. states = [ (isinstance(item, Note), has_stamp(item, stampClass...
states = [ (isinstance(item, Note), has_stamp(item, stampClass)) for item in selectedItems] isNote, isStamped = states[0] enable = isNote and len(set(states)) == 1 event.arguments['Enable'] = enable event.arguments['Check'] = enable and isStamped
states.add(has_stamp(item, stampClass)) enable = enable and (len(states) == 1) event.arguments['Enable'] = enable event.arguments['Check'] = enable and iter(states).next()
def onFocusStampEventUpdateUI(self, event): selectedItems = self.__getSelectedItems() stampClass = event.classParameter if len(selectedItems) > 0: # Collect the states of all the items, so that we can change all # the items if they're all in the same state. states = [ (isinstance(item, Note), has_stamp(item, stampClass...
def broadcast (block, methodName, notification, stopAtEventBounary = True):
def broadcast (block, methodName, notification, stopAtEventBoundary = True):
def broadcast (block, methodName, notification, stopAtEventBounary = True): """ Call method named methodName on every block and it's children who implements it, except for the block that posted the event, to avoid recursive calls. """ if block != notification.data['sender']: callMethod (block, methodName, notification)...
if child and not (stopAtEventBounary and child.eventBoundary): broadcast (child, methodName, notification)
if child and not (stopAtEventBoundary and child.eventBoundary): broadcast (child, methodName, notification, stopAtEventBoundary)
def broadcast (block, methodName, notification, stopAtEventBounary = True): """ Call method named methodName on every block and it's children who implements it, except for the block that posted the event, to avoid recursive calls. """ if block != notification.data['sender']: callMethod (block, methodName, notification)...
broadcast (Globals.mainView, methodName, notification, stopAtEventBounary = False)
broadcast (Globals.mainView, methodName, notification, stopAtEventBoundary = False)
def broadcast (block, methodName, notification, stopAtEventBounary = True): """ Call method named methodName on every block and it's children who implements it, except for the block that posted the event, to avoid recursive calls. """ if block != notification.data['sender']: callMethod (block, methodName, notification)...
def NotifyUIAsync (message, logger=logging.info, **keys): logger (message)
def NotifyUIAsync(message, **keys):
def NotifyUIAsync (message, logger=logging.info, **keys): logger (message) if Globals.wxApplication is not None: # test framework has no wxApplication Globals.wxApplication.CallItemMethodAsync (Globals.mainView, 'setStatusMessage', message, **keys)
factory = smtp.ChandlerESMTPSenderFactory(username, password, self.from_addr, self.sendToList, msg, d, self.log, retries, sslContext, heloFallback, authRequired, useSSL, useSSL) reactor.connectTCP(host, port, factory)
self.factory = smtp.ChandlerESMTPSenderFactory(username, password, self.from_addr, self.sendToList, msg, d, retries, sslContext, heloFallback, authRequired, useSSL, useSSL) reactor.connectTCP(host, port, self.factory)
def __sendInvitation(self): self.setViewCurrent()
e = "Failed to send invitation | (%s: %s) | %s | %s | %s |" % (self.collectionName, self.url,
if code == smtp.SMTPConstants.SUCCESS: continue e = "Failed to send invitation | (%s: %s) | %s | %s | %s |" % (self.collectionName, self.url,
def __invitationSuccessCheck(self, result): if __debug__: self.printCurrentView("__invitationSuccessCheck")
self.log.error('\n'.join(e)) NotifyUIAsync (_('Errors occurred sending invitations. See the log file for more information.'), alert=True)
err = '\n'.join(errorText) self.log.error(err) NotifyUIAsync(_(err), alert=True)
def __invitationSuccessCheck(self, result): if __debug__: self.printCurrentView("__invitationSuccessCheck")
e = "Failed to send invitation | (%s: %s) | %s |" % (self.collectionName, self.url, result.value)
self.factory.done = True try: desc = result.value.resp except: desc = result.value e = "Failed to send invitation | (%s: %s) | %s |" % (self.collectionName, self.url, desc)
def __invitationFailure(self, result): if __debug__: self.printCurrentView("__invitationFailure")
calendarSplitter = nth(self.childrenBlocks, 1) timedEventsBlock = nth(calendarSplitter.childrenBlocks, 1) timedEventsCanvas = timedEventsBlock.widget startTime, duration = timedEventsCanvas.GetNewEventTime() timedEventsCanvas.CreateEmptyEvent(startTime, duration, False, False)
ourKind = Calendar.CalendarEvent.getKind(self.itsView) kindParam = getattr(event, 'kindParameter', ourKind) if kindParam is not ourKind: event.arguments['continueBubbleUp'] = True else: calendarSplitter = nth(self.childrenBlocks, 1) timedEventsBlock = nth(calendarSplitter.childrenBlocks, 1) timedEventsCanvas = timed...
def onNewEvent(self, event): """ Create a new event from the menu - try to use contextual information from the view to create it in a normal place """
__handleText(view, firstPart, parentMIMEContainer, bodyBuffer, \ counter, buf, level+1)
__handleText(view, firstPart, parentMIMEContainer, bodyBuffer, counter, buf, level+1, compression)
def __handleMultipart(view, mimePart, parentMIMEContainer, bodyBuffer, counter, buf, level, compression): subtype = mimePart.get_content_subtype() multipart = mimePart.is_multipart() if verbose(): __trace("multipart/%s" % subtype, buf, level) """If the message is multipart then pass decode=False to get_poyload othe...
dirty = self._item.RDIRTY else: dirty = self._item.VDIRTY
dirty = CItem.RDIRTY else: dirty = CItem.VDIRTY
def _removeRef(self, name, other):
self._item.setDirty(dirty, name, self, True)
item.setDirty(dirty, name, self, True) item._fireChanges('remove', name)
def _removeRef(self, name, other):
self._item.setDirty(self._item.VDIRTY, name, self, True)
item.setDirty(CItem.VDIRTY, name, self, True) item._fireChanges('remove', name)
def _removeRef(self, name, other):
app = wx.GetApp()
def onFocusTogglePrivateEvent(self, event): """ Toggle the "private" attribute of all the selected items or of the items specified in the optional arguments of the event. """ selectedItems = event.arguments.get('items', self.__getSelectedItems()) if len(selectedItems) > 0: # if any item is shared, give a warning if mar...
if Util.yesNo(app.mainFrame, caption, msg):
if Util.yesNo(wx.GetApp().mainFrame, caption, msg):
def onFocusTogglePrivateEvent(self, event): """ Toggle the "private" attribute of all the selected items or of the items specified in the optional arguments of the event. """ selectedItems = event.arguments.get('items', self.__getSelectedItems()) if len(selectedItems) > 0: # if any item is shared, give a warning if mar...
stateSet = set([ item.private for item in selectedItems \ if isinstance(item, Note)])
states = [(isinstance(item, Note), getattr(item, 'private', None)) for item in selectedItems]
def onFocusTogglePrivateEventUpdateUI(self, event): selectedItems = self.__getSelectedItems() if len(selectedItems) > 0: # Collect the states of all the items, so that we can change all # the items if they're all in the same state. stateSet = set([ item.private for item in selectedItems \ if isinstance(item, Note)]) # ...
enable = len(stateSet) == 1
isNote, isPrivate = states[0] enable = isNote and len(set(states)) == 1
def onFocusTogglePrivateEventUpdateUI(self, event): selectedItems = self.__getSelectedItems() if len(selectedItems) > 0: # Collect the states of all the items, so that we can change all # the items if they're all in the same state. stateSet = set([ item.private for item in selectedItems \ if isinstance(item, Note)]) # ...
event.arguments['Check'] = item.private and enable
event.arguments['Check'] = enable and isPrivate
def onFocusTogglePrivateEventUpdateUI(self, event): selectedItems = self.__getSelectedItems() if len(selectedItems) > 0: # Collect the states of all the items, so that we can change all # the items if they're all in the same state. stateSet = set([ item.private for item in selectedItems \ if isinstance(item, Note)]) # ...
stateSet = set([ isinstance(item, stampClass) for item in selectedItems \ if isinstance(item, Note)]) assert len(stateSet) == 1 if isinstance(item, stampClass):
states = [ (isinstance(item, Note), isinstance(item, stampClass)) for item in selectedItems] isNote, isStamped = states[0] assert len(set(states)) == 1 assert isNote if isStamped:
def onFocusStampEvent(self, event): selectedItems = event.arguments.get('items', self.__getSelectedItems()) kindParam = event.kindParameter stampClass = kindParam.getItemClass() if len(selectedItems) > 0: stateSet = set([ isinstance(item, stampClass) for item in selectedItems \ if isinstance(item, Note)]) assert len(st...
stateSet = set([ isinstance(item, stampClass) for item in selectedItems \ if isinstance(item, Note)]) enable = len(stateSet) == 1
states = [ (isinstance(item, Note), isinstance(item, stampClass)) for item in selectedItems] isNote, isStamped = states[0] enable = isNote and len(set(states)) == 1
def onFocusStampEventUpdateUI(self, event): selectedItems = self.__getSelectedItems() stampClass = event.kindParameter.getItemClass() if len(selectedItems) > 0: # Collect the states of all the items, so that we can change all # the items if they're all in the same state. stateSet = set([ isinstance(item, stampClass) fo...
event.arguments['Check'] = isinstance(item, stampClass) and enable
event.arguments['Check'] = enable and isStamped
def onFocusStampEventUpdateUI(self, event): selectedItems = self.__getSelectedItems() stampClass = event.kindParameter.getItemClass() if len(selectedItems) > 0: # Collect the states of all the items, so that we can change all # the items if they're all in the same state. stateSet = set([ isinstance(item, stampClass) fo...
import version
from version import version
def onAboutEvent(self, event): # The "Help | About Chandler..." menu item """ Show the splash screen in response to the about command. """ import version html = '' for line in i18n.getHTML('about.html'): if line.find('@@buildid@@') >= 0: line = "Version: %s" % version.version html += line splash = SplashScreen(None, _(...
line = "Version: %s" % version.version
line = line.replace('@@buildid@@',version, 1)
def onAboutEvent(self, event): # The "Help | About Chandler..." menu item """ Show the splash screen in response to the about command. """ import version html = '' for line in i18n.getHTML('about.html'): if line.find('@@buildid@@') >= 0: line = "Version: %s" % version.version html += line splash = SplashScreen(None, _(...
item = iterator.next() for count in xrange (index):
try:
def __getitem__ (self, index): iterator = iter(self.results) item = iterator.next() for count in xrange (index): item = iterator.next() return item
return item
for count in xrange (index): item = iterator.next() return item except StopIteration: raise IndexError
def __getitem__ (self, index): iterator = iter(self.results) item = iterator.next() for count in xrange (index): item = iterator.next() return item
app.wxMainFrame.activeParcel = None
def OnActivate(self, event): """ The Application keeps a copy of the last persistent window openn so that the next time we run the application we can open the same window """ app = application.Application.app app.wxMainFrame = self app.wxMainFrame.activeParcel = None app.model.mainFrame = self.model event.Skip()
menuBar = app.association[id(app.model.mainFrame)].GetMenuBar () index = menuBar.FindMenu (_('View')) assert (index != wxNOT_FOUND) if menuBar.FindMenu(_('Help')) == (index + 1): menuBar.Insert (index + 1, viewerParcelMenu, self.GetMenuName()) else: oldMenu = menuBar.Replace (index + 1, viewerParcelMenu, self.GetMenuNa...
mainFrameId = id(app.model.mainFrame) if app.association.has_key(mainFrameId): menuBar = app.association[mainFrameId].GetMenuBar () index = menuBar.FindMenu (_('View')) assert (index != wxNOT_FOUND) if menuBar.FindMenu(_('Help')) == (index + 1): menuBar.Insert (index + 1, viewerParcelMenu, self.GetMenuName()) else: old...
def ReplaceViewParcelMenu(self): """ Override to customize your parcel menu. """ ignoreErrors = wxLogNull () viewerParcelMenu = self.resources.LoadMenu ('ViewerParcelMenu') del ignoreErrors if (viewerParcelMenu != None): menuBar = app.association[id(app.model.mainFrame)].GetMenuBar () index = menuBar.FindMenu (_('View'...
self.extra_data = ''
self.extra_data = None
def __init__(self, inputStream):
if len(self.extra_data) > 0: data = self.extra_data self.extra_data = ''
if self.extra_data is not None: data = self.extra_data.read(length) if len(data) > 0: return data self.extra_data.close() self.extra_data = None
def read(self, length = -1):
else: data = '' while len(data) == 0: unused_data = '' while len(data) == 0 and len(unused_data) == 0: data = self.inputStream.read(length) if len(data) == 0: return '' data = self.decompressor.decompress(data)
data = '' while len(data) == 0: unused_data = '' while len(data) == 0 and len(unused_data) == 0: raw = self.inputStream.read(length) if len(raw) == 0: return '' try: data = self.decompressor.decompress(raw) except EOFError: self.decompressor = self._decompressor() data = self.decompressor.decompress(raw) unused_data ...
def read(self, length = -1):
if len(unused_data) > 0: buffer = StringIO() buffer.write(data) while len(unused_data) > 0: self.decompressor = self._decompressor() buffer.write(self.decompressor.decompress(unused_data)) unused_data = self.decompressor.unused_data data = buffer.getvalue() buffer.close() if length > 0 and len(data) > length: self.e...
data = buffer.getvalue() buffer.close() if length > 0 and len(data) > length: self.extra_data = StringIO(data) data = self.extra_data.read(length)
def read(self, length = -1):