Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
a486c13e
Commit
a486c13e
authored
Oct 21, 2012
by
Clément Schreiner
Browse files
parse_key_block now can take a path as an argument.
parent
1e66b886
Changes
1
Hide whitespace changes
Inline
Side-by-side
debexpo/lib/gnupg.py
View file @
a486c13e
...
...
@@ -201,17 +201,29 @@ class GnuPG(object):
else
:
return
GpgFileSignature
(
False
,
None
,
None
,
None
)
def
parse_key_block
(
self
,
data
):
def
parse_key_block
(
self
,
data
=
None
,
path
=
None
):
"""
Parse a PGP public key block
"""
(
out
,
err
,
code
)
=
self
.
_run
(
stdin
=
data
)
stdin
=
None
args
=
[]
if
data
is
not
None
:
stdin
=
data
elif
path
is
not
None
:
args
.
append
(
path
)
else
:
raise
GpgMissingData
(
out
,
err
,
code
)
=
self
.
_run
(
stdin
,
args
)
return
self
.
_parse_key_block_result
(
out
,
err
,
code
)
def
_parse_key_block_result
(
self
,
out
,
err
,
code
):
if
code
!=
0
:
return
GpgKey
(
None
,
None
)
return
GpgKey
Block
(
None
,
None
)
# FIXME: use the system's encoding instead of utf-8
out
=
unicode
(
out
,
encoding
=
'utf-8'
,
errors
=
'replace'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment