コード例 #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
コード例 #2
0
ファイル: script.py プロジェクト: brendan-donegan/checkbox
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
コード例 #3
0
ファイル: script.py プロジェクト: Alberto-Beralix/Beralix
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