From: SourceForge.net <no...@so...> - 2008-03-16 02:30:38
|
Patches item #1764846, was opened at 2007-07-31 21:19 Message generated for change (Comment added) made by nikosch You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=456912&aid=1764846&group_id=49630 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nikolaus Schulz (nikosch) Summary: Option to archive all available mail Initial Comment: Hi, thanks for working on archivemail. I think an option --archive-all would be useful. Attached is a patch, that would add that option and archive all available mails. ---------------------------------------------------------------------- >Comment By: Nikolaus Schulz (nikosch) Date: 2008-03-16 03:30 Message: Logged In: YES user_id=1594781 Originator: NO This idea has cropped up again in the Debian BTS. The next archivemail release will have an --all option, as requested. ---------------------------------------------------------------------- Comment By: Christian (chrisbra) Date: 2007-11-13 23:39 Message: Logged In: YES user_id=1928606 Originator: NO ok, whatever you like more is fine with me. Christian ---------------------------------------------------------------------- Comment By: Nikolaus Schulz (nikosch) Date: 2007-11-05 22:03 Message: Logged In: YES user_id=1594781 Originator: NO That's interesting. I don't know why, but I really didn't consider your approach; I have a different, "optimized" implementation of --archive-all. I'm attaching the patch; it applies against the current trunk. Actually I'm not sure which of the two patches is cleaner. Or should I say "less unclean"? Well. Perhaps I should postpone this decision for the v0.7.1 release. Nikolaus File Added: archivemail-all-optim.diff ---------------------------------------------------------------------- Comment By: Christian (chrisbra) Date: 2007-11-03 13:55 Message: Logged In: YES user_id=1928606 Originator: NO Hi, sorry, I must have made a mistake when submitting the patch. But if it is true, that --archive-all will be the same as --days=0 and --include-flagged, then the following patch should achieve it (against 0.7.0): --- archivemail.orig 2007-11-03 13:36:10.000000000 +0100 +++ archivemail.all 2007-11-03 13:35:55.000000000 +0100 @@ -201,7 +201,7 @@ """ try: opts, args = getopt.getopt(args, '?D:S:Vd:hno:F:P:qs:uv', - ["date=", "days=", "delete", "dry-run", "help", + ["archive-all", "date=", "days=", "delete", "dry-run", "help", "include-flagged", "no-compress", "output-dir=", "filter-append=", "pwfile=", "dont-mangle", "archive-name=", @@ -213,6 +213,13 @@ archive_by = None for o, a in opts: + if o == '--archive-all': + if archive_by: + user_error("you cannot specify --archive-all and -d or -D options") + archive_by = "all" + self.archive_all = 1 + self.days_old_max = 0 + self.include_flagged = 1 if o == '--delete': self.delete_old_mail = 1 if o == '--include-flagged': @@ -223,12 +230,12 @@ self.warn_duplicates = 1 if o in ('-D', '--date'): if archive_by: - user_error("you cannot specify both -d and -D options") + user_error("you cannot specify --archive-all and -d or -D options") archive_by = "date" self.date_old_max = self.date_argument(a) if o in ('-d', '--days'): if archive_by: - user_error("you cannot specify both -d and -D options") + user_error("you cannot specify --archive-all and -d or -D options") archive_by = "days" self.days_old_max = string.atoi(a) if o in ('-o', '--output-dir'): @@ -647,6 +654,7 @@ mailbox compressed with gzip. Options are as follows: + --archive-all archive all messages -d, --days=NUM archive messages older than NUM days (default: %d) -D, --date=DATE archive messages older than DATE -o, --output-dir=DIR directory to store archives (default: same as original) regards, Christian ---------------------------------------------------------------------- Comment By: Nikolaus Schulz (nikosch) Date: 2007-11-01 13:57 Message: Logged In: YES user_id=1594781 Originator: NO archivemail 0.7.1 will accept --days=0. Add --include-flagged, and you get the same effect. Still, I think a shortcut like --archive-all can be handy. The patch is incomplete, however, it only covers IMAP. Nikolaus ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=456912&aid=1764846&group_id=49630 |