def __init__(self, debug): print('filter test preparation...') self.util = util.util(debug) hatched = hatch.hatch() hatched.add("debug", debug) logger = log.log(debug, False) hatched.add("logger", logger) self.filter = filter.filtering(hatched) config.CHUNKS = 10 self.test_filter_n_shift() print('filter tests run successful.') self.filter.stop()
def create_config(cfg_ini, endless_loop, debug, plot, wave, outfile, infile, dict, error): if (cfg_ini == None): cfg = config.config() else: cfg = config.config(cfg_ini) logger = log.log(debug, error, cfg) cfg.addsection('cmdlopt') cfg.setoption('cmdlopt', 'endless_loop', str(endless_loop)) cfg.setoption('cmdlopt', 'debug', str(debug)) cfg.setoption('cmdlopt', 'plot', str(plot)) cfg.setoption('cmdlopt', 'wave', str(wave)) cfg.setoption('cmdlopt', 'outfile', outfile) cfg.setoption('cmdlopt', 'infile', infile) cfg.setoption('cmdlopt', 'dict', dict) cfg.addlogger(logger) return cfg
def main(argv): endless_loop = False debug = False outfile = None infile = None dict = None plot = False wave = False error = False print("sopare " + __version__) if (len(argv) > 0): try: opts, args = getopt.getopt(argv, "ahelpv~cous:w:r:t:d:", [ "analysis", "help", "error", "loop", "plot", "verbose", "wave", "create", "overview", "unit", "show=", "write=", "read=", "train=", "delete=" ]) except getopt.GetoptError: usage() sys.exit(2) for opt, arg in opts: if (opt in ("-h", "--help")): usage() sys.exit(0) if (opt in ("-e", "--error")): error = True if (opt in ("-l", "--loop")): endless_loop = True if (opt in ("-p", "--plot")): if (endless_loop == False): plot = True else: print("Plotting only works without loop option!") sys.exit(0) if (opt in ("-v", "--verbose")): debug = True if (opt in ("-~", "--wave")): wave = True if opt in ("-c", "--create"): recreate_dict(debug) sys.exit(0) if opt in ("-o", "--overview"): show_dict_ids(debug) sys.exit(0) if opt in ("-a", "--analysis"): show_dict_analysis(debug) sys.exit(0) if opt in ("-s", "--show"): show_word_entries(arg, debug) sys.exit(0) if opt in ("-w", "--write"): outfile = arg if opt in ("-r", "--read"): infile = arg if opt in ("-t", "--train"): dict = arg if opt in ("-d", "--delete"): delete_word(arg, debug) sys.exit(0) if opt in ("-u", "--unit"): unit_tests(debug) sys.exit(0) hatched = hatch.hatch() hatched.add("endless_loop", endless_loop) hatched.add("debug", debug) hatched.add("plot", plot) hatched.add("wave", wave) hatched.add("outfile", outfile) hatched.add("infile", infile) hatched.add("dict", dict) logger = log.log(debug, error) hatched.add("logger", logger) recorder.recorder(hatched)