Added subdir argument, cleaned up arg handling
[treecutter.git] / treecutter / main.py
index 92055d20050d0af57254b0618991c3c75b629a56..6d7b7ddcecbd679f4775cebaaa55f54e7a288fce 100644 (file)
@@ -12,11 +12,13 @@ def main():
                         default=os.path.dirname(os.getcwd())+'/style/default/')
     parser.add_argument('--output', nargs='?',
                         default=os.path.dirname(os.getcwd())+'/htdocs/')
+    parser.add_argument('--subdir', nargs='?',
+                        default='')
     args = parser.parse_args()
 
     ts = time()
     dir_ = Directory()
-    sitemap = Sitemap()
+    sitemap = Sitemap(args)
 
     # Scanning current directory and subdirectory for docbook articles
     dir_.scan()
@@ -38,11 +40,11 @@ def main():
     # Generate a pygraphviz image of the site (TODO: currently not used)
     sitemap.graph()
     # Start processing the docbook articles to static html
-    sitemap.process(args.style)
+    sitemap.process()
 
     # Publish static html and style data (css, images, fonts) to destination dir
     t1 = time()
-    sitemap.publish(args.output,args.style)
+    sitemap.publish()
     t2 = time()
     print "Publish  [%5.2f s]" % (round(t2-t1,2))
     print "Total    [%5.2f s]" % (round(t2-ts,2))