Exemplo n.º 1
0
    def invalidate_current_pipeline(self):
        # Reconstruct the current pipelines from root
        from core.interpreter.cached import CachedInterpreter
        CachedInterpreter.flush()

        def reload_view(view):
            view.version_selected(view.controller.current_version,
                                  True,
                                  from_root=True)

        #    def reload_tab(tab):
        #        scene = tab.scene()
        #        if scene.current_pipeline:
        #            scene.current_pipeline.is_valid = False
        #            scene.current_pipeline= \
        #                view.controller.vistrail.getPipeline(
        #                                                scene.current_version)
        #            view.controller.validate(scene.current_pipeline)
        #            scene.setupScene(scene.current_pipeline)
        #
        #    for i in xrange(view.stack.count()):
        #        tab = view.stack.widget(i)
        #        if isinstance(tab, QPipelineView):
        #            reload_tab(tab)
        #    for tab in view.detached_views:
        #        if isinstance(tab, QPipelineView):
        #            reload_tab(tab)

        from gui.vistrails_window import _app
        for i in xrange(_app.stack.count()):
            view = _app.stack.widget(i)
            reload_view(view)
        for view in _app.windows:
            reload_view(view)
Exemplo n.º 2
0
    def invalidate_current_pipeline(self):
        # Reconstruct the current pipelines from root
        from core.interpreter.cached import CachedInterpreter
        CachedInterpreter.flush()
        def reload_view(view):
            view.version_selected(view.controller.current_version,
                                  True, from_root=True)
        #    def reload_tab(tab):
        #        scene = tab.scene()
        #        if scene.current_pipeline:
        #            scene.current_pipeline.is_valid = False
        #            scene.current_pipeline= \
        #                view.controller.vistrail.getPipeline(
        #                                                scene.current_version)
        #            view.controller.validate(scene.current_pipeline)
        #            scene.setupScene(scene.current_pipeline)
        #
        #    for i in xrange(view.stack.count()):
        #        tab = view.stack.widget(i)
        #        if isinstance(tab, QPipelineView):
        #            reload_tab(tab)
        #    for tab in view.detached_views:
        #        if isinstance(tab, QPipelineView):
        #            reload_tab(tab)

        from gui.vistrails_window import _app
        for i in xrange(_app.stack.count()):
            view = _app.stack.widget(i)
            reload_view(view)
        for view in _app.windows:
            reload_view(view)
Exemplo n.º 3
0
def reload_scripts():
    global cl_tools
    from core.interpreter.cached import CachedInterpreter
    CachedInterpreter.flush()

    reg = core.modules.module_registry.get_module_registry()
    for tool_name in cl_tools.keys():
        reg.delete_module(identifier, tool_name)
        del cl_tools[tool_name]
    if "CLTools" == name:
        # this is the original package
        location = os.path.join(core.system.default_dot_vistrails(), "CLTools")
        # make sure dir exist
        if not os.path.isdir(location):
            try:
                debug.log("Creating CLTools directory...")
                os.mkdir(location)
            except:
                debug.critical("""Could not create CLTools directory. Make
 sure '%s' does not exist and parent directory is writable""" % location)
                sys.exit(1)
    else:
        # this is a standalone package so modules are placed in this directory
        location = os.path.dirname(__file__)

    for path in os.listdir(location):
        if path.endswith(SUFFIX):
            try:
                add_tool(os.path.join(location, path))
            except Exception as exc:
                import traceback
                debug.critical(
                    "Package CLTools failed to create module "
                    "from '%s': %s" % (os.path.join(location, path), str(exc)),
                    traceback.format_exc())
def reload_scripts():
    global cl_tools
    from core.interpreter.cached import CachedInterpreter

    CachedInterpreter.flush()

    reg = core.modules.module_registry.get_module_registry()
    for tool_name in cl_tools.keys():
        reg.delete_module(identifier, tool_name)
        del cl_tools[tool_name]
    if "CLTools" == name:
        # this is the original package
        location = os.path.join(core.system.default_dot_vistrails(), "CLTools")
        # make sure dir exist
        if not os.path.isdir(location):
            try:
                debug.log("Creating CLTools directory...")
                os.mkdir(location)
            except:
                debug.critical(
                    """Could not create CLTools directory. Make
 sure '%s' does not exist and parent directory is writable"""
                    % location
                )
                sys.exit(1)
    else:
        # this is a standalone package so modules are placed in this directory
        location = os.path.dirname(__file__)

    for path in os.listdir(location):
        if path.endswith(SUFFIX):
            try:
                add_tool(os.path.join(location, path))
            except Exception as exc:
                import traceback

                debug.critical(
                    "Package CLTools failed to create module "
                    "from '%s': %s" % (os.path.join(location, path), str(exc)),
                    traceback.format_exc(),
                )