Skip to content

Commit fcedea7

Browse files
committed
Added capability to subkey_info, reformatted code.
1 parent eca04eb commit fcedea7

File tree

5 files changed

+49
-33
lines changed

5 files changed

+49
-33
lines changed

.flake8

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[flake8]
2+
max-line-length=120
3+
ignore =
4+
E731
5+
W504
6+
7+
exclude =
8+
build
9+
.tox
10+
11+
per-file-ignores =
12+
docs/conf.py:E265,E401,E402

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ Released: Not yet
7979

8080
* Fix #261: Ensure fingerprint and keygrip are added to subkey_info.
8181

82+
* Set username in the result when Verify uses a signing key that has expired or been
83+
revoked. Thanks to Steven Galgano for the patch.
84+
8285
0.5.5
8386
-----
8487

docs/conf.py

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,18 @@
2222

2323
# Add any Sphinx extension module names here, as strings. They can be extensions
2424
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
25-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx',
26-
'sphinx.ext.todo', 'sphinx.ext.coverage',
27-
#'sphinx.ext.napoleon',
28-
#'sphinx.ext.imgmath',
29-
'sphinx.ext.ifconfig', 'sphinx.ext.viewcode',
30-
'sphinxcontrib.spelling']
25+
extensions = [
26+
'sphinx.ext.autodoc',
27+
'sphinx.ext.doctest',
28+
'sphinx.ext.intersphinx',
29+
'sphinx.ext.todo',
30+
'sphinx.ext.coverage',
31+
#'sphinx.ext.napoleon',
32+
#'sphinx.ext.imgmath',
33+
'sphinx.ext.ifconfig',
34+
'sphinx.ext.viewcode',
35+
'sphinxcontrib.spelling'
36+
]
3137

3238
# Add any paths that contain templates here, relative to this directory.
3339
templates_path = ['_templates']
@@ -43,14 +49,15 @@
4349

4450
# General information about the project.
4551
project = u'Python Wrapper for GnuPG'
46-
copyright = u'2008-%s, Vinay Sajip' % datetime.date.today().year
52+
copyright = u'2008-%s, Vinay Sajip' % datetime.date.today().year
4753

4854
# The version info for the project you're documenting, acts as replacement for
4955
# |version| and |release|, also used in various other places throughout the
5056
# built documents.
5157
#
5258
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
53-
from gnupg import __version__ as release, __date__ as today
59+
from gnupg import __version__ as release # , __date__ as today
60+
5461
version = '.'.join(release.split('.')[:2])
5562
if '.dev' in release:
5663
today = datetime.date.today().strftime('%b %d, %Y')
@@ -92,25 +99,22 @@
9299
# A list of ignored prefixes for module index sorting.
93100
#modindex_common_prefix = []
94101

95-
spelling_lang='en_GB'
96-
spelling_word_list_filename='spelling_wordlist.txt'
102+
spelling_lang = 'en_GB'
103+
spelling_word_list_filename = 'spelling_wordlist.txt'
97104

98105
# -- Options for HTML output ---------------------------------------------------
99106

100107
# The theme to use for HTML and HTML Help pages. See the documentation for
101108
# a list of builtin themes.
102109
html_theme = os.environ.get('DOCS_THEME', 'default')
103110

104-
THEME_OPTIONS = {
105-
'sizzle': {
106-
}
107-
}
111+
THEME_OPTIONS = {'sizzle': {}}
108112

109113
if html_theme == 'sizzle' and os.path.isfile('hover.json'):
110114
import json
111115

112116
with open('hover.json', encoding='utf-8') as f:
113-
THEME_OPTIONS['sizzle']['custom_data'] = {'hovers': json.load(f) }
117+
THEME_OPTIONS['sizzle']['custom_data'] = {'hovers': json.load(f)}
114118

115119
# Theme options are theme-specific and customize the look and feel of a theme
116120
# further. For a list of options available for each theme, see the
@@ -155,18 +159,18 @@
155159
# Custom sidebar templates, maps document names to template names.
156160

