[Telepathy-commits] [telepathy-spec/master] PEP8

Davyd Madeley davyd at madeley.id.au
Mon Mar 23 12:29:32 PDT 2009


---
 tools/doc-generator.py |   52 ++++++++++++++++++++++++------------------------
 1 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/tools/doc-generator.py b/tools/doc-generator.py
index dc31e6f..5b369d0 100755
--- a/tools/doc-generator.py
+++ b/tools/doc-generator.py
@@ -33,7 +33,7 @@ try:
 except ImportError, e:
     print >> sys.stderr, e
     print >> sys.stderr, "Install `python-cheetah'?"
-    sys.exit (-1)
+    sys.exit(-1)
 
 import specparser
 
@@ -49,58 +49,58 @@ except OSError:
 # copy in the CSS
 shutil.copy(os.path.join(template_path, 'style.css'), output_path)
 
-def load_template (filename):
+def load_template(filename):
     try:
-        file = open (os.path.join (template_path, filename))
-        template_def = file.read ()
-        file.close ()
+        file = open(os.path.join(template_path, filename))
+        template_def = file.read()
+        file.close()
     except IOError, e:
         print >> sys.stderr, "Could not load template file `%s'" % filename
         print >> sys.stderr, e
-        sys.exit (-1)
+        sys.exit(-1)
 
     return template_def
 
 # write out HTML files for each of the interfaces
 spec = specparser.parse(spec_file)
 namespace = {}
-template_def = load_template ('interface.html')
-t = Template (template_def, namespaces = [namespace])
+template_def = load_template('interface.html')
+t = Template(template_def, namespaces = [namespace])
 for interface in spec.interfaces:
     namespace['interface'] = interface
     
     # open the output file
-    out = open (os.path.join (output_path, '%s.html' % interface.name), 'w')
+    out = open(os.path.join(output_path, '%s.html' % interface.name), 'w')
     print >> out, t
-    out.close ()
+    out.close()
 
 # write out a TOC
-template_def = load_template ('index.html')
-t = Template (template_def, namespaces = [spec])
-out = open (os.path.join (output_path, 'index.html'), 'w')
+template_def = load_template('index.html')
+t = Template(template_def, namespaces=[spec])
+out = open(os.path.join(output_path, 'index.html'), 'w')
 print >> out, t
-out.close ()
+out.close()
 
 # write out the generic types
 namespace = { 'spec': spec }
-template_def = load_template ('generic-types.html')
-t = Template (template_def, namespaces = namespace)
-out = open (os.path.join (output_path, 'generic-types.html'), 'w')
+template_def = load_template('generic-types.html')
+t = Template(template_def, namespaces=namespace)
+out = open(os.path.join(output_path, 'generic-types.html'), 'w')
 print >> out, t
-out.close ()
+out.close()
 
 # write out the errors
 namespace = { 'spec': spec }
-template_def = load_template ('errors.html')
-t = Template (template_def, namespaces = namespace)
-out = open (os.path.join (output_path, 'errors.html'), 'w')
+template_def = load_template('errors.html')
+t = Template(template_def, namespaces=namespace)
+out = open(os.path.join(output_path, 'errors.html'), 'w')
 print >> out, t
-out.close ()
+out.close()
 
 # write out the fullindex
 namespace = { 'spec': spec }
-template_def = load_template ('fullindex.html')
-t = Template (template_def, namespaces = namespace)
-out = open (os.path.join (output_path, 'fullindex.html'), 'w')
+template_def = load_template('fullindex.html')
+t = Template(template_def, namespaces=namespace)
+out = open(os.path.join(output_path, 'fullindex.html'), 'w')
 print >> out, t
-out.close ()
+out.close()
-- 
1.5.6.5




More information about the telepathy-commits mailing list