handlers check for 'applications' folder

This commit is contained in:
mdipierro
2013-08-27 16:57:54 -05:00
committed by Michele Comitini
parent 72b3092ef6
commit 13c782eaa6
9 changed files with 32 additions and 4 deletions

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

View File

@@ -1,3 +1,3 @@
This folder contains example files.
They much be copied to the web2py root folder in order to work properly.
They should not be linked in the handlers folder.
This folder contains example handlers.
They must be copied to the web2py root folder in order to work properly.
They should not be used in their current location.

View File

@@ -56,6 +56,10 @@ import wsgiref.handlers
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]
import gluon.main

View File

@@ -34,6 +34,10 @@ import os
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]
import gluon.main

View File

@@ -33,6 +33,12 @@ import wsgiref.handlers
import datetime
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.modules['cPickle'] = sys.modules['pickle']

View File

@@ -10,6 +10,8 @@ def __ExtensionFactory__():
import sys
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]
import gluon.main
import isapi_wsgi

View File

@@ -34,6 +34,10 @@ from mod_python import apache
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]
import gluon.main

View File

@@ -47,6 +47,10 @@ import os
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]
import gluon.main

View File

@@ -26,6 +26,10 @@ import os
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.stdout = sys.stderr