changeset 538:d1b86d5849a0

More pep8 cleanups
author Neil Muller <neil@dip.sun.ac.za>
date Sat, 11 Feb 2012 12:15:31 +0200
parents 5b9f371c2bb8
children 11530992924a
files docs/conf.py pyweek-upload.py tools/rect_drawer.py
diffstat 3 files changed, 26 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/docs/conf.py	Sat Feb 11 12:10:58 2012 +0200
+++ b/docs/conf.py	Sat Feb 11 12:15:31 2012 +0200
@@ -3,7 +3,8 @@
 # Boomslang documentation build configuration file, created by
 # sphinx-quickstart on Mon Aug 23 00:49:49 2010.
 #
-# 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,20 +12,21 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-import sys, os
+import sys
+import os
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # 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.todo']
 
 # Add any paths that contain templates here, relative to this directory.
@@ -41,7 +43,8 @@
 
 # General information about the project.
 project = u'Boomslang'
-copyright = u'2010, Simon Cross, Adrianna Pinska, Jeremy Thurgood, Neil Muller, Stefano Rivera'
+copyright = u'2010, Simon Cross, Adrianna Pinska, Jeremy Thurgood,' \
+        ' Neil Muller, Stefano Rivera'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -66,7 +69,8 @@
 # directories to ignore when looking for source files.
 exclude_patterns = ['_build']
 
-# 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.
@@ -86,8 +90,7 @@
 # A list of ignored prefixes for module index sorting.
 #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.
@@ -167,7 +170,7 @@
 htmlhelp_basename = 'Boomslangdoc'
 
 
-# -- Options for LaTeX output --------------------------------------------------
+# -- Options for LaTeX output -------------------------------------------------
 
 # The paper size ('letter' or 'a4').
 #latex_paper_size = 'letter'
@@ -176,10 +179,12 @@
 #latex_font_size = '10pt'
 
 # Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
+# (source start file, target name, title, author, documentclass
+# [howto/manual]).
 latex_documents = [
   ('index', 'Boomslang.tex', u'Boomslang Documentation',
-   u'Simon Cross, Adrianna Pinska, Jeremy Thurgood, Neil Muller, Stefano Rivera', 'manual'),
+   u'Simon Cross, Adrianna Pinska, Jeremy Thurgood, Neil Muller,'
+           ' Stefano Rivera', 'manual'),
 ]
 
 # The name of an image file (relative to this directory) to place at the top of
@@ -206,11 +211,12 @@
 #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).
 man_pages = [
     ('index', 'boomslang', u'Boomslang Documentation',
-     [u'Simon Cross, Adrianna Pinska, Jeremy Thurgood, Neil Muller, Stefano Rivera'], 1)
+     [u'Simon Cross, Adrianna Pinska, Jeremy Thurgood, Neil Muller,''
+         Stefano Rivera'], 1)
 ]
--- a/pyweek-upload.py	Sat Feb 11 12:10:58 2012 +0200
+++ b/pyweek-upload.py	Sat Feb 11 12:15:31 2012 +0200
@@ -106,7 +106,7 @@
             s = '%s %2d%%' % (self.info, self.num * 100. / self.total)
         else:
             s = '%s %d done' % (self.info, self.num)
-        sys.stdout.write(s + ' ' * (75-len(s)) + '\r')
+        sys.stdout.write(s + ' ' * (75 - len(s)) + '\r')
         sys.stdout.flush()
 
 
@@ -142,7 +142,7 @@
 
     data = mimeEncode(data)
     h.putrequest('POST', url)
-    h.putheader('Content-type', 'multipart/form-data; boundary=%s'%boundary)
+    h.putheader('Content-type', 'multipart/form-data; boundary=%s' % boundary)
     h.putheader('Content-length', str(len(data)))
     h.putheader('Host', server)
     h.endheaders()
@@ -155,7 +155,7 @@
     response = f.read().strip()
     f.close()
 
-    print '%s %s'%(errcode, errmsg)
+    print '%s %s' % (errcode, errmsg)
     if response:
         print response
 
@@ -208,7 +208,7 @@
         elif opt == '-c':
             data['content_file'] = Upload(arg)
         elif opt == '-e':
-            url = '/e/%s/oup/'%arg
+            url = '/e/%s/oup/' % arg
         elif opt == '-h':
             host = arg
         elif opt == '-P':
@@ -221,4 +221,3 @@
 
     data.update(optional)
     http_request(data, host, port, url)
-
--- a/tools/rect_drawer.py	Sat Feb 11 12:10:58 2012 +0200
+++ b/tools/rect_drawer.py	Sat Feb 11 12:15:31 2012 +0200
@@ -471,8 +471,8 @@
                 # Find current interacts in this thing
                 cur_interact = cand.current_interact
                 j = cand.interacts.values().index(cur_interact)
-                if j + 1< len(cand.interacts):
-                    next_name = cand.interacts.keys()[j+1]
+                if j + 1 < len(cand.interacts):
+                    next_name = cand.interacts.keys()[j + 1]
                 else:
                     next_name = cand.interacts.keys()[0]
                 if cand.interacts[next_name] != cur_interact: