[mhonarc] rename olddir to archivedir



commit b446f7ab49c5ef4b1bbadd4addb95d10280b61a8
Author: Olav Vitters <olav vitters nl>
Date:   Tue Feb 12 21:28:26 2013 +0100

    rename olddir to archivedir

 archive.py |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/archive.py b/archive.py
index 0e580eb..d76b947 100755
--- a/archive.py
+++ b/archive.py
@@ -48,16 +48,20 @@ class Archiver:
         self.start_time = None
         self.end_time = None
 
-        self.olddir = None
+        self.archivepath = None
         self.tmpfile = None
 
         self.start_time = None
         self.end_time = None
 
     def output(self, last):
+        if self.archivepath is None:
+            return False
+
+
         tmpname = self.tmpname
 
-        path = os.path.join(self.PRIVATE_ARCHIVE_DIR, self.listname, self.olddir)
+        path = os.path.join(self.PRIVATE_ARCHIVE_DIR, self.listname, self.archivepath)
 
         if not os.path.exists(path):
             os.makedirs(path, 0755)
@@ -67,7 +71,7 @@ class Archiver:
         # Call mhonarc for all messages in 'tmpfile'
         with open(self.ERRORLOG, "a") as error_fd:
             cmd = ['mhonarc', '-umask', '022', '-rcfile', rcfile, '-add', '-output', path, tmpname,
-                              '-definevar', 'ARCHDATE=%s LISTNAME=%s' % (self.olddir, self.listname)]
+                              '-definevar', 'ARCHDATE=%s LISTNAME=%s' % (self.archivepath, self.listname)]
 
             #subprocess.call(cmd, stdout=error_fd, stderr=subprocess.STDOUT)
 
@@ -132,11 +136,10 @@ class Archiver:
 
         # mhonarc can archive multiple emails at once, so only run mhonarc
         # once output path changes
-        if self.olddir is not None and self.olddir != path:
-            # XXX wtf
+        if self.archivepath is not None and self.archivepath != path:
             self.output(False)
 
-        self.olddir = path
+        self.archivepath = path
         self.last_time = received_time
         self.last_parseable_time = received_time_text
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]