Changeset View
Changeset View
Standalone View
Standalone View
pykolab/imap/cyrus.py
Show All 24 Lines | |||||
try: | try: | ||||
from urlparse import urlparse | from urlparse import urlparse | ||||
except ImportError: | except ImportError: | ||||
from urllib.parse import urlparse | from urllib.parse import urlparse | ||||
import pykolab | import pykolab | ||||
from pykolab import utils | |||||
from pykolab import constants | from pykolab import constants | ||||
from pykolab.imap import IMAP | from pykolab.imap import IMAP | ||||
from pykolab.translate import _ | from pykolab.translate import _ | ||||
log = pykolab.getLogger('pykolab.imap') | log = pykolab.getLogger('pykolab.imap') | ||||
conf = pykolab.getConf() | conf = pykolab.getConf() | ||||
▲ Show 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | def find_mailfolder_server(self, mailfolder): | ||||
if len(self.lm(mailfolder)) < 1 and 'hex_timestamp' in _mailfolder: | if len(self.lm(mailfolder)) < 1 and 'hex_timestamp' in _mailfolder: | ||||
mailfolder = self.folder_utf7("DELETED/%s%s%s@%s" % ( | mailfolder = self.folder_utf7("DELETED/%s%s%s@%s" % ( | ||||
self.separator.join(_mailfolder['path_parts']), | self.separator.join(_mailfolder['path_parts']), | ||||
self.separator, | self.separator, | ||||
_mailfolder['hex_timestamp'], | _mailfolder['hex_timestamp'], | ||||
_mailfolder['domain']) | _mailfolder['domain']) | ||||
) | ) | ||||
# TODO: Murder capabilities may have been suppressed using Cyrus IMAP | # TODO: Murder capabilities may have been suppressed using Cyrus IMAP | ||||
# configuration. | # configuration. | ||||
if not self.murder: | if not self.murder: | ||||
return self.server | return self.server | ||||
log.debug( | log.debug( | ||||
_("Checking actual backend server for folder %s " + | _("Checking actual backend server for folder %s " + | ||||
"through annotations") % ( | "through annotations") % ( | ||||
▲ Show 20 Lines • Show All 344 Lines • ▼ Show 20 Lines | def parse_mailfolder(self, mailfolder): | ||||
# Verify that the input for the deleted folder is actually a | # Verify that the input for the deleted folder is actually a | ||||
# deleted folder. | # deleted folder. | ||||
verify_folder_search = "%(dp)s%(sep)s%(mailfolder)s" % { | verify_folder_search = "%(dp)s%(sep)s%(mailfolder)s" % { | ||||
'dp': deleted_prefix, | 'dp': deleted_prefix, | ||||
'sep': self.separator, | 'sep': self.separator, | ||||
'mailfolder': self.separator.join(mbox['path_parts']) | 'mailfolder': self.separator.join(mbox['path_parts']) | ||||
} | } | ||||
if mbox['domain'] is not None: | if mbox['domain'] is not None: | ||||
sicherha: In the original code, double quotes are added around the string; your change removes these… | |||||
Done Inline Actions[LIST "" ""b'DELETED/shared/group/Calendar/Personal Calendar/63344406@example.org'""] BAD: bUnexpected extra arguments to List See doubled Quotes, which causes this Error ghane: [LIST "" ""b'DELETED/shared/group/Calendar/Personal Calendar/63344406@example.org'""] BAD… | |||||
verify_folder_search = "%s@%s" % ( | verify_folder_search = "%s@%s" % ( | ||||
verify_folder_search, | verify_folder_search, | ||||
mbox['domain'] | mbox['domain'] | ||||
) | ) | ||||
if ' ' in verify_folder_search: | folders = self.lm(utils.ensure_str(self.folder_utf7(verify_folder_search))) | ||||
folders = self.lm( | |||||
'"%s"' % self.folder_utf7(verify_folder_search) | |||||
) | |||||
else: | |||||
folders = self.lm(self.folder_utf7(verify_folder_search)) | |||||
# NOTE: Case also covered is valid hexadecimal folders; won't be | # NOTE: Case also covered is valid hexadecimal folders; won't be | ||||
# the actual check as intended, but doesn't give you anyone else's | # the actual check as intended, but doesn't give you anyone else's | ||||
# data unless... See the following: | # data unless... See the following: | ||||
# | # | ||||
# TODO: Case not covered is usernames that are hexadecimal. | # TODO: Case not covered is usernames that are hexadecimal. | ||||
# | # | ||||
# We could probably attempt to convert the int(hex) into a | # We could probably attempt to convert the int(hex) into a | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |
In the original code, double quotes are added around the string; your change removes these quotes. Is there a particular reason for this?