5 from treecutter.directory import Directory
6 from treecutter.sitemap import Sitemap
10 parser = argparse.ArgumentParser(description='Process docbook article tree.')
11 parser.add_argument('--style', nargs='?',
12 default=os.path.dirname(os.getcwd())+'/style/default/')
13 parser.add_argument('--output', nargs='?',
14 default=os.path.dirname(os.getcwd())+'/htdocs/')
15 parser.add_argument('--subdir', nargs='?',
17 args = parser.parse_args()
21 sitemap = Sitemap(args)
23 # Scanning current directory and subdirectory for docbook articles
25 # Reading the sitemap.txt building a Trie structure
28 # Comparing the current state of the dir with the sitemap
29 missing = dir_.set() - sitemap.set()
30 removed = sitemap.set() - dir_.set()
32 print page+' pages missing!!'
34 print 'adding missing page '+page
35 sitemap.add_link(page)
36 if len(missing)+len(removed) != 0:
37 print 'writing new sitemap - please adjust if needed'
40 # Generate a pygraphviz image of the site (TODO: currently not used)
42 # Start processing the docbook articles to static html
45 # Publish static html and style data (css, images, fonts) to destination dir
49 print "Publish [%5.2f s]" % (round(t2-t1,2))
50 print "Total [%5.2f s]" % (round(t2-ts,2))
53 if __name__ == "__main__":