]> Frank Brehm's Git Trees - pixelpark/trace-maillog.git/commitdiff
Adding class property in lib/trace_maillog/any_uncompress_file.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 11 May 2017 10:35:35 +0000 (12:35 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 11 May 2017 10:35:35 +0000 (12:35 +0200)
.gitattribute [new file with mode: 0644]
lib/trace_maillog/any_uncompress_file.py

diff --git a/.gitattribute b/.gitattribute
new file mode 100644 (file)
index 0000000..3956954
--- /dev/null
@@ -0,0 +1 @@
+*.py   ident  
index 584064e7760ab762461071544fd9b3ce2806d22f..3296dbe6d80f6e1bb575f01ded9bd1b299497a58 100644 (file)
@@ -5,6 +5,7 @@
 @contact: frank.brehm@pixelpark.com
 @copyright: © 2017 by Frank Brehm, Berlin
 @summary: The module for a AnyUmpressFile class
+$Id: $
 """
 from __future__ import absolute_import
 
@@ -30,7 +31,7 @@ except ImportError:
 # Third party modules
 import six
 
-__version__ = '0.1.0'
+__version__ = '0.2.0'
 
 
 # =============================================================================
@@ -62,7 +63,59 @@ class InvalidCompressionError(BaseAnyUncompressError, NotImplementedError):
 # =============================================================================
 class AnyUmpressFile(object):
 
-    pass
+    compression_types = {
+        '7z': {
+            'mime_types': ('application/x-7z-compressed', ),
+            'supported': False,
+            'method': None,
+        },
+        'bz2': {
+            'mime_types': ('application/x-bzip2', ),
+            'supported': False,
+            'method': None,
+        },
+        'compress': {
+            'mime_types': ('application/x-compress', ),
+            'supported': False,
+            'method': None,
+        },
+        'gzip': {
+            'mime_types': ('application/gzip', 'application/x-gzip'),
+            'supported': True,
+            'method': None,
+        }
+        'lz4': {
+            'mime_types': ('application/x-lz4', ),
+            'supported': False,
+            'method': None,
+        },
+        'lzma': {
+            'mime_types': ('application/x-lzma', ),
+            'supported': False,
+            'method': None,
+        },
+        'rar': {
+            'mime_types': ('application/x-rar', ),
+            'supported': False,
+            'method': None,
+        },
+        'xz': {
+            'mime_types': ('application/x-xz', ),
+            'supported': False,
+            'method': None,
+        },
+        'zip': {
+            'mime_types': ('application/zip', ),
+            'supported': False,
+            'method': None,
+        },
+    }
+
+    # -------------------------------------------------------------------------
+    def __init__(self, fh, compress_type=None):
+
+        self.fh = fh
+        self.compress_type = compress_type
 
 
 # =============================================================================