Avoid loading the whole bugdir when calling `be html -e`.
authorW. Trevor King <wking@drexel.edu>
Wed, 14 Jul 2010 23:36:25 +0000 (19:36 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 14 Jul 2010 23:36:25 +0000 (19:36 -0400)
This cleans up Mathieu Clabaut's fix to the html_gen definition
problems in `be html -e`.

libbe/command/html.py

index f4273e98cc7d39c886a343e76baa2aaf96396716..c61d6d8033274f14696df2011935a7eed45b15ed 100644 (file)
@@ -104,8 +104,11 @@ class HTML (libbe.command.Command):
                 ])
 
     def _run(self, **params):
-        bugdir = self._get_bugdir()
-        bugdir.load_all_bugs()
+        if params['export-template'] == True:
+            bugdir = None
+        else:
+            bugdir = self._get_bugdir()
+            bugdir.load_all_bugs()
         html_gen = HTMLGen(bugdir,
                            template=params['template-dir'],
                            title=params['title'],
@@ -117,7 +120,6 @@ class HTML (libbe.command.Command):
             html_gen.write_default_template(params['export-template-dir'])
         else:
             html_gen.run(params['output'])
-        return 0
 
     def _long_help(self):
         return """