init.py (1023B)
1 #!/usr/bin/python 2 ''' 3 ' pnbp - pnbp is not a blogging platform 4 ' init.py 5 ' Paul Longtine <paul@nanner.co> 6 ' 7 ' For documentation, please visit http://pnbp.nanner.co 8 ''' 9 10 import core, stagit 11 12 from time import time 13 from optparse import OptionParser 14 15 def parsearg(): 16 parser = OptionParser() 17 18 parser.add_option("-d", dest="dir", default=".", 19 help="set site project root directory", metavar="<dir>") 20 parser.add_option("-o", dest="out", default="site", 21 help="where to output", metavar="<out>") 22 parser.add_option("-i", "--init", dest="init", action="store_true", 23 default=False, help="initalize basic project directory") 24 return parser.parse_args() 25 26 if __name__ == "__main__": 27 #Save the time for the caluation 28 start = time() 29 30 #Parse arguements 31 options, args = parsearg() 32 33 #Tries to run the jobs 34 core.init(options) 35 36 #Do the thing after 37 stagit.init(options) 38 39 #Print the time it took to build the site 40 print("Finished in {} ms.".format((time()-start)*1000)) 41 42