__init__.py (531B)
1 ''' 2 ' pnbp - pnbp is not a blogging platform 3 ' __init__.py 4 ' Paul Longtine <paul@nanner.co> 5 ''' 6 7 import os, sys, yaml 8 9 import core.helper.cmd 10 import core.builder 11 12 def init(arg): 13 if arg.init: 14 core.helper.cmd.init() 15 16 if os.path.exists(arg.dir): 17 os.chdir(arg.dir) 18 else: 19 print("'{}' does not exist".format(arg.dir)) 20 sys.exit(1) 21 22 #Try to get the config 23 try: 24 pages = file("pages.yml") 25 26 except: 27 print("Can't open file 'pages.yml'") 28 sys.exit() 29 30 pagedata = yaml.load(pages) 31 32 core.builder.build(pagedata,arg.out) 33