1 # Description: add and document --archive-name option
2 # Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=247340
3 # Author: Serafeim Zanikolas <serzan@hellug.gr>
4 # Last-Update: 2008-08-15
5 Index: archivemail/archivemail
6 ===================================================================
7 --- archivemail.orig/archivemail 2008-08-15 20:38:03.000000000 +0100
8 +++ archivemail/archivemail 2008-08-15 21:39:57.000000000 +0100
11 """Class to store runtime options, including defaults"""
12 archive_suffix = "_archive"
18 opts, args = getopt.getopt(args, '?D:S:Vd:hno:F:P:qs:uv',
19 ["date=", "days=", "delete", "dry-run", "help",
20 "include-flagged", "no-compress", "output-dir=",
22 "filter-append=", "pwfile=", "dont-mangle",
23 "preserve-unread", "quiet", "size=", "suffix=",
24 "verbose", "version", "warn-duplicate", "copy"])
27 if o in ('-v', '--verbose'):
29 + if o in ('--archive-name'):
30 + self.archive_name = os.path.expanduser(a)
32 if self.delete_old_mail:
33 user_error("found conflicting options --copy and --delete")
35 -P, --pwfile=FILE file to read imap password from (default: None)
36 -F, --filter-append=STRING append arbitrary string to the IMAP filter string
37 -s, --suffix=NAME suffix for archive filename (default: '%s')
38 + --archive-name=NAME specify whole archive filename, overrides prefix
40 -S, --size=NUM only archive messages NUM bytes or larger
41 -n, --dry-run don't write to anything - just show what would be done
42 -u, --preserve-unread never archive unread messages
44 final_archive_name = mailbox_name.split('/')[-1] + parsed_suffix
46 final_archive_name = mailbox_name + parsed_suffix
47 + if options.archive_name:
48 + final_archive_name = options.archive_name
49 if options.output_dir:
50 final_archive_name = os.path.join(options.output_dir,
51 os.path.basename(final_archive_name))
52 Index: archivemail/archivemail.sgml
53 ===================================================================
54 --- archivemail.orig/archivemail.sgml 2008-08-15 20:38:03.000000000 +0100
55 +++ archivemail/archivemail.sgml 2008-08-15 21:38:49.000000000 +0100
60 + <Option>--archive-name</Option>
63 +Specify whole archive filename, overrides prefix and suffix.
69 <Option>-S <Replaceable/NUM/, --size=<Replaceable/NUM/</Option>
71 <ListItem><Para>Only archive messages that are <Replaceable/NUM/ bytes or