def main(): args = parser.parse_args() try: uploader = ApplicantUploader(args.token) except AssertionError: LOG.error(f"Error durinng uploader initialization") sys.exit(1) if files := scan_directory(args.base_dir, BASE_FILENAME): for applicant in get_applicants_info(files, args.row): LOG.debug(f"Start uploading") # загружаем резюме resume_info = uploader.upload_file(applicant.file_path) # формируем json для загрузки кандидата body = uploader.collect_parsed_data(resume_info) # полученные из .xlsx файла данные имеют приоритет body.update(get_fio(applicant)) body.update({"money": applicant.salary}) # загружаем кандидата if response := uploader.upload_applicant(body): # устанавливаем его на вакансию applicant_id = response.get("id") uploader.set_vacancy(applicant, applicant_id)
res_params = {} res_params_type = {} res_params_title = {} for parameter in testparams: if parameter.hasAttribute("Value") and parameter.getAttribute("Value") != "" and parameter.hasAttribute("Name") and parameter.getAttribute("Name") != "": res_params[parameter.getAttribute("Name")] = float(parameter.getAttribute("Value")) if parameter.hasAttribute("Type") and parameter.getAttribute("Type") !="": res_params_type[parameter.getAttribute("Name")] = parameter.getAttribute("Type") if parameter.hasAttribute("Title") and parameter.getAttribute("Title") !="": res_params_title[parameter.getAttribute("Name")] = parameter.getAttribute("Title") res_stats = scan_directory(theDirectory=last_res_dir, scanSub=True, key="statistics", ext=".txt", withPath=True, withExt=True) error = False html = """<html><title>Pylot Test Result Summary</title>""" html += """<link rel="stylesheet" type="text/css" href="../../pylot.css" title="default"/>""" html += """\n<body><div id="wrapper-container">\n<div id="container">\n""" html+= """<div id="header"><h1 class="left"><img src="%s/biomedtown.jpg" /></h1><h2 class="left">Pylot Test Result Summary</h2></div>""" % img_dir html += """<br /><span class="testDate"> Test Run :%s </span><br /> """ % res_date html += """<div class="testSummary"> <h4>Test Parameters</h4>\n <table>\n""" for par in res_params.keys():
if ( parameter.hasAttribute("Value") and parameter.getAttribute("Value") != "" and parameter.hasAttribute("Name") and parameter.getAttribute("Name") != "" ): res_params[parameter.getAttribute("Name")] = float(parameter.getAttribute("Value")) if parameter.hasAttribute("Type") and parameter.getAttribute("Type") != "": res_params_type[parameter.getAttribute("Name")] = parameter.getAttribute("Type") if parameter.hasAttribute("Title") and parameter.getAttribute("Title") != "": res_params_title[parameter.getAttribute("Name")] = parameter.getAttribute("Title") res_stats = scan_directory( theDirectory=last_res_dir, scanSub=True, key="statistics", ext=".txt", withPath=True, withExt=True ) error = False html = """<html><title>Pylot Test Result Summary</title>""" html += """<link rel="stylesheet" type="text/css" href="../../pylot.css" title="default"/>""" html += """\n<body><div id="wrapper-container">\n<div id="container">\n""" html += ( """<div id="header"><h1 class="left"><img src="%s/biomedtown.jpg" /></h1><h2 class="left">Pylot Test Result Summary</h2></div>""" % img_dir ) html += """<br /><span class="testDate"> Test Run :%s </span><br /> """ % res_date html += """<div class="testSummary"> <h4>Test Parameters</h4>\n <table>\n""" for par in res_params.keys():
command_lines = [] dom = xml.dom.minidom.parse('./config.xml') testparams = dom.getElementsByTagName("TestCaseParameter") command_line = "%s run.py " % (pythoncmd) for parameter in testparams: if parameter.hasAttribute("Value") and parameter.getAttribute("Value") != "": command_line = "%s %s %s" % (command_line, parameter.getAttribute("Directive"),parameter.getAttribute("Value")) print command_line my_testcases = scan_directory(theDirectory="%s/testcases"%(os.getcwd()), scanSub=True, key="", ext=".xml", withPath=False, withExt=True) print my_testcases for test in my_testcases: command_lines.append( "%s -n %s -x ./testcases/%s -o %s \n" % (command_line, test.replace(".xml",""), test, res_dir ) ) command_lines.append("echo OK") batfile = open("start.bat","w") batfile.writelines(command_lines) batfile.close() lastRun = open("lastRun.txt","w") lastRun.write(res_dir)