Make sure all extractors get self.contents defined. trunk

Tue, 16 Sep 2008 21:51:59 -0400

author
Brett Smith <brettcsmith@brettcsmith.org>
date
Tue, 16 Sep 2008 21:51:59 -0400
branch
trunk
changeset 91
ececf7836546
parent 90
b19bdd67aa6c
child 96
4921c8e3c3f5

Make sure all extractors get self.contents defined.

self.contents was set in check_contents, which not every extractor class
needs to call. But every extractor needs to have it, since this is how we
print filenames with -v. So assign this in the extract method, which we're
guaranteed to call.

scripts/dtrx file | annotate | diff | comparison | revisions
--- a/scripts/dtrx	Sat Jul 26 13:02:53 2008 -0400
+++ b/scripts/dtrx	Tue Sep 16 21:51:59 2008 -0400
@@ -212,7 +212,6 @@
                     self.included_archives.append(os.path.join(path, filename))
 
     def check_contents(self):
-        self.contents = os.listdir('.')
         if not self.contents:
             self.content_type = EMPTY
         elif len(self.contents) == 1:
@@ -269,6 +268,7 @@
         try:
             self.archive.seek(0, 0)
             self.extract_archive()
+            self.contents = os.listdir('.')
             self.check_contents()
             self.check_success(self.content_type != EMPTY)
         except EXTRACTION_ERRORS:

mercurial