-
Notifications
You must be signed in to change notification settings - Fork 33
/
webmGenerator.py
42 lines (32 loc) · 1.04 KB
/
webmGenerator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python3
try:
import logging
import sys
import os
import traceback
print("Initial working directory", os.getcwd())
if getattr(sys, 'frozen', False):
os.chdir(os.path.abspath(os.path.realpath(os.path.dirname(sys.executable))))
else:
os.chdir(os.path.abspath(os.path.realpath(os.path.dirname(__file__))))
print("Current working directory", os.getcwd())
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s] %(message)s",
handlers=[
logging.FileHandler("debug.log"),
logging.StreamHandler()
]
)
logging.info('Startup.')
from src.webmGeneratorController import WebmGeneratorController
initialFiles = sys.argv[1:]
webmGenerator = WebmGeneratorController(initialFiles)
webmGenerator()
del webmGenerator
except Exception as e:
logging.error('Startup Exception',exc_info=e)
logging.error(traceback.format_exc())
logging.info('DONE')
sys.exit()
os.kill()