aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xarchivemail.py20
1 files changed, 5 insertions, 15 deletions
diff --git a/archivemail.py b/archivemail.py
index d2d07ca..2bb4bc9 100755
--- a/archivemail.py
+++ b/archivemail.py
@@ -535,23 +535,13 @@ class ArchiveMbox(Mbox):
"""
assert(final_name)
if options.no_compress:
- self.__init_uncompressed()
+ temp_name = tempfile.mkstemp("archive")[1]
+ self.mbox_file = open(temp_name, "w")
else:
- self.__init_compressed()
- self.__final_name = final_name
-
- def __init_uncompressed(self):
- """Used internally by __init__ when archives are uncompressed"""
- temp_name = tempfile.mkstemp("archive")[1]
- _stale.archive = temp_name
- self.mbox_file = open(temp_name, "w")
- self.mbox_file_name = temp_name
-
- def __init_compressed(self):
- """Used internally by __init__ when archives are compressed"""
- temp_name = tempfile.mkstemp("archive.gz")[1]
+ temp_name = tempfile.mkstemp("archive.gz")[1]
+ self.mbox_file = gzip.GzipFile(temp_name, "w")
_stale.archive = temp_name
- self.mbox_file = gzip.GzipFile(temp_name, "w")
+ self.__final_name = final_name
self.mbox_file_name = temp_name
def finalise(self):