Skip to content

Commit f6ed8c3

Browse files
committed
PEP8 fixes for docscrape_sphinx.py
1 parent 254494c commit f6ed8c3

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

numpydoc/docscrape_sphinx.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
from __future__ import division, absolute_import, print_function
22

3-
import sys, re, inspect, textwrap, pydoc
3+
import sys
4+
import re
5+
import inspect
6+
import textwrap
7+
import pydoc
48
import sphinx
59
import collections
10+
611
from .docscrape import NumpyDocString, FunctionDoc, ClassDoc
712

813
if sys.version_info[0] >= 3:
@@ -171,7 +176,7 @@ def _str_index(self):
171176
if len(idx) == 0:
172177
return out
173178

174-
out += ['.. index:: %s' % idx.get('default','')]
179+
out += ['.. index:: %s' % idx.get('default', '')]
175180
for section, references in idx.items():
176181
if section == 'default':
177182
continue
@@ -192,9 +197,9 @@ def _str_references(self):
192197
# Latex collects all references to a separate bibliography,
193198
# so we need to insert links to it
194199
if sphinx.__version__ >= "0.6":
195-
out += ['.. only:: latex','']
200+
out += ['.. only:: latex', '']
196201
else:
197-
out += ['.. latexonly::','']
202+
out += ['.. latexonly::', '']
198203
items = []
199204
for line in self['References']:
200205
m = re.match(r'.. \[([a-z0-9._-]+)\]', line, re.I)
@@ -235,25 +240,29 @@ def __str__(self, indent=0, func_role="obj"):
235240
out += self._str_examples()
236241
for param_list in ('Attributes', 'Methods'):
237242
out += self._str_member_list(param_list)
238-
out = self._str_indent(out,indent)
243+
out = self._str_indent(out, indent)
239244
return '\n'.join(out)
240245

246+
241247
class SphinxFunctionDoc(SphinxDocString, FunctionDoc):
242248
def __init__(self, obj, doc=None, config={}):
243249
self.load_config(config)
244250
FunctionDoc.__init__(self, obj, doc=doc, config=config)
245251

252+
246253
class SphinxClassDoc(SphinxDocString, ClassDoc):
247254
def __init__(self, obj, doc=None, func_doc=None, config={}):
248255
self.load_config(config)
249256
ClassDoc.__init__(self, obj, doc=doc, func_doc=None, config=config)
250257

258+
251259
class SphinxObjDoc(SphinxDocString):
252260
def __init__(self, obj, doc=None, config={}):
253261
self._f = obj
254262
self.load_config(config)
255263
SphinxDocString.__init__(self, doc, config=config)
256264

265+
257266
def get_doc_object(obj, what=None, doc=None, config={}):
258267
if what is None:
259268
if inspect.isclass(obj):

0 commit comments

Comments
 (0)