Esempio n. 1
0
def get_globals(script):
    path = posixpath.expanduser(script)
    if not posixpath.exists(path):
        path = get_path(script)
        if not path:
            raise Exception("Script not found in PATH: %s" % script)

    globals = {}
    exec(compile(open(path).read(), path, 'exec'), globals)
    return globals
Esempio n. 2
0
def get_globals(script):
    path = posixpath.expanduser(script)
    if not posixpath.exists(path):
        path = get_path(script)
        if not path:
            raise Exception("Script not found in PATH: %s" % script)

    globals = {}
    exec(compile(open(path).read(), path, 'exec'), globals)
    return globals
Esempio n. 3
0
def get_globals(script):
    path = posixpath.expanduser(script)
    if not posixpath.exists(path):
        path = get_path(script)
        if not path:
            raise Exception, "Script not found in PATH: %s" % script

    globals = {}
    execfile(path, globals)
    return globals