Exception when doing 'be html -e'
authorMathieu Clabaut <mathieu.clabaut@gmail.com>
Mon, 12 Jul 2010 14:32:01 +0000 (16:32 +0200)
committerMathieu Clabaut <mathieu.clabaut@gmail.com>
Mon, 12 Jul 2010 14:32:53 +0000 (16:32 +0200)
'html_gen' was referenced before assignment.

libbe/command/html.py

index e6c4c8c40a5a4872d429b6d7245a189a575761a5..f4273e98cc7d39c886a343e76baa2aaf96396716 100644 (file)
@@ -104,9 +104,6 @@ class HTML (libbe.command.Command):
                 ])
 
     def _run(self, **params):
-        if params['export-template'] == True:
-            html_gen.write_default_template(params['export-template-dir'])
-            return 0
         bugdir = self._get_bugdir()
         bugdir.load_all_bugs()
         html_gen = HTMLGen(bugdir,
@@ -116,7 +113,10 @@ class HTML (libbe.command.Command):
                            min_id_length=params['min-id-length'],
                            verbose=params['verbose'],
                            stdout=self.stdout)
-        html_gen.run(params['output'])
+        if params['export-template'] == True:
+            html_gen.write_default_template(params['export-template-dir'])
+        else:
+            html_gen.run(params['output'])
         return 0
 
     def _long_help(self):