__init__.py (368B)
1 import os, sys, yaml 2 3 import stagit.ambassador 4 5 def init(arg): 6 if os.path.exists(arg.dir): 7 os.chdir(arg.dir) 8 else: 9 print("'{}' does not exist".format(arg.dir)) 10 sys.exit(1) 11 12 #Try to get the config 13 try: 14 raw_config = file("stagit_config.yml") 15 print("stagit enabled") 16 17 except: 18 return 19 20 config = yaml.load(raw_config) 21 22 stagit.ambassador.stagit(config) 23 24 25