5 from mod_python
import apache
10 env = apache.build_cgi_env(req)
12 if os.path.exists(
"/etc/ros/env"):
13 keys = os.listdir(
"/etc/ros/env/")
15 if key
not in os.environ:
16 os.environ[key] = open(
"/etc/ros/env/%s" % key).read().strip()
18 ros_root = os.environ[
'ROS_ROOT']
20 roslib_src = os.path.join(ros_root,
"core/roslib/src")
21 if not roslib_src
in sys.path:
22 sys.path.append(roslib_src)
24 if os.environ[
'PATH'].find(ros_root) == -1:
25 os.environ[
'PATH'] = os.path.join(ros_root,
'bin') +
":" + os.environ.get(
'PATH',
'')
27 os.environ[
'HOME'] =
'/tmp' 28 os.environ[
'ROS_CACHE_TIMEOUT'] =
'3600' 30 if env.get(
'PYTHON_RELOADER',
'').lower() ==
'on':
31 from pyclearsilver
import autoreloader
37 path,f = os.path.split(__file__)
42 cgistarter.setConfig(config)
43 return cgistarter.handler(req, cwd)