ziproot = cfg.ziproot tmpdir = cfg.tmpdir this_outfolder = cfg.this_outfolder newdocxfile = cfg.newdocxfile isbn_dict = {} isbn_dict["completed"] = False template_ziproot = cfg.template_ziproot macmillan_template = cfg.macmillan_template alerts_json = cfg.alerts_json ######### SETUP LOGGING logfile = os.path.join( cfg.logdir, "{}_{}_{}.txt".format(cfg.script_name, inputfilename_noext, time.strftime("%y%m%d-%H%M%S"))) if cfg.validator_logfile: cfg.defineLogger(cfg.validator_logfile, cfg.loglevel) else: cfg.defineLogger(logfile, cfg.loglevel) logger = logging.getLogger(__name__) ######### RUN! # only run if this script is being invoked directly if __name__ == '__main__': try: ########## SETUP # copy template to tmpdir, unzip infile and tmpdir setup_cleanup.copyTemplateandUnzipFiles(macmillan_template, tmpdir, workingfile, ziproot, template_ziproot) ########## CHECK DOCUMENT
this_outfolder = cfg.this_outfolder newdocxfile = cfg.newdocxfile stylereport_json = cfg.stylereport_json alerts_json = cfg.alerts_json template_ziproot = cfg.template_ziproot macmillan_template = cfg.macmillan_template report_dict = {} report_emailed = False doc_version_min = None doc_version_max = "6.0" percent_styled_min = 50 ######### SETUP LOGGING logfile = os.path.join(cfg.logdir, "{}_{}_{}.txt".format(cfg.script_name, inputfilename_noext, time.strftime("%y%m%d-%H%M%S"))) cfg.defineLogger(logfile, cfg.loglevel) logger = logging.getLogger(__name__) # w_logger = logging.getLogger('w_logger') ######### RUN! # only run if this script is being invoked directly if __name__ == '__main__': try: ########## SETUP # get file submitter via api, copy infile to tmpdir, setup outfolder submitter_email, display_name, notdocx = setup_cleanup.setupforReporterOrConverter(inputfile, inputfilename, workingfile, this_outfolder, inputfile_ext) if notdocx == True: errstring = usertext_templates.alerts()["notdocx"].format(scriptname=cfg.script_name)