def _rev_ini_annotator(use_dict, verbose=True): """ update revert dict by ini files Accept args: use_dict: target dict to be merged verbose: show detail message, default: True """ # ini inifiles = [] import os import ConfigParser for x in os.listdir("."): if x.endswith(".ini"): inifiles.append(x) for f in inifiles: if verbose: print "file", f conf = ConfigParser.ConfigParser() try: conf.read(f) for sect in conf.sections(): if verbose: print "sect:", sect merger(conf.items(sect), use_dict, reverse=True) except: print "!%s is not a valid keyword file" % f
def _rev_ini_annotator(use_dict, verbose=True): """ update revert dict by ini files Accept args: use_dict: target dict to be merged verbose: show detail message, default: True """ # ini inifiles = [] import os import ConfigParser for x in os.listdir("."): if x.endswith(".ini"): inifiles.append(x) for f in inifiles: if verbose: print "file", f conf = ConfigParser.ConfigParser() try: conf.read(f) for sect in conf.sections(): if verbose: print "sect:", sect merger(conf.items(sect), use_dict, reverse=True) except: print "!%s is not a valid keyword file"%f
def _trace_annotator(use_dict, entry_point, verbose=False): """ find python traceback keyword plugins and update to dicts """ for trace in entry_point: if verbose: print trace.title merger(trace.keyword, use_dict, reverse=True)
def _rev_py_annotator(use_dict, entry_point, verbose=False): """ update revert dict by python plugins 'verbose' argument is only for debug(will generate too mush messages). """ for tool in entry_point: if verbose: print tool.title merger(tool.keyword, use_dict, reverse=True)