示例#1
0
 def set_visible(self, enabled):
     if enabled and \
        self.module is None and \
        not self.toolWindow().isFloating() and \
        not QVersionProp.instance().toolWindow().isFloating() and \
        not self.toolWindow().visibleRegion().isEmpty():
         QVersionProp.instance().set_visible(True)
     else:
         super(QModuleInfo, self).set_visible(enabled)
示例#2
0
 def set_visible(self, enabled):
     if enabled and \
        self.module is None and \
        not self.toolWindow().isFloating() and \
        not QVersionProp.instance().toolWindow().isFloating() and \
        not self.toolWindow().visibleRegion().isEmpty():
         QVersionProp.instance().set_visible(True)
     else:
         super(QModuleInfo, self).set_visible(enabled)
示例#3
0
    def update_module(self, module=None):
        for plist in self.ports_lists:
            plist.types_visible = self.types_visible
            plist.ports_visible = self.ports_visible
        self.module = module
        for ports_list in self.ports_lists:
            ports_list.update_module(module)
        self.annotations.updateModule(module)

        if module is None:
            # We show the version properties tab if both are tabified and
            # self is visible
            if not self.toolWindow().isFloating() and \
               not QVersionProp.instance().toolWindow().isFloating() and \
               not self.toolWindow().visibleRegion().isEmpty():
                QVersionProp.instance().set_visible(True)
            self.name_edit.setText("")
            if not versions_increasing(QtCore.QT_VERSION_STR, '4.7.0'):
                self.name_edit.setPlaceholderText("")
            # self.name_edit.setEnabled(False)
            self.type_edit.setText("")
            # self.type_edit.setEnabled(False)
            self.package_edit.setText("")
            self.namespace_edit.setText("")
            self.module_id.setText("")
        else:
            # We show self  if both are tabified and
            # the version properties tab is visible
            if not self.toolWindow().isFloating() and \
               not QVersionProp.instance().toolWindow().isFloating() and \
               not QVersionProp.instance().toolWindow().visibleRegion().isEmpty():
                self.set_visible(True)
            if module.has_annotation_with_key('__desc__'):
                label = module.get_annotation_by_key('__desc__').value.strip()
            else:
                label = ''
            self.name_edit.setText(label)
            if not label and not versions_increasing(QtCore.QT_VERSION_STR, 
                                                     '4.7.0'):
                self.name_edit.setPlaceholderText(self.module.name)

            self.type_edit.setText(self.module.name)
            self.package_edit.setText(self.module.package)
            if self.module.namespace is not None:
                self.namespace_edit.setText(self.module.namespace.replace('|',
                                                                          '/'))
            else:
                self.namespace_edit.setText('')
            self.module_id.setText('%d' % self.module.id)
示例#4
0
    def update_module(self, module=None):
        for plist in self.ports_lists:
            plist.types_visible = self.types_visible
            plist.ports_visible = self.ports_visible
        self.module = module
        for ports_list in self.ports_lists:
            ports_list.update_module(module)
        self.annotations.updateModule(module)

        if module is None:
            # We show the version properties tab if both are tabified and
            # self is visible
            if not self.toolWindow().isFloating() and \
               not QVersionProp.instance().toolWindow().isFloating() and \
               not self.toolWindow().visibleRegion().isEmpty():
                QVersionProp.instance().set_visible(True)
            self.name_edit.setText("")
            if not versions_increasing(QtCore.QT_VERSION_STR, '4.7.0'):
                self.name_edit.setPlaceholderText("")
            # self.name_edit.setEnabled(False)
            self.type_edit.setText("")
            # self.type_edit.setEnabled(False)
            self.package_edit.setText("")
            self.namespace_edit.setText("")
            self.module_id.setText("")
        else:
            # We show self  if both are tabified and
            # the version properties tab is visible
            if not self.toolWindow().isFloating() and \
               not QVersionProp.instance().toolWindow().isFloating() and \
               not QVersionProp.instance().toolWindow().visibleRegion().isEmpty():
                self.set_visible(True)
            if module.has_annotation_with_key('__desc__'):
                label = module.get_annotation_by_key('__desc__').value.strip()
            else:
                label = ''
            self.name_edit.setText(label)
            if not label and not versions_increasing(QtCore.QT_VERSION_STR,
                                                     '4.7.0'):
                self.name_edit.setPlaceholderText(self.module.name)

            self.type_edit.setText(self.module.name)
            self.package_edit.setText(self.module.package)
            if self.module.namespace is not None:
                self.namespace_edit.setText(
                    self.module.namespace.replace('|', '/'))
            else:
                self.namespace_edit.setText('')
            self.module_id.setText('%d' % self.module.id)
