1
0
Fork 0
mirror of https://git.code.sf.net/p/archivemail/code synced 2024-12-22 07:42:55 +00:00

Rename variables in make_archive_name()

Archive name prefixes may contain path components, thus renaming some
variables accordingly.
This commit is contained in:
Nikolaus Schulz 2010-07-31 16:43:07 +02:00
parent f1f34ca46e
commit 40ba265fde

View file

@ -1645,16 +1645,16 @@ def make_archive_name(mailbox_name):
if options.archive_suffix:
suffix = time.strftime(options.archive_suffix, tm)
if re.match(r'imaps?://', mailbox_name.lower()):
archive_dir = ""
archive_base = mailbox_name.rsplit('/', 1)[-1]
archive_head = ""
archive_tail = mailbox_name.rsplit('/', 1)[-1]
else:
archive_dir, archive_base = os.path.split(mailbox_name)
archive_head, archive_tail = os.path.split(mailbox_name)
if not prefix:
# Don't create hidden archives, e.g. when processing Maildir++ subfolders
archive_base = archive_base.lstrip('.')
archive_tail = archive_tail.lstrip('.')
if options.output_dir:
archive_dir = options.output_dir
archive_name = os.path.join(archive_dir, prefix + archive_base + suffix)
archive_head = options.output_dir
archive_name = os.path.join(archive_head, prefix + archive_tail + suffix)
return archive_name
def check_sane_destdir(dir):