thirdparty/google_appengine/dev_appserver.py
changeset 1278 a7766286a7be
parent 828 f5fd65cc3bf3
child 2287 f668847ebb75
equal deleted inserted replaced
1277:5c931bd3dc1e 1278:a7766286a7be
    46 
    46 
    47 SCRIPT_EXCEPTIONS = {
    47 SCRIPT_EXCEPTIONS = {
    48   "dev_appserver.py" : "dev_appserver_main.py"
    48   "dev_appserver.py" : "dev_appserver_main.py"
    49 }
    49 }
    50 
    50 
    51 def run_file(file_path, globals_):
    51 def run_file(file_path, globals_, script_dir=SCRIPT_DIR):
    52   """Execute the file at the specified path with the passed-in globals."""
    52   """Execute the file at the specified path with the passed-in globals."""
    53   sys.path = EXTRA_PATHS + sys.path
    53   sys.path = EXTRA_PATHS + sys.path
    54   script_name = os.path.basename(file_path)
    54   script_name = os.path.basename(file_path)
    55   script_name = SCRIPT_EXCEPTIONS.get(script_name, script_name)
    55   script_name = SCRIPT_EXCEPTIONS.get(script_name, script_name)
    56   script_path = os.path.join(SCRIPT_DIR, script_name)
    56   script_path = os.path.join(script_dir, script_name)
    57   execfile(script_path, globals_)
    57   execfile(script_path, globals_)
    58 
    58 
    59 if __name__ == '__main__':
    59 if __name__ == '__main__':
    60   run_file(__file__, globals())
    60   run_file(__file__, globals())