diff --git a/markdown/util.py b/markdown/util.py index e3a46894d..d3d48f099 100644 --- a/markdown/util.py +++ b/markdown/util.py @@ -15,9 +15,9 @@ text_type = str int2str = chr else: # pragma: no cover - string_type = basestring - text_type = unicode - int2str = unichr + string_type = basestring # noqa + text_type = unicode # noqa + int2str = unichr # noqa """ diff --git a/setup.py b/setup.py index 923334dc6..fec2dcb2f 100755 --- a/setup.py +++ b/setup.py @@ -44,7 +44,9 @@ def get_version(): class md_install_scripts(install_scripts): + """ Customized install_scripts. Create markdown_py.bat for win32. """ + def run(self): install_scripts.run(self) @@ -59,13 +61,14 @@ def run(self): f = open(bat_path, 'w') f.write(bat_str) f.close() - print ('Created: %s' % bat_path) + print('Created: %s' % bat_path) except Exception: _, err, _ = sys.exc_info() # for both 2.x & 3.x compatability - print ('ERROR: Unable to create %s: %s' % (bat_path, err)) + print('ERROR: Unable to create %s: %s' % (bat_path, err)) class build_docs(Command): + """ Build markdown documentation into html.""" description = '"build" documentation (convert markdown text to html)' @@ -73,7 +76,7 @@ class build_docs(Command): user_options = [ ('build-base=', 'd', 'directory to "build" to'), ('force', 'f', 'forcibly build everything (ignore file timestamps)'), - ] + ] boolean_options = ['force'] @@ -121,7 +124,7 @@ def _get_context(self, src, path): name, ext = os.path.splitext(file) parts = [x for x in dir.split(os.sep) if x] c['source'] = '%s.txt' % name - c['base'] = '../'*len(parts) + c['base'] = '../' * len(parts) # Build page title if name.lower() != 'index' or parts: c['page_title'] = '%s — Python Markdown' % c['title'] @@ -131,7 +134,7 @@ def _get_context(self, src, path): crumbs = [] ctemp = '