auth/nstart.py
Go to the documentation of this file.
1 # this starts up the python enviroment
2 #
3 # The root dir should point to the top of the python tree
4 
5 import os, sys
6 
7 PKG = 'webui' # this package name
8 import roslib; roslib.load_manifest(PKG)
9 
10 if 1:
11  script_dir = ''
12  try:
13  script_name = sys.argv[0]
14  while 1:
15  script_dir = os.path.dirname(script_name)
16  if not os.path.islink(script_name):
17  break
18  script_name = os.path.join(script_dir, os.readlink(script_name))
19  except KeyError, reason:
20  pass
21  except AttributeError, reason:
22  pass
23 
24  script_dir = os.path.join(os.getcwd(), script_dir)
25  script_dir = os.path.normpath(script_dir)
26 
27  path = script_dir
28 
29  ROOT_DIR = os.path.join(path, "..")
30  ROOT_DIR = os.path.normpath(ROOT_DIR)
31 else:
32  ROOT_DIR = ".."
33 
34 sys.path.append(ROOT_DIR)
35 
36 from neo_paths import paths
37 sys.path = paths(ROOT_DIR) + sys.path
38 sys.path.append(os.path.join(ROOT_DIR, "mod/mail"))
39 
40 # don't put anything above this because the path isn't
41 # extended yet...
42 
43 import neo_cgi
44 try:
45  # newer versions have an update function that will guaruntee that
46  # neo_util and neo_cs are also loaded when used with non single interpreter
47  # versions of PyApache
48  neo_cgi.update()
49 except:
50  pass
def paths(root_dir)
Definition: neo_paths.py:5


webui
Author(s): Scott Hassan
autogenerated on Mon Jun 10 2019 15:51:24