def parse(def_config): parser = ArgumentParser(description='Generate status line output for i3bar') parser.add_argument('-c', '--config', help='absolute path to the config file', default=def_config) args = parser.parse_args() if args.config: _config = config.config(args.config) else: parser.print_usage(file=stderr) exit(1) return _config if _config else None
def _config(self): config_file = os.path.join(self.__work_dir, 'config.json') self.__config = config(config_file) self._check_error(self.__config)
def setUp(self): self.cfg = config.config('/home/gott/PycharmProjects/pystatus/pystatus.ini')
#!/usr/bin/python3 # -*- coding: utf-8 -*- # @Date : 2020/4/27 # @Author: Luokun # @Email : [email protected] import sys from tools.config import config from tools.trainer import Trainer if __name__ == '__main__': assert len(sys.argv) >= 2 Trainer(config(sys.argv[1])).fit()
from tools import common from tools import parasechemxls import report import json import os from multiprocessing import Pool import time import logging from tools.tcpclient import recvdata, senddata from tools import config import socket import sys basedir = os.path.dirname(os.path.realpath(__file__)) logger = logging.getLogger('main.sub') config = config.config() def run(resultfile): t1 = time.time() filename = os.path.basename(resultfile) filelist = list() xlsxname = filename.rstrip('.xlsx') log = common.reportlog(xlsxname) if not config: return if not filename.endswith('.xlsx'): logger.error('{}不是xlsx文件'.format(filename)) return if filename.startswith('化疗'): resutltjson = parasechemxls.run(resultfile)