fix: change directory

pull/38/head
Raphaël Vinot 2018-05-04 17:25:23 +02:00
parent c300089624
commit 198810105a
1 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import re
@ -329,6 +330,8 @@ if __name__ == '__main__':
syslog.openlog(logoption=syslog.LOG_PID, facility=syslog.LOG_USER)
syslog.syslog("Job started.")
os.chdir(Path(__file__).cwd())
configmodule = Path(__file__).name.replace('.py', '_config')
if Path(f'{configmodule}.py').exists():
config = importlib.import_module(configmodule)