def main(argv): parser = optparse.OptionParser() parser.add_option("-o", "--outfile", action="store", type=str, dest="outfile_name", default=None, help="name of output file") opts, args = parser.parse_args(argv) if len(args) < 2: sDir = loadconfig.get_config_dir() else: sDir = args[1] sDir = path.abspath(sDir) sys.path.append(sDir) dictConfig = loadconfig.load_config_file(sDir) try: check_directory(sDir, dictConfig) except MissingFileException as mfexn: print("Failed to find required file '%s' in directory %s" % (mfexn.sFile, mfexn.sDir)) return 1 sDestDir = create_build_dir(sDir, dictConfig, None) LOG_FILENAME = path.join(sDestDir, "build.log") logging.basicConfig(filename=LOG_FILENAME, level=logging.debug) populate_build_dir(sDir, sDestDir, dictConfig) tar_build_dir(sDestDir) return 0
def main(argv): parser = optparse.OptionParser() parser.add_option("-o", "--outfile", action="store", type=str, dest="outfile_name", default=None, help="name of output file") opts,args = parser.parse_args(argv) if len(args) < 2: sDir = loadconfig.get_config_dir() else: sDir = args[1] sDir = path.abspath(sDir) sys.path.append(sDir) dictConfig = loadconfig.load_config_file(sDir) try: check_directory(sDir,dictConfig) except MissingFileException as mfexn: print ("Failed to find required file '%s' in directory %s" % (mfexn.sFile, mfexn.sDir)) return 1 sDestDir = create_build_dir(sDir,dictConfig,None) LOG_FILENAME = path.join(sDestDir,"build.log") logging.basicConfig(filename=LOG_FILENAME,level=logging.debug) populate_build_dir(sDir,sDestDir,dictConfig) tar_build_dir(sDestDir) return 0
def main(argv): import loadconfig sConfDir = loadconfig.get_config_dir() sys.path.append(sConfDir) dictConf = loadconfig.load_config_file(sConfDir) mod = __import__(dictConf["workmodule"].rsplit('.',1)[0]) #import dtree print dump_code_objects(get_objects(mod), True)
def prepare_test(sDirBase, sArchiveDir): sConfigDir = loadconfig.get_config_dir() dictConfig = loadconfig.load_config_file(sConfigDir) sChrootDir = build_chroot(sDirBase, sConfigDir, dictConfig) sWorkMod = dictConfig["workmodule"] for sFile in liat_archives(sArchiveDir, sConfigDir): sBase = path.splitext(path.basename(sFile))[0] sWorkModContents = extrac_work_module(sFile, sWorkMod) outfile = open(path.join(sChrootDir, sWorkMod), 'wb') outfile.write(sWorkModContents) break
def spawn(sDir, iPort, sStaticDirPath, dblDelayMs=500): eventlog.init() dictConfig = loadconfig.load_config_file(sDir) GLOBAL_STATE["modTask"] = load_module(dictConfig["taskmodule"]) GLOBAL_STATE["modTest"] = load_module(dictConfig["testmodule"]) GLOBAL_STATE["modWork"] = load_module(dictConfig["workmodule"]) GLOBAL_STATE["sStatic"] = sStaticDirPath GLOBAL_STATE["dictConfig"] = dictConfig httpd = BaseHTTPServer.HTTPServer(("localhost",iPort),TaskRequestHandler) tr = fork_httpd(httpd) webbrowser.open("http://localhost:%d/" % iPort) try: while True: tr.join(dblDelayMs) except KeyboardInterrupt: httpd.shutdown() print "\nReceived SIGTERM, exiting..." sys.exit(-signal.SIGTERM)
def spawn(sDir, iPort, sStaticDirPath, dblDelayMs=500): eventlog.init() dictConfig = loadconfig.load_config_file(sDir) GLOBAL_STATE["modTask"] = load_module(dictConfig["taskmodule"]) GLOBAL_STATE["modTest"] = load_module(dictConfig["testmodule"]) GLOBAL_STATE["modWork"] = load_module(dictConfig["workmodule"]) GLOBAL_STATE["sStatic"] = sStaticDirPath GLOBAL_STATE["dictConfig"] = dictConfig httpd = BaseHTTPServer.HTTPServer(("localhost", iPort), TaskRequestHandler) tr = fork_httpd(httpd) webbrowser.open("http://localhost:%d/" % iPort) try: while True: tr.join(dblDelayMs) except KeyboardInterrupt: httpd.shutdown() print "\nReceived SIGTERM, exiting..." sys.exit(-signal.SIGTERM)