forked from web2py/web2py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
web2py.py
executable file
·33 lines (28 loc) · 914 Bytes
/
web2py.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
if '__file__' in globals():
path = os.path.dirname(os.path.abspath(__file__))
elif hasattr(sys, 'frozen'):
path = os.path.dirname(os.path.abspath(sys.executable)) # for py2exe
else: # should never happen
path = os.getcwd()
os.chdir(path)
sys.path = [path] + [p for p in sys.path if not p == path]
# import gluon.import_all ##### This should be uncommented for py2exe.py
import gluon.widget
# Start Web2py and Web2py cron service!
if __name__ == '__main__':
try:
from multiprocessing import freeze_support
freeze_support()
except:
sys.stderr.write('Sorry, -K only supported for python 2.6-2.7\n')
if os.environ.has_key("COVERAGE_PROCESS_START"):
try:
import coverage
coverage.process_startup()
except:
pass
gluon.widget.start(cron=True)