[Telepathy-commits] [telepathy-spec/master] Reuse Template object (should save on template compilation

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


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

diff --git a/tools/doc-generator.py b/tools/doc-generator.py
index e9109a8..27b13a0 100755
--- a/tools/doc-generator.py
+++ b/tools/doc-generator.py
@@ -29,13 +29,13 @@ def load_template (filename):
 
     return template_def
 
-interfaces = specparser.parse (sys.argv[1])
-
 # write out HTML files for each of the interfaces
+interfaces = specparser.parse (sys.argv[1])
+namespace = {}
 template_def = load_template ('interface.html')
+t = Template (template_def, namespaces = [namespace])
 for interface in interfaces.values ():
-    namespace = { 'interface': interface }
-    t = Template (template_def, namespaces = [namespace])
+    namespace['interface'] = interface
     
     # open the output file
     out = open (os.path.join (output_path, '%s.html' % interface.name), 'w')
-- 
1.5.6.5




More information about the telepathy-commits mailing list