hack to make bins work without PYTHONPATH
This commit is contained in:
11
bin/_pathfix.py
Normal file
11
bin/_pathfix.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
"""
|
||||||
|
Hack to get scripts to run from source checkout without having to set
|
||||||
|
PYTHONPATH.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from os.path import dirname, join, abspath
|
||||||
|
|
||||||
|
bin_path = dirname(__file__)
|
||||||
|
project_path = abspath(join(bin_path, ".."))
|
||||||
|
sys.path.insert(0, project_path)
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
# Set PYTHONPATH in lighttpd or other server config.
|
||||||
|
|
||||||
from flup.server.fcgi import WSGIServer
|
from flup.server.fcgi import WSGIServer
|
||||||
|
|
||||||
from mhapi.web.wsgi import application
|
from mhapi.web.wsgi import application
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ For great luck, replace 69 with 90
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import _pathfix
|
||||||
|
|
||||||
from mhapi import stats
|
from mhapi import stats
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
|
import _pathfix
|
||||||
|
|
||||||
from mhapi.db import MHDB
|
from mhapi.db import MHDB
|
||||||
from mhapi import rewards
|
from mhapi import rewards
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import _pathfix
|
||||||
|
|
||||||
from mhapi.web.wsgi import application
|
from mhapi.web.wsgi import application
|
||||||
|
|
||||||
LISTEN_HOST = ""
|
LISTEN_HOST = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user