def load_config(): global config if not os.path.isfile(os.path.join(script_dir, CONFIG_FILE)): print "Could not find config file '%s'" % os.path.abspath( os.path.join(script_dir, CONFIG_FILE)) choice = raw_input("\nDo you want to create a stub ? [yN] : " % current_b3_version) if choice.lower() == 'y': create_config_file_stub() print "config file stub created" sys.exit(0) else: sys.exit(0) from b3.lib import yaml with open(CONFIG_FILE, 'r') as f: config = yaml.load(f) if not 'innosetup_scripts' in config: print "Invalid config file. Could not find 'innosetup_scripts'." sys.exit(1) if not len(config['innosetup_scripts']): print "Invalid config file. No script found in 'innosetup_scripts' section." sys.exit(1) if not 'iscc' in config: print "Invalid config file. Could not find 'iscc'." sys.exit(1) if not os.path.isfile( os.path.abspath(os.path.join(script_dir, config['iscc']))): print "Invalid config file. '%s' is not a file." % config['iscc'] sys.exit(1) if not config['iscc'].lower().endswith('iscc.exe'): print "Invalid config file. '%s' is not a iscc.exe." % config['iscc'] sys.exit(1) if not 'output_dir' in config: print "Invalid config file. output_dir not set." sys.exit(1) else: dist_dir = os.path.abspath( os.path.join(script_dir, config['output_dir'])) if not os.path.isdir(dist_dir): os.makedirs(dist_dir)
def load_config(): global config config_file_path = os.path.normpath(os.path.join(script_dir, CONFIG_FILE)) if not os.path.isfile(config_file_path): print "Could not find config file '%s'" % config_file_path choice = raw_input("\nDo you want to create a stub ? [yN] : " % current_b3_version) if choice.lower() == "y": create_config_file_stub() print "config file stub created" sys.exit(0) else: sys.exit(0) from b3.lib import yaml with open(config_file_path, "r") as f: config = yaml.load(f) if not "innosetup_scripts" in config: print "Invalid config file. Could not find 'innosetup_scripts'." sys.exit(1) if not len(config["innosetup_scripts"]): print "Invalid config file. No script found in 'innosetup_scripts' section." sys.exit(1) if not "iscc" in config: print "Invalid config file. Could not find 'iscc'." sys.exit(1) if not os.path.isfile(os.path.abspath(os.path.join(script_dir, config["iscc"]))): print "Invalid config file. '%s' is not a file." % config["iscc"] sys.exit(1) # location of the InnoSetup Compiler program taken from environment variable ISCC_EXE if exists, else from # the yaml config file. config["iscc"] = os.environ.get("ISCC_EXE", config["iscc"]) if not config["iscc"].lower().endswith("iscc.exe"): print "Invalid location for the ISCC.exe program. '%s' is not a iscc.exe." % config["iscc"] sys.exit(1) if not "output_dir" in config: print "Invalid config file. output_dir not set." sys.exit(1) else: dist_dir = os.path.abspath(os.path.join(script_dir, config["output_dir"])) if not os.path.isdir(dist_dir): os.makedirs(dist_dir)
def load_config(): global config config_file_path = os.path.normpath(os.path.join(script_dir, CONFIG_FILE)) if not os.path.isfile(config_file_path): print "Could not find config file '%s'" % config_file_path choice = raw_input("\nDo you want to create a stub ? [yN] : " % current_b3_version) if choice.lower() == 'y': create_config_file_stub() print "config file stub created" sys.exit(0) else: sys.exit(0) from b3.lib import yaml with open(config_file_path, 'r') as f: config = yaml.load(f) if not 'innosetup_scripts' in config: print "Invalid config file. Could not find 'innosetup_scripts'." sys.exit(1) if not len(config['innosetup_scripts']): print "Invalid config file. No script found in 'innosetup_scripts' section." sys.exit(1) if not 'iscc' in config: print "Invalid config file. Could not find 'iscc'." sys.exit(1) if not os.path.isfile(os.path.abspath(os.path.join(script_dir, config['iscc']))): print "Invalid config file. '%s' is not a file." % config['iscc'] sys.exit(1) # location of the InnoSetup Compiler program taken from environment variable ISCC_EXE if exists, else from # the yaml config file. config['iscc'] = os.environ.get('ISCC_EXE', config['iscc']) if not config['iscc'].lower().endswith('iscc.exe'): print "Invalid location for the ISCC.exe program. '%s' is not a iscc.exe." % config['iscc'] sys.exit(1) if not 'output_dir' in config: print "Invalid config file. output_dir not set." sys.exit(1) else: dist_dir = os.path.abspath(os.path.join(script_dir, config['output_dir'])) if not os.path.isdir(dist_dir): os.makedirs(dist_dir)
def load_config(): global config if not os.path.isfile(os.path.join(script_dir, CONFIG_FILE)): print "Could not find config file '%s'" % os.path.abspath(os.path.join(script_dir, CONFIG_FILE)) choice = raw_input("\nDo you want to create a stub ? [yN] : " % current_b3_version) if choice.lower() == 'y': create_config_file_stub() print "config file stub created" sys.exit(0) else: sys.exit(0) from b3.lib import yaml with open(CONFIG_FILE, 'r') as f: config = yaml.load(f) if not 'innosetup_scripts' in config: print "Invalid config file. Could not find 'innosetup_scripts'." sys.exit(1) if not len(config['innosetup_scripts']): print "Invalid config file. No script found in 'innosetup_scripts' section." sys.exit(1) if not 'iscc' in config: print "Invalid config file. Could not find 'iscc'." sys.exit(1) if not os.path.isfile(os.path.abspath(os.path.join(script_dir, config['iscc']))): print "Invalid config file. '%s' is not a file." % config['iscc'] sys.exit(1) if not config['iscc'].lower().endswith('iscc.exe'): print "Invalid config file. '%s' is not a iscc.exe." % config['iscc'] sys.exit(1) if not 'output_dir' in config: print "Invalid config file. output_dir not set." sys.exit(1) else: dist_dir = os.path.abspath(os.path.join(script_dir, config['output_dir'])) if not os.path.isdir(dist_dir): os.makedirs(dist_dir)