コード例 #1
0
ファイル: __init__.py プロジェクト: ykneisel/topographica
    def __call__(self, source_file, ns={}, **kwargs):

        from topo.misc.commandline import global_params
        ns = ns if ns else self.ns
        for (key, val) in kwargs.items():
            global_params.exec_in_context('%s=%s' % (key,val))

        code = compile(open(source_file, 'r').read(), "<execution>", "exec")
        exec code in ns #globals and locals

        self.push(ns)
コード例 #2
0
ファイル: __init__.py プロジェクト: ykneisel/topographica
    def __call__(self, source_file, ns={}, **kwargs):

        from topo.misc.commandline import global_params
        ns = ns if ns else self.ns
        for (key, val) in kwargs.items():
            global_params.exec_in_context('%s=%s' % (key, val))

        code = compile(open(source_file, 'r').read(), "<execution>", "exec")
        exec code in ns  #globals and locals

        self.push(ns)
コード例 #3
0
ファイル: __init__.py プロジェクト: AnthonyAlers/topographica
    def __call__(self, source_file, ns={}, **kwargs):

        from topo.misc.commandline import global_params
        ns = ns if ns else self.ns
        for (key, val) in kwargs.items():
            global_params.exec_in_context('%s=%s' % (key,val))

        source_path = param.resolve_path(source_file)
        code = compile(open(source_path, 'r').read(), "<execution>", "exec")
        exec code in ns #globals and locals
        self.push(ns)
        if self.load:
            topo.sim(verbose=kwargs.get('verbose', False))
コード例 #4
0
    def __call__(self, source_file, ns={}, **kwargs):

        from topo.misc.commandline import global_params
        ns = ns if ns else self.ns
        for (key, val) in kwargs.items():
            global_params.exec_in_context('%s=%s' % (key,val))

        source_path = param.resolve_path(source_file)
        code = compile(open(source_path, 'r').read(), "<execution>", "exec")
        exec code in ns #globals and locals
        self.push(ns)
        if self.load:
            topo.sim(verbose=kwargs.get('verbose', False))