Ejemplo n.º 1
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))

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

        self.push(ns)
Ejemplo n.º 2
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))

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

        self.push(ns)
Ejemplo n.º 3
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))
Ejemplo n.º 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))