metanohi/nohi.wsgi

20 lines
487 B
Python

"""WSGI interface"""
import sys
import os
_absfile = os.path.abspath(__file__)
_filedir = os.path.dirname(_absfile)
try:
import mege.server as server
except ImportError:
sys.path.insert(0, os.path.join(_filedir, 'mege'))
import mege.server as server
os.chdir(_filedir)
try:
application = server.MegeApplication()
except Exception as e:
import traceback
with open('.nohifinallog', 'w') as f:
print(e, file=f)
print(traceback.format_exc(), file=f)