- Revision
- 15929
- Author
- john
- Date
- 2007-11-27 16:07:41 -0800 (Tue, 27 Nov 2007)
Log Message
Merge trunk revision #15874 to #15924 into recorded scripts branch
Modified Paths
- branches/recorded_scripts/chandler/Makefile
- branches/recorded_scripts/chandler/WingMacDebug.wpr
- branches/recorded_scripts/chandler/application/Application.py
- branches/recorded_scripts/chandler/application/dialogs/AccountPreferences.py
- branches/recorded_scripts/chandler/application/dialogs/AccountPreferences.xrc
- branches/recorded_scripts/chandler/application/dialogs/AccountPreferencesDialogs.py
- branches/recorded_scripts/chandler/application/dialogs/DeleteDialog.xrc
- branches/recorded_scripts/chandler/application/dialogs/PublishCollection.xrc
- branches/recorded_scripts/chandler/application/dialogs/PublishFreeBusy.xrc
- branches/recorded_scripts/chandler/application/dialogs/RestoreShares.xrc
- branches/recorded_scripts/chandler/application/dialogs/SubscribeCollection.py
- branches/recorded_scripts/chandler/parcels/osaf/framework/blocks/calendar/MultiWeek.py
- branches/recorded_scripts/chandler/parcels/osaf/framework/certstore/ssl.py
- branches/recorded_scripts/chandler/parcels/osaf/mail/constants.py
- branches/recorded_scripts/chandler/parcels/osaf/mail/imap.py
- branches/recorded_scripts/chandler/parcels/osaf/messages.py
- branches/recorded_scripts/chandler/parcels/osaf/pim/stamping.txt
- branches/recorded_scripts/chandler/parcels/osaf/sharing/__init__.py
- branches/recorded_scripts/chandler/parcels/osaf/sharing/utility.py
- branches/recorded_scripts/chandler/parcels/osaf/sharing/webdav_conduit.py
- branches/recorded_scripts/chandler/parcels/osaf/views/main/menus.py
- branches/recorded_scripts/chandler/util/task.py
Diff
Modified: branches/recorded_scripts/chandler/Makefile (15928 => 15929)
--- branches/recorded_scripts/chandler/Makefile 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/Makefile 2007-11-28 00:07:41 UTC (rev 15929) @@ -106,7 +106,7 @@ ARCHIVES = \ $(CHANDLERARCHIVES)/Launchers-$(SNAP)-0.9-$(BP)30.tar.gz \ - $(CHANDLERARCHIVES)/chandlerdb-$(SNAP)-0.7-$(BP)29.tar.gz \ + $(CHANDLERARCHIVES)/chandlerdb-$(SNAP)-0.7-$(BP)30.tar.gz \ $(CHANDLERARCHIVES)/db-$(SNAP)-4.6.21-$(BP)2.tar.gz \ $(READLINE) \ $(PYTHON) \
Modified: branches/recorded_scripts/chandler/WingMacDebug.wpr (15928 => 15929)
--- branches/recorded_scripts/chandler/WingMacDebug.wpr 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/WingMacDebug.wpr 2007-11-28 00:07:41 UTC (rev 15929) @@ -4,9 +4,10 @@ # Wing IDE project file # ################################################################## [project attributes] -debug.run-args = {loc('Chandler.py'): '--catch=never --stderr'} +debug.run-args = {loc('Chandler.py'): '--catch=never --stderr --create'} proj.directory-list = [{'dirloc': loc('.'), - 'excludes': (), + 'excludes': [u'release', + u'debug'], 'filter': '*', 'include_hidden': 0, 'recursive': 1,
Modified: branches/recorded_scripts/chandler/application/Application.py (15928 => 15929)
--- branches/recorded_scripts/chandler/application/Application.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/application/Application.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -1010,7 +1010,8 @@ # crashes app self.spawnNewChandler(self.CHANDLER_RESTART_ARGS) - def shutdown(self, repositoryCheck=True, repositoryCheckPoint=True): + def shutdown(self, repositoryCheck=True, repositoryCheckPoint=True, + restarting=False): """ Shuts down Chandler Services and the Repository. @@ -1047,8 +1048,9 @@ # Optionally save a backup.chex so that automatic migration will work # Do not backup when running tests to save time; also prevents - # the dialog from stopping tests - if Globals.options.catch in ('tests', 'never'): + # the dialog from stopping tests. + # There's also no reason to export if we are restarting. + if Globals.options.catch in ('tests', 'never') or restarting: backup = False else: prefs = schema.ns("osaf.app", @@ -1089,9 +1091,13 @@ displayInfoWhileProcessing (_(u"Checking repository..."), self.UIRepositoryView.check) - displayInfoWhileProcessing (_(u"Shutting down mail service..."), - Globals.mailService.shutdown) + if Globals.mailService is not None: + # Ensure that the Globals.mailService has been initialized before + # calling shutdown. + displayInfoWhileProcessing (_(u"Shutting down mail service..."), + Globals.mailService.shutdown) + displayInfoWhileProcessing (_(u"Stopping wakeup service..."), Utility.stopWakeup) @@ -1216,7 +1222,8 @@ # Shutdown the application service layers # and do not perform any repository # checking or checkpointing. - self.shutdown(repositoryCheck=False, repositoryCheckPoint=False) + self.shutdown(repositoryCheck=False, repositoryCheckPoint=False, + restarting=True) def spawnNewChandler(self, argv): windows = os.name == 'nt'
Modified: branches/recorded_scripts/chandler/application/dialogs/AccountPreferences.py (15928 => 15929)
--- branches/recorded_scripts/chandler/application/dialogs/AccountPreferences.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/application/dialogs/AccountPreferences.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -66,22 +66,24 @@ # --- Yes No Dialog Messages ----- # CREATE_FOLDERS_TITLE = _(u"Configure Chandler Folders") + CREATE_FOLDERS = _(u"""Chandler will attempt to create the following IMAP folders in your account on '%(host)s': - Chandler Events - Chandler Mail - Chander Tasks + %(ChandlerMailFolder)s + %(ChandlerTasksFolder)s + %(ChandlerEventsFolder)s If you have already set up Chandler folders in your account, no new folders will be created. Folders may take a while to show up in your email application.""") + REMOVE_FOLDERS_TITLE = _(u"Remove Chandler Folders") REMOVE_FOLDERS = _(u"""Chandler will now attempt to remove the following IMAP folders on '%(host)s': - Chandler Mail - Chander Tasks - Chandler Events + %(ChandlerMailFolder)s + %(ChandlerTasksFolder)s + %(ChandlerEventsFolder)s Would you like to proceed?""") @@ -1564,14 +1566,24 @@ if create: config = showConfigureDialog(CREATE_FOLDERS_TITLE, - CREATE_FOLDERS % {'host': account.host}, + CREATE_FOLDERS % { + "host": account.host, + "ChandlerMailFolder": constants.CHANDLER_MAIL_FOLDER, + "ChandlerTasksFolder": constants.CHANDLER_TASKS_FOLDER, + "ChandlerEventsFolder": constants.CHANDLER_EVENTS_FOLDER, + }, self) if config: ChandlerIMAPFoldersDialog(self, account, self.OnFolderCreation) else: yes = showYesNoDialog(REMOVE_FOLDERS_TITLE, - REMOVE_FOLDERS % {'host': account.host}, + REMOVE_FOLDERS % { + "host": account.host, + "ChandlerMailFolder": constants.CHANDLER_MAIL_FOLDER, + "ChandlerTasksFolder": constants.CHANDLER_TASKS_FOLDER, + "ChandlerEventsFolder": constants.CHANDLER_EVENTS_FOLDER, + }, self) if yes:
Modified: branches/recorded_scripts/chandler/application/dialogs/AccountPreferences.xrc (15928 => 15929)
--- branches/recorded_scripts/chandler/application/dialogs/AccountPreferences.xrc 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/application/dialogs/AccountPreferences.xrc 2007-11-28 00:07:41 UTC (rev 15929) @@ -138,7 +138,7 @@ <object class="wxRadioButton" name="OUTGOING_SECURE_NO"> <value>1</value> <style>wxRB_GROUP</style> - <label>None</label> + <label>No Security</label> </object> </object> <object class="sizeritem"> @@ -423,7 +423,7 @@ <object class="wxRadioButton" name="INCOMING_SECURE_NO"> <value>1</value> <style>wxRB_GROUP</style> - <label>None</label> + <label>No Security</label> </object> </object> <object class="sizeritem"> @@ -991,7 +991,6 @@ <object class="sizeritem"> <flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag> <object class="wxButton" name="wxID_OK"> - <label>OK</label> <default>1</default> </object> </object> @@ -1001,7 +1000,6 @@ <object class="sizeritem"> <flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag> <object class="wxButton" name="wxID_CANCEL"> - <label>Cancel</label> </object> </object> </object>
Modified: branches/recorded_scripts/chandler/application/dialogs/AccountPreferencesDialogs.py (15928 => 15929)
--- branches/recorded_scripts/chandler/application/dialogs/AccountPreferencesDialogs.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/application/dialogs/AccountPreferencesDialogs.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -238,15 +238,19 @@ return _(u"""\ The following folders have been created in your account: -Chandler Mail - Add messages to this folder to add them to your Mail Dashboard. +%(ChandlerMailFolder)s - Add messages to this folder to add them to your Mail Dashboard. -Chandler Tasks - Add messages to this folder to add them to your Tasks Dashboard. +%(ChandlerTasksFolder)s - Add messages to this folder to add them to your Tasks Dashboard. -Chandler Events - Add messages to this folder to add them to your Calendar Dashboard. Chandler will do its best to makes sense of any date and time information in the message. +%(ChandlerEventsFolder)s - Add messages to this folder to add them to your Calendar Dashboard. Chandler will do its best to makes sense of any date and time information in the message. All messages added to Chandler folders will show up in your All Dashboard. -Note: Chandler folders may take a while to appear in your email application.""") +Note: Chandler folders may take a while to appear in your email application.""") % { + "ChandlerMailFolder": constants.CHANDLER_MAIL_FOLDER, + "ChandlerTasksFolder": constants.CHANDLER_TASKS_FOLDER, + "ChandlerEventsFolder": constants.CHANDLER_EVENTS_FOLDER, + } else: return _(u"You have already set up Chandler folders in this account. No new folders were created.")
Modified: branches/recorded_scripts/chandler/application/dialogs/DeleteDialog.xrc (15928 => 15929)
--- branches/recorded_scripts/chandler/application/dialogs/DeleteDialog.xrc 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/application/dialogs/DeleteDialog.xrc 2007-11-28 00:07:41 UTC (rev 15929) @@ -38,7 +38,6 @@ <object class="sizeritem"> <flag>wxALL|wxALIGN_CENTRE|wxALIGN_CENTRE_VERTICAL</flag> <object class="wxButton" name="wxID_OK"> - <label>OK</label> <default>1</default> </object> <border>5</border> @@ -53,7 +52,6 @@ <object class="sizeritem"> <flag>wxALL|wxALIGN_CENTRE|wxALIGN_CENTRE_VERTICAL</flag> <object class="wxButton" name="wxID_CANCEL"> - <label>Cancel</label> <default>1</default> </object> <border>5</border>
Modified: branches/recorded_scripts/chandler/application/dialogs/PublishCollection.xrc (15928 => 15929)
--- branches/recorded_scripts/chandler/application/dialogs/PublishCollection.xrc 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/application/dialogs/PublishCollection.xrc 2007-11-28 00:07:41 UTC (rev 15929) @@ -318,7 +318,6 @@ <flag>wxALIGN_CENTER|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_CANCEL"> - <label>Cancel</label> </object> </object> </object> @@ -354,7 +353,6 @@ <flag>wxALIGN_CENTER|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_CANCEL"> - <label>Cancel</label> </object> </object> </object> @@ -395,7 +393,6 @@ <flag>wxALIGN_CENTER|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_OK"> - <label>OK</label> <default>1</default> </object> </object> @@ -403,7 +400,6 @@ <flag>wxALIGN_CENTER|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_CANCEL"> - <label>Cancel</label> </object> </object> </object> @@ -431,7 +427,6 @@ <flag>wxALIGN_CENTER|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_CANCEL"> - <label>Cancel</label> <default>1</default> </object> </object>
Modified: branches/recorded_scripts/chandler/application/dialogs/PublishFreeBusy.xrc (15928 => 15929)
--- branches/recorded_scripts/chandler/application/dialogs/PublishFreeBusy.xrc 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/application/dialogs/PublishFreeBusy.xrc 2007-11-28 00:07:41 UTC (rev 15929) @@ -72,7 +72,6 @@ <flag>wxALIGN_CENTER|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_CANCEL"> - <label>Cancel</label> </object> </object> </object> @@ -99,7 +98,6 @@ <flag>wxALIGN_CENTER|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_CANCEL"> - <label>Cancel</label> <default>1</default> </object> </object>
Modified: branches/recorded_scripts/chandler/application/dialogs/RestoreShares.xrc (15928 => 15929)
--- branches/recorded_scripts/chandler/application/dialogs/RestoreShares.xrc 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/application/dialogs/RestoreShares.xrc 2007-11-28 00:07:41 UTC (rev 15929) @@ -60,7 +60,6 @@ <flag>wxALIGN_CENTER|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_CANCEL"> - <label>Cancel</label> </object> </object> </object>
Modified: branches/recorded_scripts/chandler/application/dialogs/SubscribeCollection.py (15928 => 15929)
--- branches/recorded_scripts/chandler/application/dialogs/SubscribeCollection.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/application/dialogs/SubscribeCollection.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -146,7 +146,7 @@ # Put this collection into "My items" if not checked: if not self.checkboxKeepOut.GetValue() or self.mine: logger.info(_(u'Moving collection into Dashboard...')) - schema.ns('osaf.pim', taskView.view).mine.addSource(collection) + schema.ns('osaf.pim', self.taskView).mine.addSource(collection) schema.ns("osaf.app", self.taskView).sidebarCollection.add(collection)
Modified: branches/recorded_scripts/chandler/parcels/osaf/framework/blocks/calendar/MultiWeek.py (15928 => 15929)
--- branches/recorded_scripts/chandler/parcels/osaf/framework/blocks/calendar/MultiWeek.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/parcels/osaf/framework/blocks/calendar/MultiWeek.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -31,6 +31,7 @@ from osaf.pim.calendar import formatTime, shortTZ from osaf.framework.blocks.DrawingUtilities import DrawClippedText +from osaf.framework.blocks.Block import BaseWidget import math, bisect @@ -164,7 +165,7 @@ self.bounds = None self.eventsAndBounds = None -class wxMultiWeekCanvas(wxCalendarCanvas): +class wxMultiWeekCanvas(BaseWidget, wxCalendarCanvas): """ Ancestry: wxCollectionCanvas --> wxCalendarCanvas --> wxMultiWeekCanvas
Modified: branches/recorded_scripts/chandler/parcels/osaf/framework/certstore/ssl.py (15928 => 15929)
--- branches/recorded_scripts/chandler/parcels/osaf/framework/certstore/ssl.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/parcels/osaf/framework/certstore/ssl.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -332,7 +332,7 @@ e.pem = peerX509.as_pem() acceptedErrList = trusted_until_shutdown_invalid_site_certs.get(e.pem) - err = messages.SSL_HOST_MISMATCH % {'expectedHost': e.expectedHost, 'actualHost': e.actualHost} + err = messages.SSL_HOST_MISMATCH % {'actualHost': e.actualHost} if acceptedErrList is not None and err in acceptedErrList: if __debug__: log.debug('Ignoring post connection error %s' % err)
Modified: branches/recorded_scripts/chandler/parcels/osaf/mail/constants.py (15928 => 15929)
--- branches/recorded_scripts/chandler/parcels/osaf/mail/constants.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/parcels/osaf/mail/constants.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -24,9 +24,13 @@ CHANDLER_USERAGENT = "Chandler (%s)" % version.version CHANDLER_HEADER_PREFIX = "X-Chandler-" -CHANDLER_MAIL_FOLDER = _(u"Chandler Mail") -CHANDLER_TASKS_FOLDER = _(u"Chandler Tasks") -CHANDLER_EVENTS_FOLDER = _(u"Chandler Events") +#XXX For 0.7.3 the Chandler IMAP Folders will not +# be localized since there are potential issues +# when switching languages. For information see +# bug 11430. +CHANDLER_MAIL_FOLDER = u"Chandler Mail" +CHANDLER_TASKS_FOLDER = u"Chandler Tasks" +CHANDLER_EVENTS_FOLDER = u"Chandler Events" INVALID_EMAIL_ADDRESS = _(u"Email Address %(emailAddress)s is not valid.")
Modified: branches/recorded_scripts/chandler/parcels/osaf/mail/imap.py (15928 => 15929)
--- branches/recorded_scripts/chandler/parcels/osaf/mail/imap.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/parcels/osaf/mail/imap.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -377,12 +377,15 @@ e = constants.CHANDLER_EVENTS_FOLDER status = { - #pos 0: The Unicode name of the folder on the IMAP Server + #pos 0: The Unicode name of the folder on the IMAP Server. + # The values in m, t, and e are of type i18n.Message. + # They need to be converted to Unicode to be saved in + # the IMAPFolder.folderName attribute of type schema.Text. #pos 1: Boolean whether to folder exists on the server already #pos 2: Boolean whether the folder is currently subscribe to already - m: [m, False, False], - t: [t, False, False], - e: [e, False, False] + m: [unicode(m), False, False], + t: [unicode(t), False, False], + e: [unicode(e), False, False] } d = self.proto.list("", "INBOX")
Modified: branches/recorded_scripts/chandler/parcels/osaf/messages.py (15928 => 15929)
--- branches/recorded_scripts/chandler/parcels/osaf/messages.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/parcels/osaf/messages.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -75,5 +75,5 @@ ACCOUNT = _(u"%(accountName)s Account") # SSL -SSL_HOST_MISMATCH = _(u'Peer certificate does not match host. Chandler expected %(expectedHost)s and got %(actualHost)s instead.') +SSL_HOST_MISMATCH = _(u'Peer certificate does not match host, got %(actualHost)s')
Modified: branches/recorded_scripts/chandler/parcels/osaf/pim/stamping.txt (15928 => 15929)
--- branches/recorded_scripts/chandler/parcels/osaf/pim/stamping.txt 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/parcels/osaf/pim/stamping.txt 2007-11-28 00:07:41 UTC (rev 15929) @@ -206,7 +206,7 @@ >>> StampWithInitialValue(item).fun Traceback (most recent call last): ... -AttributeError: __builtin__.StampWithInitialValue.fun +NoValueForAttributeError: ...__builtin__.StampWithInitialValue.fun... >>> StampWithInitialValue(item).add() >>> StampWithInitialValue(item).fun u'Go have some fun'
Modified: branches/recorded_scripts/chandler/parcels/osaf/sharing/__init__.py (15928 => 15929)
--- branches/recorded_scripts/chandler/parcels/osaf/sharing/__init__.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/parcels/osaf/sharing/__init__.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -606,7 +606,7 @@ account.username = username waitForDeferred(account.password.encryptPassword(password)) - # update shareName if it's a subscollection in the account + # update shareName if it's a subcollection in the account if account.path.strip("/") != parentPath.strip("/"): # account path: "a/b", parent path: "a/b/c", tail will be "c" tail = parentPath.strip("/")[len(account.path.strip("/"))+1:] @@ -858,10 +858,10 @@ share = Share(itsView=view) - if not account and not ticket and username: - (scheme, useSSL, host, port, path, query, fragment, ticket, parentPath, - shareName) = splitUrl(url) + (scheme, useSSL, host, port, ignore, query, ignore, ignore, ignore, + ignore) = splitUrl(url) + if not account and not ticket and username: # Create a new account account = WebDAVAccount(itsView=view) account.displayName = url @@ -894,14 +894,10 @@ ) if query: share.conduit.shareName += "?%s" % query - if ticket: - share.conduit.ticket = ticket - if username: - share.conduit.username = username - if password: - share.conduit.password = Password(itsParent=share.conduit) - waitForDeferred(share.conduit.password.encryptPassword(password)) + # Not setting share.conduit.ticket here because we'll just include it + # in the URL during get/put + share.mode = "both" if inspection['priv:write'] else "get" if filters: share.conduit.filters = filters
Modified: branches/recorded_scripts/chandler/parcels/osaf/sharing/utility.py (15928 => 15929)
--- branches/recorded_scripts/chandler/parcels/osaf/sharing/utility.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/parcels/osaf/sharing/utility.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -97,6 +97,10 @@ if code == MergeError.DELETE: return True + if code == MergeError.ALIAS: + key, currentKey, alias = value + logger.warning("While merging attribute '%s' on %s, an alias conflict for key %s was detected: %s is set to the same alias: '%s'", attribute, item._repr_(), key, currentKey, alias) + return alias + '_duplicate' return value # Change from *this* view wins
Modified: branches/recorded_scripts/chandler/parcels/osaf/sharing/webdav_conduit.py (15928 => 15929)
--- branches/recorded_scripts/chandler/parcels/osaf/sharing/webdav_conduit.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/parcels/osaf/sharing/webdav_conduit.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -205,7 +205,7 @@ raise errors.NotFound(_(u"Path %(path)s not found.") % {'path': shareCollection.path}) if e.status == twisted.web.http.UNAUTHORIZED: - raise errors.NotAllowed(_(u"Not authorized to get %(path)s.") % {'path': shareCollection.path}) + raise errors.NotAllowed(_(u"Not authorized to GET %(path)s.") % {'path': shareCollection.path}) raise errors.SharingError(_(u"Sharing Error: %(error)s.") % {'error': e}) @@ -429,6 +429,7 @@ return stats + def get(self): handle = self._getServerHandle() @@ -460,16 +461,35 @@ etag = resp.headers.getHeader('ETag') if etag: # etag is a zanshin.http.ETag object self.etag = etag.tag + return text + def put(self, text): - # TODO: honor etags - resource = self._resourceFromPath("") + handle = self._getServerHandle() + + path = self._getSharePath() + if path == "/": + path = "" + path = "/".join([path, self.shareName]) + + if self.etag: + extraHeaders = { 'If-Match' : self.etag } + else: + extraHeaders = { } + start = time.time() - resp = self._getServerHandle().blockUntil(resource.put, text, - checkETag=False) + resp = handle.blockUntil(handle.put, path, text, + extraHeaders=extraHeaders) end = time.time() self.networkTime += (end - start) - if resource.etag is not None: - self.etag = resource.etag + if not (200 <= resp.status < 300): + raise errors.SharingError("%s (HTTP status %d)" % (resp.message, + resp.status), + details="Received [%s]" % resp.body) + + etag = resp.headers.getHeader('ETag') + if etag: # etag is a zanshin.http.ETag object + self.etag = etag.tag +
Modified: branches/recorded_scripts/chandler/parcels/osaf/views/main/menus.py (15928 => 15929)
--- branches/recorded_scripts/chandler/parcels/osaf/views/main/menus.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/parcels/osaf/views/main/menus.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -244,7 +244,7 @@ ]), # Menu OfflineMenu MenuItem.template('SyncManagerItem', event = main.SyncManager, - title = _(u'Sync Manager...'), + title = _(u'Sync &Manager...'), helpString = _(u'Open the Sync Manager dialog')), MenuItem.template('FileSeparator4', menuItemKind = 'Separator'),
Modified: branches/recorded_scripts/chandler/util/task.py (15928 => 15929)
--- branches/recorded_scripts/chandler/util/task.py 2007-11-28 00:03:54 UTC (rev 15928) +++ branches/recorded_scripts/chandler/util/task.py 2007-11-28 00:07:41 UTC (rev 15929) @@ -96,13 +96,6 @@ def _success(self, result): - def mergeFunction(code, item, attribute, value): - if code == MergeError.ALIAS: - key, currentKey, alias = value - logger.warning("While merging attribute '%s' on %s, an alias conflict for key %s was detected: %s is set to the same alias: '%s'", attribute, item._repr_(), key, currentKey, alias) - return alias + '_duplicate' - raise NotImplementedError, (code, attribute, value) - if self.view is not None: - self.view.commit(mergeFunction) + self.view.commit(sharing.mergeFunction) self.callInMainThread(self.success, result, done=True)
_______________________________________________ Commits mailing list [email protected] http://lists.osafoundation.org/mailman/listinfo/commits