157161
# html_sidebars = {
158-
# '**': [
159-
# 'localtoc.html', 'globaltoc.html', 'relations.html',
160-
# 'sourcelink.html', 'searchbox.html'
161-
# ],
162+
# '**': [
163+
# 'localtoc.html', 'globaltoc.html', 'relations.html',
164+
# 'sourcelink.html', 'searchbox.html'
165+
# ],
162166
# }
163167

164168
# Additional templates that should be rendered to pages, maps page names to
165169
# template names.
166170
#html_additional_pages = {}
167171

168172
# If false, no module index is generated.
169-
#html_domain_indices = True
173+
# html_domain_indices = True
170174

171175
# If false, no index is generated.
172176
#html_use_index = True
@@ -194,7 +198,6 @@
194198
# Output file base name for HTML help builder.
195199
htmlhelp_basename = 'GnuPGWrapperforPythondoc'
196200

197-
198201
# -- Options for LaTeX output --------------------------------------------------
199202

200203
# The paper size ('letter' or 'a4').
@@ -206,8 +209,7 @@
206209
# Grouping the document tree into LaTeX files. List of tuples
207210
# (source start file, target name, title, author, documentclass [howto/manual]).
208211
latex_documents = [
209-
('index', 'GnuPGWrapperforPython.tex', u'GnuPG Wrapper for Python Documentation',
210-
u'Vinay Sajip', 'manual'),
212+
('index', 'GnuPGWrapperforPython.tex', u'GnuPG Wrapper for Python Documentation', u'Vinay Sajip', 'manual'),
211213
]
212214

213215
# The name of an image file (relative to this directory) to place at the top of
@@ -233,16 +235,11 @@
233235
# If false, no module index is generated.
234236
#latex_domain_indices = True
235237

236-
237238
# -- Options for manual page output --------------------------------------------
238239

239240
# One entry per manual page. List of tuples
240241
# (source start file, name, description, authors, manual section).
241-
man_pages = [
242-
('index', 'python-gnupg', u'python-gnupg Documentation',
243-
[u'Vinay Sajip'], 1)
244-
]
245-
242+
man_pages = [('index', 'python-gnupg', u'python-gnupg Documentation', [u'Vinay Sajip'], 1)]
246243

247244
# -- Options for Epub output ---------------------------------------------------
248245

@@ -283,13 +280,14 @@
283280
# Allow duplicate toc entries.
284281
#epub_tocdup = True
285282

286-
287283
# Example configuration for intersphinx: refer to the Python standard library.
288284
intersphinx_mapping = {'python': ('http://docs.python.org/', None)}
289285

286+
290287
def skip_module_docstring(app, what, name, obj, options, lines):
291288
if (what, name) == ('module', 'distlib'):
292289
del lines[:]
293290

291+
294292
def setup(app):
295293
app.connect('autodoc-process-docstring', skip_module_docstring)

gnupg.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,8 +1874,10 @@ def list_keys(self, secret=False, keys=None, sigs=False):
18741874
if subkey_info:
18751875
for sk in subkeys:
18761876
skid, capability, fp, grp = sk
1877-
subkey_info[skid]['fingerprint'] = fp
1878-
subkey_info[skid]['keygrip'] = grp
1877+
d = subkey_info[skid]
1878+
d['capability'] = capability
1879+
d['fingerprint'] = fp
1880+
d['keygrip'] = grp
18791881
return result
18801882

18811883
def scan_keys(self, filename):

test_gnupg.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,8 @@ def do_file_encryption_and_decryption(self, encfname, decfname):
11801180
if gnupg._py3k:
11811181
logger.debug('about to pass text stream to decrypt_file')
11821182
with open(encfname, 'r') as efile:
1183-
self.assertRaises(UnicodeDecodeError, self.gpg.decrypt_file, efile, passphrase='bbrown', output=decfname)
1183+
self.assertRaises(UnicodeDecodeError, self.gpg.decrypt_file, efile,
1184+
passphrase='bbrown', output=decfname)
11841185
finally:
11851186
for fn in (encfname, decfname):
11861187
if os.name == 'posix' and mode is not None:

0 commit comments

Comments
 (0)