def set_preamble(self, opts): entry = ['---'] entry.append('# Log-file created by QA-DKRZ') entry.append('configuration:') s = self.indent[1] + 'command-line: ' for arg in sys.argv: s += ' ' + arg entry.append(s) entry.append(self.indent[1] + 'options:') for kv in qa_util.get_sorted_options(opts, sep=': '): if kv[:7] == 'TABLES:': entry.append(self.indent[2] + 'TABLES:') for tkv in qa_util.get_sorted_options(opts['TABLES'], sep=': '): entry.append(self.indent[3] + '- ' + tkv) continue elif kv[:6] == 'TABLE_': # taken into account above continue elif kv[:8] == 'install:': # skip internal opt continue entry.append(self.indent[2] + kv) entry.append('start:') entry.append(self.indent[1] + 'date: ' + qa_util.date()) entry.append(self.indent[1] + 'qa-revision: ' + self.opts['QA_VERSION']) entry.append('items:') return entry
def set_preamble(self, opts): entry = ['---'] entry.append('# Log-file created by QA-DKRZ') entry.append('configuration:') s = self.indent[1] + 'command-line: ' for arg in sys.argv: s += ' ' + arg entry.append(s) entry.append(self.indent[1] + 'options:') for kv in qa_util.get_sorted_options(opts, sep=': '): if kv[:7] == 'TABLES:': entry.append(self.indent[2] + 'TABLES:') for tkv in qa_util.get_sorted_options(opts['TABLES'], sep=': '): entry.append(self.indent[3] + '- ' + tkv) continue elif kv[:6] == 'TABLE_': # taken into account above continue elif kv[:8] == 'install:': # skip internal opt continue entry.append(self.indent[2] + kv) entry.append('start:') entry.append(self.indent[1] + 'date: ' + qa_util.date()) entry.append(self.indent[1] + 'qa-revision: ' + self.opts['QA_REVISION']) entry.append('items:') return entry
g_vars.pid = str(os.getpid()) g_vars.UDUNITS2_XML_PATH = qaConf.getOpt("UDUNITS2_XML_PATH") if 'QA_EXAMPLE' in qaConf.dOpts: qaConf = prepareExample(qaConf) if isCONDA: qaConf.addOpt('CONDA', True) log = Log(qaConf.dOpts) # obj for getting and iteration next path getPaths = GetPaths(qaConf) if 'SHOW_CONF' in qaConf.dOpts: for opt in qa_util.get_sorted_options(qaConf.dOpts): # opt: key=value print opt sys.exit(0) try: # get from ~/.qa-dkrz/config.txt; also a check for incomplete installation get_version(qaConf) except: sys.exit(1) qa_init.run(log, g_vars, qaConf) # the checks if not qaConf.getOpt('ONLY_SUMMARY'): run()
if os.path.exists(f_lock): return True return False # -------- main -------- # read (may-be convert) the cfg files qa_util.cfg_parser(rawCfgPars, qaOpts.getOpt('CFG_FILE'), init=True) if 'QA_EXAMPLE' in qaOpts.dOpts: runExample() sys.exit(0) qa_init.run(log, g_vars, qaOpts, rawCfgPars, qaOpts.getOpt('CFG_FILE')) # the checks if not qaOpts.getOpt('ONLY_SUMMARY'): run() final() if __name__ == '__main__': if 'SHOW_CONF' in qaOpts.dOpts: for opt in qa_util.get_sorted_options(qaOpts.dOpts): # opt: key=value print opt