def _init_env(): import os, sys _dirs = ['lib', 'libs'] _d_ins = [os.path.join(sys.path[0], _d) for _d in _dirs if \ os.path.exists(os.path.join(sys.path[0], _d))] sys.path = [sys.path[0]] + _d_ins + sys.path[1:] _opts = _usage() import config config.load(_opts.config) if not config.cfg.has_section('conf'): config.cfg.add_section('conf') if not _opts.logging and 'output' in _opts: _opts.logging = os.path.join(_opts.output, 'log.txt') for _k, _v in _opts.__dict__.items(): if _v != None: config.cfg.set('conf', _k, str(_v)) import logging_util logging_util.init(_opts.logging) import file_unzip as fz fz.clean(fz.default_dir(_opts.temp)) return _opts
def _init_env(): import os, sys _d_in = os.path.join(sys.path[0], 'lib') if os.path.exists(_d_in): sys.path.append(_d_in) _opts = _usage() import logging_util logging_util.init(_opts.logging) import config config.load(_opts.config) import file_unzip as fz fz.clean(fz.default_dir(_opts.temp)) return _opts
def _init_env(): import os, sys _dirs = ['lib', 'libs'] _d_ins = [os.path.join(sys.path[0], _dirs) for _d in _dirs if \ os.path.exists(os.path.join(sys.path[0], _d))] sys.path = [sys.path[0]] + _d_ins + sys.path[1:] _opts = _usage() import logging_util logging_util.init(_opts.logging) import config config.load(_opts.config) import file_unzip as fz fz.clean(fz.default_dir(_opts.temp)) return _opts