handlers check for 'applications' folder

This commit is contained in:
mdipierro authored and Michele Comitini committed 2013-08-30 17:38:50 +02:00
1 parent 72b3092ef6
commit 13c782eaa6
9 files changed
+32 -4

No files matched your search

+1 -1
View File
@@ -1 +1 @@
Version 2.6.0-development+timestamp.2013.08.27.16.49.41 Version 2.6.0-development+timestamp.2013.08.27.16.57.03
+3 -3
View File
@@ -1,3 +1,3 @@
This folder contains example files. This folder contains example handlers.
They much be copied to the web2py root folder in order to work properly. They must be copied to the web2py root folder in order to work properly.
They should not be linked in the handlers folder. They should not be used in their current location.
+4
View File
@@ -56,6 +56,10 @@ import wsgiref.handlers
path = os.path.dirname(os.path.abspath(__file__)) path = os.path.dirname(os.path.abspath(__file__))
os.chdir(path) os.chdir(path)
if not os.path.exists('applications'):
raise RuntimeError('Running from the wrong folder')
sys.path = [path] + [p for p in sys.path if not p == path] sys.path = [path] + [p for p in sys.path if not p == path]
import gluon.main import gluon.main
+4
View File
@@ -34,6 +34,10 @@ import os
path = os.path.dirname(os.path.abspath(__file__)) path = os.path.dirname(os.path.abspath(__file__))
os.chdir(path) os.chdir(path)
if not os.path.exists('applications'):
raise RuntimeError('Running from the wrong folder')
sys.path = [path] + [p for p in sys.path if not p == path] sys.path = [path] + [p for p in sys.path if not p == path]
import gluon.main import gluon.main
+6
View File
@@ -33,6 +33,12 @@ import wsgiref.handlers
import datetime import datetime
path = os.path.dirname(os.path.abspath(__file__)) path = os.path.dirname(os.path.abspath(__file__))
# os.chdir(path) ?
if not os.path.exists('applications'):
raise RuntimeError('Running from the wrong folder')
sys.path = [path] + [p for p in sys.path if not p == path] sys.path = [path] + [p for p in sys.path if not p == path]
sys.modules['cPickle'] = sys.modules['pickle'] sys.modules['cPickle'] = sys.modules['pickle']
+2
View File
@@ -10,6 +10,8 @@ def __ExtensionFactory__():
import sys import sys
path = os.path.dirname(os.path.abspath(__file__)) path = os.path.dirname(os.path.abspath(__file__))
os.chdir(path) os.chdir(path)
if not os.path.exists('applications'):
raise RuntimeError('Running from the wrong folder')
sys.path = [path] + [p for p in sys.path if not p == path] sys.path = [path] + [p for p in sys.path if not p == path]
import gluon.main import gluon.main
import isapi_wsgi import isapi_wsgi
+4
View File
@@ -34,6 +34,10 @@ from mod_python import apache
path = os.path.dirname(os.path.abspath(__file__)) path = os.path.dirname(os.path.abspath(__file__))
os.chdir(path) os.chdir(path)
if not os.path.exists('applications'):
raise RuntimeError('Running from the wrong folder')
sys.path = [path] + [p for p in sys.path if not p == path] sys.path = [path] + [p for p in sys.path if not p == path]
import gluon.main import gluon.main
+4
View File
@@ -47,6 +47,10 @@ import os
path = os.path.dirname(os.path.abspath(__file__)) path = os.path.dirname(os.path.abspath(__file__))
os.chdir(path) os.chdir(path)
if not os.path.exists('applications'):
raise RuntimeError('Running from the wrong folder')
sys.path = [path] + [p for p in sys.path if not p == path] sys.path = [path] + [p for p in sys.path if not p == path]
import gluon.main import gluon.main
+4
View File
@@ -26,6 +26,10 @@ import os
path = os.path.dirname(os.path.abspath(__file__)) path = os.path.dirname(os.path.abspath(__file__))
os.chdir(path) os.chdir(path)
if not os.path.exists('applications'):
raise RuntimeError('Running from the wrong folder')
sys.path = [path] + [p for p in sys.path if not p == path] sys.path = [path] + [p for p in sys.path if not p == path]
sys.stdout = sys.stderr sys.stdout = sys.stderr