mirror of
https://git.code.sf.net/p/archivemail/code
synced 2024-12-21 23:32:54 +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:
parent
f1f34ca46e
commit
40ba265fde
1 changed files with 6 additions and 6 deletions
12
archivemail
12
archivemail
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue