aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolaus Schulz <microschulz@web.de>2008-08-05 21:18:36 +0200
committerNikolaus Schulz <microschulz@web.de>2009-11-06 21:09:40 +0100
commitd6a161cd9e6e49e349f6bc5c4465dd0dbbf4f1ba (patch)
treea635279dccf64035c630657063508d99e0b0dac9
parentdf680c19be215c5403814bd52331f5acd012896f (diff)
downloadarchivemail-d6a161cd9e6e49e349f6bc5c4465dd0dbbf4f1ba.tar.gz
archivemail-d6a161cd9e6e49e349f6bc5c4465dd0dbbf4f1ba.tar.bz2
archivemail-d6a161cd9e6e49e349f6bc5c4465dd0dbbf4f1ba.zip
Simplify ArchiveMbox.__init__
-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):