Skip to content

Commit d1bada6

Browse files
committed
Merge pull request #1255 from miykael/master
FIX: PEP8 correction for all error E100-E399
2 parents 8bd9bf8 + d6f6f01 commit d1bada6

File tree

261 files changed

+7003
-6356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+7003
-6356
lines changed

build_docs.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,20 @@
2929

3030
################################################################################
3131
# Distutils Command class for installing nipype to a temporary location.
32+
33+
3234
class TempInstall(Command):
3335
temp_install_dir = os.path.join('build', 'install')
3436

3537
def run(self):
3638
""" build and install nipype in a temporary location. """
3739
install = self.distribution.get_command_obj('install')
3840
install.install_scripts = self.temp_install_dir
39-
install.install_base = self.temp_install_dir
41+
install.install_base = self.temp_install_dir
4042
install.install_platlib = self.temp_install_dir
4143
install.install_purelib = self.temp_install_dir
42-
install.install_data = self.temp_install_dir
43-
install.install_lib = self.temp_install_dir
44+
install.install_data = self.temp_install_dir
45+
install.install_lib = self.temp_install_dir
4446
install.install_headers = self.temp_install_dir
4547
install.run()
4648

@@ -64,13 +66,12 @@ def finalize_options(self):
6466
# Distutils Command class for API generation
6567
class APIDocs(TempInstall):
6668
description = \
67-
"""generate API docs """
69+
"""generate API docs """
6870

6971
user_options = [
7072
('None', None, 'this command has no options'),
7173
]
7274

73-
7475
def run(self):
7576
# First build the project and install it to a temporary location.
7677
TempInstall.run(self)
@@ -141,22 +142,21 @@ def zip_docs(self):
141142
# require zlib.
142143
try:
143144
zf = zipfile.ZipFile(target_file, 'w',
144-
compression=zipfile.ZIP_DEFLATED)
145+
compression=zipfile.ZIP_DEFLATED)
145146
except RuntimeError:
146147
warnings.warn('zlib not installed, storing the docs '
147-
'without compression')
148+
'without compression')
148149
zf = zipfile.ZipFile(target_file, 'w',
149-
compression=zipfile.ZIP_STORED)
150+
compression=zipfile.ZIP_STORED)
150151

151152
for root, dirs, files in os.walk(DOC_BUILD_DIR):
152153
relative = relative_path(root)
153154
if not relative.startswith('.doctrees'):
154155
for f in files:
155156
zf.write(os.path.join(root, f),
156-
os.path.join(relative, 'html_docs', f))
157+
os.path.join(relative, 'html_docs', f))
157158
zf.close()
158159

159-
160160
def finalize_options(self):
161161
""" Override the default for the documentation build
162162
directory.
@@ -166,6 +166,8 @@ def finalize_options(self):
166166

167167
################################################################################
168168
# Distutils Command class to clean
169+
170+
169171
class Clean(clean):
170172

171173
def run(self):

doc/conf.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import sys, os
1616

1717
nipypepath = os.path.abspath('..')
18-
sys.path.insert(1,nipypepath)
18+
sys.path.insert(1, nipypepath)
1919

2020
import nipype
2121

@@ -168,9 +168,9 @@
168168
#html_use_smartypants = True
169169

170170
# Custom sidebar templates, maps document names to template names.
171-
html_sidebars = {'**': ['gse.html','localtoc.html', 'sidebar_versions.html', 'indexsidebar.html'],
172-
'searchresults' : ['sidebar_versions.html', 'indexsidebar.html'],
173-
'version' : []}
171+
html_sidebars = {'**': ['gse.html', 'localtoc.html', 'sidebar_versions.html', 'indexsidebar.html'],
172+
'searchresults': ['sidebar_versions.html', 'indexsidebar.html'],
173+
'version': []}
174174

175175
# Additional templates that should be rendered to pages, maps page names to
176176
# template names.

doc/sphinxext/autosummary_generate.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
except ImportError:
2727
import_phantom_module = lambda x: x
2828

29+
2930
def main():
3031
p = optparse.OptionParser(__doc__.strip())
3132
p.add_option("-p", "--phantom", action="store", type="string",
@@ -95,16 +96,19 @@ def main():
9596
finally:
9697
f.close()
9798

99+
98100
def format_modulemember(name, directive):
99101
parts = name.split('.')
100102
mod, name = '.'.join(parts[:-1]), parts[-1]
101103
return ".. currentmodule:: %s\n\n.. %s:: %s\n" % (mod, directive, name)
102104

105+
103106
def format_classmember(name, directive):
104107
parts = name.split('.')
105108
mod, name = '.'.join(parts[:-2]), '.'.join(parts[-2:])
106109
return ".. currentmodule:: %s\n\n.. %s:: %s\n" % (mod, directive, name)
107110

111+
108112
def get_documented(filenames):
109113
"""
110114
Find out what items are documented in source/*.rst
@@ -119,6 +123,7 @@ def get_documented(filenames):
119123
f.close()
120124
return documented
121125

126+
122127
def get_documented_in_docstring(name, module=None, filename=None):
123128
"""
124129
Find out what items are documented in the given object's docstring.
@@ -135,6 +140,7 @@ def get_documented_in_docstring(name, module=None, filename=None):
135140
print("Failed to import '%s': %s" % (name, e))
136141
return {}
137142

143+
138144
def get_documented_in_lines(lines, module=None, filename=None):
139145
"""
140146
Find out what items are documented in the given lines
@@ -173,7 +179,7 @@ def get_documented_in_lines(lines, module=None, filename=None):
173179
continue
174180

175181
if line.strip().startswith(':'):
176-
continue # skip options
182+
continue # skip options
177183

178184
m = autosummary_item_re.match(line)
179185
if m:

doc/sphinxext/ipython_console_highlighting.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""reST directive for syntax-highlighting ipython interactive sessions.
44
"""
55

6-
#-----------------------------------------------------------------------------
6+
# -----------------------------------------------------------------------------
77
# Needed modules
88

99
# Standard library
@@ -18,13 +18,14 @@
1818
from sphinx import highlighting
1919

2020

21-
#-----------------------------------------------------------------------------
21+
# -----------------------------------------------------------------------------
2222
# Global constants
2323
line_re = re.compile('.*?\n')
2424

25-
#-----------------------------------------------------------------------------
25+
# -----------------------------------------------------------------------------
2626
# Code begins - classes and functions
2727

28+
2829
class IPythonConsoleLexer(Lexer):
2930
"""
3031
For IPython console output or doctests, such as:
@@ -95,6 +96,6 @@ def get_tokens_unprocessed(self, text):
9596
pylexer.get_tokens_unprocessed(curcode)):
9697
yield item
9798

98-
#-----------------------------------------------------------------------------
99+
# -----------------------------------------------------------------------------
99100
# Register the extension as a valid pygments lexer
100101
highlighting.lexers['ipython'] = IPythonConsoleLexer()

0 commit comments

Comments
 (0)