From 4b07acc3e8726fa428acd985ab29ba7efec0c09c Mon Sep 17 00:00:00 2001 From: John Evans Date: Tue, 4 Jun 2013 16:12:19 -0400 Subject: [PATCH] Pep 8 work. --- docs/source/conf.py | 44 +++++++++++++++---------------- glymur/jp2box.py | 4 ++- glymur/test/test_opj_suite_neg.py | 2 +- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 0b72b85..46d2d3c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -3,7 +3,8 @@ # glymur documentation build configuration file, created by # sphinx-quickstart on Sun May 26 11:29:54 2013. # -# This file is execfile()d with the current directory set to its containing dir. +# This file is execfile()d with the current directory set to its containing +# dir. # # Note that not all possible configuration values are present in this # autogenerated file. @@ -11,7 +12,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import sys +import os + class Mock(object): def __init__(self, *args, **kwargs): @@ -41,13 +44,13 @@ for mod_name in MOCK_MODULES: # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) -# -- General configuration ----------------------------------------------------- +# -- General configuration ---------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.autosummary', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'numpydoc'] @@ -91,7 +94,8 @@ release = '0.1.3p1' # directories to ignore when looking for source files. exclude_patterns = [] -# The reST default role (used for this markup: `text`) to use for all documents. +# The reST default role (used for this markup: `text`) to use for all +# documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. @@ -112,7 +116,7 @@ pygments_style = 'sphinx' #modindex_common_prefix = [] -# -- Options for HTML output --------------------------------------------------- +# -- Options for HTML output -------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. @@ -192,9 +196,8 @@ html_show_sourcelink = True htmlhelp_basename = 'glymurdoc' -# -- Options for LaTeX output -------------------------------------------------- +# -- Options for LaTeX output ------------------------------------------------- -latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', @@ -203,14 +206,13 @@ latex_elements = { # Additional stuff for the LaTeX preamble. #'preamble': '', -} +latex_elements = {} # Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ('index', 'glymur.tex', u'glymur Documentation', - u'John Evans', 'manual'), -] +# (source start file, target name, title, author, documentclass +# [howto/manual]). +latex_documents = [('index', 'glymur.tex', u'glymur Documentation', + u'John Evans', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. @@ -233,7 +235,7 @@ latex_documents = [ #latex_domain_indices = True -# -- Options for manual page output -------------------------------------------- +# -- Options for manual page output ------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). @@ -246,16 +248,14 @@ man_pages = [ #man_show_urls = False -# -- Options for Texinfo output ------------------------------------------------ +# -- Options for Texinfo output ----------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) -texinfo_documents = [ - ('index', 'glymur', u'glymur Documentation', - u'John Evans', 'glymur', 'One line description of project.', - 'Miscellaneous'), -] +texinfo_documents = [('index', 'glymur', u'glymur Documentation', + u'John Evans', 'glymur', + 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] diff --git a/glymur/jp2box.py b/glymur/jp2box.py index a435f67..29acab4 100644 --- a/glymur/jp2box.py +++ b/glymur/jp2box.py @@ -1610,7 +1610,7 @@ class UUIDBox(Jp2kBox): n = offset + length - f.tell() buffer = f.read(n) if kwargs['uuid'] == uuid.UUID('be7acfcb-97a9-42e8-9c71-999491e3afac'): - # XMP data. Parse as XML. Seems to be a difference between + # XMP data. Parse as XML. Seems to be a difference between # ElementTree in version 2.7 and 3.3. if sys.hexversion < 0x03000000: parser = ET.XMLParser(encoding='utf-8') @@ -1647,6 +1647,7 @@ _box_with_id = { 'uuid': UUIDBox, 'xml ': XMLBox} + def _indent(elem, level=0): """Recipe for pretty printing XML. Please see @@ -1666,6 +1667,7 @@ def _indent(elem, level=0): if level and (not elem.tail or not elem.tail.strip()): elem.tail = i + def _pretty_print_xml(xml, level=0): """Pretty print XML data. """ diff --git a/glymur/test/test_opj_suite_neg.py b/glymur/test/test_opj_suite_neg.py index 0862c42..75c9c6f 100644 --- a/glymur/test/test_opj_suite_neg.py +++ b/glymur/test/test_opj_suite_neg.py @@ -171,7 +171,7 @@ class TestSuiteNegative(unittest.TestCase): ofile.write(data, cbsize=(13, 12)) def test_codeblock_size_with_precinct_size(self): - # Seems like code block sizes should never exceed half that of + # Seems like code block sizes should never exceed half that of # precinct size. ifile = Jp2k(self.jp2file) data = ifile.read(reduce=3)