cgi-bin/inc.py
changeset 18 46536daf9e04
equal deleted inserted replaced
17:adde6ad8731e 18:46536daf9e04
       
     1 if __name__ == '__main__' :
       
     2     raise Exception("Don't access inc.py directly")
       
     3 
       
     4 # setup env
       
     5 
       
     6 import sys
       
     7 import os, os.path
       
     8 
       
     9 def splitn (path, n) :
       
    10     for i in xrange(0, n) :
       
    11         path = os.path.split(path)[0]      
       
    12     
       
    13     return path
       
    14         
       
    15 degal_path = splitn(os.path.join(os.getcwd(), __file__), 2)
       
    16 
       
    17 os.chdir(degal_path)
       
    18 sys.path.append(degal_path)