def run(self, file):
        m = save_main_module(file, 'run_profiler')
        globals = m.__dict__
        try:
            globals['__builtins__'] = __builtins__
        except NameError:
            pass  # Not there on Jython...

        self.start_profiling()

        pydev_imports.execfile(file, globals, globals)  # execute the script

        self.stop_profiling()
        self.save_snapshot(0, generate_snapshot_filepath(base_snapshot_path))
Ejemplo n.º 2
0
    def run(self, file):
        m = save_main_module(file, 'run_profiler')
        globals = m.__dict__
        try:
            globals['__builtins__'] = __builtins__
        except NameError:
            pass  # Not there on Jython...

        self.start_profiling()

        pydev_imports.execfile(file, globals, globals)  # execute the script

        # self.stats_string()

        time.sleep(10)
Ejemplo n.º 3
0
    def run(self, file):
        m = save_main_module(file, 'run_profiler')
        globals = m.__dict__
        try:
            globals['__builtins__'] = __builtins__
        except NameError:
            pass  # Not there on Jython...

        self.start_profiling()

        pydev_imports.execfile(file, globals, globals)  # execute the script

        self.stop_profiling()
        self.save_snapshot(
            0, generate_snapshot_filepath(base_snapshot_path, remote_run),
            remote_run)
Ejemplo n.º 4
0
def run_file(file, globals=None, locals=None):
    if os.path.isdir(file):
        new_target = os.path.join(file, '__main__.py')
        if os.path.isfile(new_target):
            file = new_target

    if globals is None:
        m = save_main_module(file, 'pydev_run_in_console')

        globals = m.__dict__
        try:
            globals['__builtins__'] = __builtins__
        except NameError:
            pass  # Not there on Jython...

    if locals is None:
        locals = globals

    print('Running %s' % file)
    pydev_imports.execfile(file, globals, locals)  # execute the script

    return globals
Ejemplo n.º 5
0
def run_file(file, globals=None, locals=None):
    if os.path.isdir(file):
        new_target = os.path.join(file, "__main__.py")
        if os.path.isfile(new_target):
            file = new_target

    if globals is None:
        m = save_main_module(file, "pydev_run_in_console")

        globals = m.__dict__
        try:
            globals["__builtins__"] = __builtins__
        except NameError:
            pass  # Not there on Jython...

    if locals is None:
        locals = globals

    print("Running %s" % file)
    pydev_imports.execfile(file, globals, locals)  # execute the script

    return globals
def run_file(file, globals=None, locals=None):
    if os.path.isdir(file):
        new_target = os.path.join(file, '__main__.py')
        if os.path.isfile(new_target):
            file = new_target

    if globals is None:
        m = save_main_module(file, 'pydev_run_in_console')

        globals = m.__dict__
        try:
            globals['__builtins__'] = __builtins__
        except NameError:
            pass  # Not there on Jython...

    if locals is None:
        locals = globals

    sys.path.insert(0, os.path.split(file)[0])

    print('Running %s'%file)
    pydev_imports.execfile(file, globals, locals)  # execute the script

    return globals