nstart.py
Go to the documentation of this file.
00001 # this starts up the python enviroment
00002 # 
00003 # The root dir should point to the top of the python tree
00004 
00005 import os, sys
00006 
00007 PKG = 'webui' # this package name
00008 import roslib; roslib.load_manifest(PKG) 
00009 
00010 if 1:
00011   script_dir = ''
00012   try:
00013     script_name = sys.argv[0]
00014     while 1:
00015       script_dir = os.path.dirname(script_name)
00016       if not os.path.islink(script_name):
00017         break
00018       script_name = os.path.join(script_dir, os.readlink(script_name))
00019   except KeyError, reason:
00020     pass
00021   except AttributeError, reason:
00022     pass
00023 
00024   script_dir = os.path.join(os.getcwd(), script_dir)
00025   script_dir = os.path.normpath(script_dir)
00026 
00027   path = script_dir
00028 
00029   ROOT_DIR = os.path.join(path, "..")
00030   ROOT_DIR = os.path.normpath(ROOT_DIR)
00031 else:
00032   ROOT_DIR = ".."
00033 
00034 sys.path.append(ROOT_DIR)
00035 
00036 from neo_paths import paths
00037 sys.path = paths(ROOT_DIR) + sys.path
00038 sys.path.append(os.path.join(ROOT_DIR, "mod/mail"))
00039 
00040 # don't put anything above this because the path isn't
00041 # extended yet...
00042 
00043 import neo_cgi
00044 try:
00045   # newer versions have an update function that will guaruntee that
00046   # neo_util and neo_cs are also loaded when used with non single interpreter
00047   # versions of PyApache
00048   neo_cgi.update()
00049 except:
00050   pass


webui
Author(s): Scott Hassan/hassan@willowgarage.com
autogenerated on Wed Apr 23 2014 10:36:00