#!/usr/bin/env python

import sys
sys.stdout = sys.stderr

import sys
sys.path.insert(0, '/home/weblab/lms4labs/labmanager')

activate_this = '/home/weblab/lms4labs/labmanager/env/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))

from labmanager.server import app as application
application.config.from_object('config')

@@ -27,179 +27,547 @@
 ort 
-sys%0Asys.stdout = sys.stderr%0A%0Aimport sys%0Asys.path.insert(0, '/home/weblab/lms4labs/labmanager')%0A%0Aactivate_this = '/home/weblab/lms4labs/labmanager/env/bin/activate_this.py'
+os%0A%0ALABMANAGER_DIR = '/home/weblab/lms4labs/labmanager'%0A%0Aif not os.path.exists(LABMANAGER_DIR):%0A    raise Exception(%22LABMANAGER PATH NOT FOUND%22)%0A%0AVIRTUALENV_SCRIPT = os.path.join(LABMANAGER_DIR, 'env', 'bin', 'activate_this.py')%0Aif not os.path.exists(VIRTUALENV_SCRIPT):%0A    VIRTUALENV_SCRIPT = os.path.join(LABMANAGER_DIR, 'env', 'Scripts', 'activate_this.py')%0A    if not os.path.exists(VIRTUALENV_SCRIPT):%0A        raise Exception(%22virtualenv not found%22)%0A%0Aimport sys%0Asys.stdout = sys.stderr%0A%0Aimport sys%0Asys.path.insert(0, LABMANAGER_DIR)%0A
 %0Aexe
@@ -601,29 +601,33 @@
 _file__=
-activate_this
+VIRTUALENV_SCRIPT
 ))%0A%0Afrom

Refactor run_wsgi.wsgi