Skip to content

Commit cedc184

Browse files
committed
flake8ify
1 parent 4cac4ff commit cedc184

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

markdown/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
text_type = str
1616
int2str = chr
1717
else: # pragma: no cover
18-
string_type = basestring
19-
text_type = unicode
20-
int2str = unichr
18+
string_type = basestring # noqa
19+
text_type = unicode # noqa
20+
int2str = unichr # noqa
2121

2222

2323
"""

setup.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ def get_version():
4444

4545

4646
class md_install_scripts(install_scripts):
47+
4748
""" Customized install_scripts. Create markdown_py.bat for win32. """
49+
4850
def run(self):
4951
install_scripts.run(self)
5052

@@ -59,21 +61,22 @@ def run(self):
5961
f = open(bat_path, 'w')
6062
f.write(bat_str)
6163
f.close()
62-
print ('Created: %s' % bat_path)
64+
print('Created: %s' % bat_path)
6365
except Exception:
6466
_, err, _ = sys.exc_info() # for both 2.x & 3.x compatability
65-
print ('ERROR: Unable to create %s: %s' % (bat_path, err))
67+
print('ERROR: Unable to create %s: %s' % (bat_path, err))
6668

6769

6870
class build_docs(Command):
71+
6972
""" Build markdown documentation into html."""
7073

7174
description = '"build" documentation (convert markdown text to html)'
7275

7376
user_options = [
7477
('build-base=', 'd', 'directory to "build" to'),
7578
('force', 'f', 'forcibly build everything (ignore file timestamps)'),
76-
]
79+
]
7780

7881
boolean_options = ['force']
7982

@@ -121,7 +124,7 @@ def _get_context(self, src, path):
121124
name, ext = os.path.splitext(file)
122125
parts = [x for x in dir.split(os.sep) if x]
123126
c['source'] = '%s.txt' % name
124-
c['base'] = '../'*len(parts)
127+
c['base'] = '../' * len(parts)
125128
# Build page title
126129
if name.lower() != 'index' or parts:
127130
c['page_title'] = '%s — Python Markdown' % c['title']
@@ -131,7 +134,7 @@ def _get_context(self, src, path):
131134
crumbs = []
132135
ctemp = '<li><a href="%s">%s</a> &raquo;</li>'
133136
for n, part in enumerate(parts):
134-
href = ('../'*n) + 'index.html'
137+
href = ('../' * n) + 'index.html'
135138
label = part.replace('_', ' ').capitalize()
136139
crumbs.append(ctemp % (href, label))
137140
if c['title'] and name.lower() != 'index':
@@ -147,7 +150,7 @@ def run(self):
147150
try:
148151
import markdown
149152
except ImportError:
150-
print ('skipping build_docs: Markdown "import" failed!')
153+
print('skipping build_docs: Markdown "import" failed!')
151154
else:
152155
with codecs.open('docs/_template.html', encoding='utf-8') as f:
153156
template = f.read()
@@ -174,7 +177,7 @@ def run(self):
174177
self.mkpath(os.path.split(outfile)[0])
175178
if self.force or newer(infile, outfile):
176179
if self.verbose:
177-
print ('Converting %s -> %s' % (infile, outfile))
180+
print('Converting %s -> %s' % (infile, outfile))
178181
if not self.dry_run:
179182
with codecs.open(infile, encoding='utf-8') as f:
180183
src = f.read()
@@ -189,11 +192,12 @@ def run(self):
189192

190193

191194
class md_build(build):
195+
192196
""" Run "build_docs" command from "build" command. """
193197

194198
user_options = build.user_options + [
195199
('no-build-docs', None, 'do not build documentation'),
196-
]
200+
]
197201

198202
boolean_options = build.boolean_options + ['build-docs']
199203

0 commit comments

Comments
 (0)