Add PGPPacket._compression_algorithms
authorW. Trevor King <wking@tremily.us>
Fri, 20 Dec 2013 05:16:05 +0000 (21:16 -0800)
committerW. Trevor King <wking@tremily.us>
Fri, 20 Dec 2013 18:56:23 +0000 (10:56 -0800)
From RFC 4880 [1]:

       ID           Algorithm
       --           ---------
       0          - Uncompressed
       1          - ZIP [RFC1951]
       2          - ZLIB [RFC1950]
       3          - BZip2 [BZ2]
       100 to 110 - Private/Experimental algorithm

[1]: http://tools.ietf.org/search/rfc4880#section-9.3

gpg-migrate.py

index 6f49ad75d7a012d31181dca071e7979b04706ff6..401b69601a4f725fc7ac753356e54e18ddbbdb4d 100755 (executable)
@@ -99,6 +99,24 @@ class PGPPacket (dict):
         110: 'private',
         }
 
+    _compression_algorithms = {
+        0: 'uncompressed',
+        1: 'zip',
+        2: 'zlib',
+        3: 'bzip2',
+        100: 'private',
+        101: 'private',
+        102: 'private',
+        103: 'private',
+        104: 'private',
+        105: 'private',
+        106: 'private',
+        107: 'private',
+        108: 'private',
+        109: 'private',
+        110: 'private',
+        }
+
     _clean_type_regex = _re.compile('\W+')
 
     def _clean_type(self):