projects
/
gpg-migrate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8eea0db
)
Allow explicit types in PGPPacket._clean_type
author
W. Trevor King
<wking@tremily.us>
Fri, 20 Dec 2013 21:13:19 +0000
(13:13 -0800)
committer
W. Trevor King
<wking@tremily.us>
Mon, 23 Dec 2013 02:31:23 +0000
(18:31 -0800)
This will let me use it to clean the signature subpacket type for
parsing signature subpackets.
gpg-migrate.py
patch
|
blob
|
history
diff --git
a/gpg-migrate.py
b/gpg-migrate.py
index 08ba42402e36467bf1c8d70fd37196380141ec2e..515760b4a5cd29de2e68059cf95b55cbbb81705e 100755
(executable)
--- a/
gpg-migrate.py
+++ b/
gpg-migrate.py
@@
-235,8
+235,10
@@
class PGPPacket (dict):
_clean_type_regex = _re.compile('\W+')
- def _clean_type(self):
- return self._clean_type_regex.sub('_', self['type'])
+ def _clean_type(self, type=None):
+ if type is None:
+ type = self['type']
+ return self._clean_type_regex.sub('_', type)
def __str__(self):
method_name = '_str_{}'.format(self._clean_type())