def setup_homedir(usethis, force=False): """ Setting umit home directory. """ if force: Path.force_set_umit_conf(usethis) else: Path.set_umit_conf(usethis) global HOME_CONF, RUNNING_FILE HOME_CONF = os.path.split(Path.get_umit_conf())[0] RUNNING_FILE = os.path.join(HOME_CONF, 'qsrunning')
def setup_homedir(usethis, force=False): """ Setting umit home directory. """ if force: Path.force_set_umit_conf(usethis) else: Path.set_umit_conf(usethis) global HOME_CONF, RUNNING_FILE HOME_CONF = os.path.split(Path.get_umit_conf())[0] RUNNING_FILE = os.path.join(HOME_CONF, 'schedrunning')
def main(cmd, base_path, home_conf, winhndl=None): if base_path not in sys.path: sys.path.insert(0, base_path) Path.force_set_umit_conf(home_conf) log = file_log(Path.sched_log) globals()['log'] = log # Trying to adjust signals when running as a windows service won't work # since it needs to be adjusted while on the main thread. if not servicemanager.RunningAsService(): if os.name == "posix": signal.signal(signal.SIGHUP, safe_shutdown) signal.signal(signal.SIGTERM, safe_shutdown) signal.signal(signal.SIGINT, safe_shutdown) cmds = {'start': start} cmds[cmd](winhndl=winhndl)