示例#5
0
    def testMashup(self):
        from vistrails import api
        view = api.open_vistrail_from_file(self.filename)
        c = view.controller

        c.flush_delayed_actions()
        id = "80f58f50-57b1-11e5-a1da-000c2960b7d8"
        mashup = view.get_mashup_from_mashuptrail_id(id, "SuspendOnce")
        self.assert_(mashup)

        view.open_mashup(mashup)
        self.assertEqual(len(c.jobMonitor.workflows.keys()), 1)
        self.assertFalse(c.jobMonitor.workflows.values()[0].completed())

        # close associated mashup apps
        from vistrails.gui.version_prop import QVersionProp
        version_prop = QVersionProp.instance()
        for app in version_prop.versionMashups.apps.values():
            app.close()

        view.open_mashup(mashup)
        self.assertEqual(len(c.jobMonitor.workflows.keys()), 1)
        self.assertTrue(c.jobMonitor.workflows.values()[0].completed())

        for i in c.jobMonitor.workflows.keys():
            c.jobMonitor.deleteWorkflow(i)
示例#6
0
    def testMashup(self):
        from vistrails import api
        view = api.open_vistrail_from_file(self.filename)
        c = view.controller

        c.flush_delayed_actions()
        id = "80f58f50-57b1-11e5-a1da-000c2960b7d8"
        mashup = view.get_mashup_from_mashuptrail_id(id, "SuspendOnce")
        self.assert_(mashup)

        view.open_mashup(mashup)
        self.assertEqual(len(c.jobMonitor.workflows.keys()), 1)
        self.assertFalse(c.jobMonitor.workflows.values()[0].completed())

        # close associated mashup apps
        from vistrails.gui.version_prop import QVersionProp
        version_prop = QVersionProp.instance()
        for app in version_prop.versionMashups.apps.values():
            app.close()

        view.open_mashup(mashup)
        self.assertEqual(len(c.jobMonitor.workflows.keys()), 1)
        self.assertTrue(c.jobMonitor.workflows.values()[0].completed())

        for i in c.jobMonitor.workflows.keys():
            c.jobMonitor.deleteWorkflow(i)
示例#7
0
 def result_version_selected(self, version_id, by_click, do_validate=True,
                             from_root=False, double_click=False):
     if by_click:
         hide_upgrades = getattr(get_vistrails_configuration(),
                                     'hideUpgrades', True)
         self.query_controller.search.setCurrentController(
             self.vt_controller)
         self.vt_controller.change_selected_version(version_id, hide_upgrades,
                                                    hide_upgrades, from_root)
         if double_click:
             self.query_controller.set_level(QueryController.LEVEL_WORKFLOW)
             self.query_controller.show_workflow_matches()
     # set version prop directly
     from vistrails.gui.version_prop import QVersionProp
     prop = QVersionProp.instance()
     prop.set_visible(True)
     prop.updateController(self.vt_controller)
     prop.updateVersion(version_id)
示例#8
0
 def result_version_selected(self,
                             version_id,
                             by_click,
                             do_validate=True,
                             from_root=False,
                             double_click=False):
     if by_click:
         hide_upgrades = getattr(get_vistrails_configuration(),
                                 'hideUpgrades', True)
         self.query_controller.search.setCurrentController(
             self.vt_controller)
         self.vt_controller.change_selected_version(version_id,
                                                    hide_upgrades,
                                                    hide_upgrades,
                                                    from_root)
         if double_click:
             self.query_controller.set_level(QueryController.LEVEL_WORKFLOW)
             self.query_controller.show_workflow_matches()
     # set version prop directly
     from vistrails.gui.version_prop import QVersionProp
     prop = QVersionProp.instance()
     prop.set_visible(True)
     prop.updateController(self.vt_controller)
     prop.updateVersion(version_id)