当前位置: 首页>>代码示例>>Python>>正文


Python ExecutableInfo.ExecutableInfo类代码示例

本文整理汇总了Python中peacock.Input.ExecutableInfo.ExecutableInfo的典型用法代码示例。如果您正苦于以下问题:Python ExecutableInfo类的具体用法?Python ExecutableInfo怎么用?Python ExecutableInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ExecutableInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setExecutablePath

    def setExecutablePath(self, app_path):
        """
        The user select a new executable path.
        Input:
            app_path: The path of the executable.
        """
        if not app_path:
            return

        self._loading_dialog.setInformativeText(app_path)
        self._loading_dialog.show()
        self._loading_dialog.raise_()
        QApplication.processEvents()

        app_info = ExecutableInfo()
        app_info.setPath(app_path, self.test_checkbox.isChecked())

        QApplication.processEvents()

        if app_info.valid():
            self.exe_line.setText(app_path)
            self.executableInfoChanged.emit(app_info)
            self.executableChanged.emit(app_path)
            files = self._exe_watcher.files()
            if files:
                self._exe_watcher.removePaths(files)
            self._exe_watcher.addPath(app_path)
        self._updateRecentExe(app_path, not app_info.valid())
        self._loading_dialog.hide()
开发者ID:aeslaughter,项目名称:moose,代码行数:29,代码来源:ExecuteOptionsPlugin.py

示例2: newWidget

 def newWidget(self):
     app_info = ExecutableInfo()
     app_info.setPath(Testing.find_moose_test_exe())
     self.assertTrue(app_info.valid())
     w = InputFileEditor()
     w.executableInfoChanged(app_info)
     w.setInputFile(self.test_input_file)
     return w
开发者ID:aeslaughter,项目名称:moose,代码行数:8,代码来源:test_InputFileEditor.py

示例3: testPickle

 def testPickle(self):
     exe_path = Testing.find_moose_test_exe()
     e = ExecutableInfo()
     e.clearCache()
     e.setPath(exe_path)
     p = e.toPickle()
     e2 = ExecutableInfo()
     e2.fromPickle(p)
     self.assertEqual(e2.path_map, e.path_map)
开发者ID:,项目名称:,代码行数:9,代码来源:

示例4: testCombined

 def testCombined(self):
     e = ExecutableInfo()
     e.setPath(Testing.find_moose_test_exe(dirname="modules/combined", exe_base="combined"))
     self.checkPath(e, "/Preconditioning", True, True)
     self.checkPath(e, "/BCs", True, True)
     self.checkPath(e, "/BCs/Pressure", True, True)
     self.checkPath(e, "/SolidMechanics", True, True)
     self.checkPath(e, "/Adaptivity", False, True)
     self.checkPath(e, "/Adaptivity/Markers", True, True)
     self.checkPath(e, "/GlobalParams", False, True)
     self.checkPath(e, "/Mesh", False, True)
     self.checkPath(e, "/AuxVariables", True, True)
     self.checkPath(e, "/AuxVariables/*/InitialCondition", False, False)
     self.checkPath(e, "/Variables/*/InitialCondition", False, False)
开发者ID:,项目名称:,代码行数:14,代码来源:

示例5: newWidget

 def newWidget(self):
     main_win = QMainWindow()
     w = InputFileEditorWithMesh(size=[640,640])
     main_win.setCentralWidget(w)
     app_info = ExecutableInfo()
     app_info.setPath(Testing.find_moose_test_exe())
     self.assertTrue(app_info.valid())
     w.onExecutableInfoChanged(app_info)
     menubar = main_win.menuBar()
     menubar.setNativeMenuBar(False)
     w.addToMainMenu(menubar)
     w.setEnabled(True)
     main_win.show()
     w.numTimeStepsChanged.connect(self.timeStepChanged)
     return main_win, w
开发者ID:,项目名称:,代码行数:15,代码来源:

示例6: createWidget

 def createWidget(self, args=[], csv_enabled=False):
     w = ExecuteRunnerPlugin()
     exe_info = ExecutableInfo()
     exe_info.setPath(self.test_exe)
     tree = InputTree(exe_info)
     tree.setInputFile(self.test_input_file)
     num_steps = TimeStepEstimate.findTimeSteps(tree)
     w.onNumTimeStepsChanged(num_steps)
     self.assertEqual(w._total_steps, 8)
     w.needCommand.connect(lambda: self.needCommand(w, args, csv_enabled))
     w.needInputFile.connect(self.needInputFile)
     w.outputAdded.connect(self.outputAdded)
     w.runProgress.connect(self.runProgress)
     w.startJob.connect(self.startJob)
     w.setEnabled(True)
     return w
开发者ID:aeslaughter,项目名称:moose,代码行数:16,代码来源:test_ExecuteRunnerPlugin.py

示例7: newWidget

 def newWidget(self, modules=False):
     app_info = ExecutableInfo()
     if modules:
         app_info.setPath(Testing.find_moose_test_exe(dirname="modules/combined", exe_base="combined"))
     else:
         app_info.setPath(Testing.find_moose_test_exe())
     tree = InputTree(app_info)
     tree.setInputFile(self.test_input_file)
     w = BlockTree(tree)
     w.changed.connect(self.changed)
     w.blockSelected.connect(self.blockSelected)
     w.blockClicked.connect(self.blockClicked)
     w.blockDoubleClicked.connect(self.blockDoubleClicked)
     #w.show()
     #w.raise_()
     return w
开发者ID:FHilty,项目名称:moose,代码行数:16,代码来源:test_BlockTree.py

示例8: testIncompatible

    def testIncompatible(self):
        t = InputTree(ExecutableInfo())
        app_info = ExecutableInfo()
        # The original tree wasn't set, any new changes
        # are not incompatible
        self.assertFalse(t.incompatibleChanges(app_info))
        app_info.json_data = {"bad_block": None}
        self.assertFalse(t.incompatibleChanges(app_info))

        # Current tree is good, new one is not
        app_info.json_data = None
        t = self.createTree(input_file=self.simple_diffusion)
        self.assertTrue(t.incompatibleChanges(app_info))
        app_info.json_data = {"bad_block": None}
        self.assertFalse(app_info.valid())
        self.assertTrue(t.incompatibleChanges(app_info))
        app_info.path ="foo"
        self.assertTrue(app_info.valid())
        self.assertTrue(t.incompatibleChanges(app_info)) # No / which causes an exception
        app_info.path_map = t.app_info.path_map.copy()
        self.assertFalse(t.incompatibleChanges(app_info)) # Should be the same, no problems

        # Simulate removing /BCs/*/<types>/DirichletBC/boundary
        # This should be fine since users can have extra parameters
        # in their input file
        root = app_info.path_map["/"]
        bcs = root.children["BCs"]
        pname = "boundary"
        tmp = bcs.star_node.types["DirichletBC"]
        p = tmp.parameters[pname]
        p.user_added = True
        tmp.removeUserParam(pname)
        p = bcs.star_node.parameters[pname]
        p.user_added = True
        bcs.star_node.removeUserParam(pname)
        tmp_tree = InputTree(app_info)

        tmp_tree.setInputFileData(t.getInputFileString())
        left = tmp_tree.getBlockInfo("/BCs/left")
        self.assertTrue(left.user_added)
        boundary = left.parameters["boundary"]
        self.assertTrue(boundary.user_added)
        self.assertTrue(boundary.set_in_input_file)
        self.assertFalse(t.incompatibleChanges(app_info))

        # Simulate removing /BCs syntax
        # This should cause a problem
        del app_info.path_map["/BCs"]
        root.children_list.remove("BCs")
        del root.children["BCs"]
        self.assertTrue(t.incompatibleChanges(app_info)) # Errors when reading the input file
开发者ID:zachmprince,项目名称:moose,代码行数:51,代码来源:test_InputTree.py

示例9: setUp

 def setUp(self):
     super(Tests, self).setUp()
     self.test_input_file = "../../common/fsp_test.i"
     self.app_info = ExecutableInfo()
     self.app_info.setPath(Testing.find_moose_test_exe())
     self.tree = InputTree(self.app_info)
     self.tree.setInputFile(self.test_input_file)
     self.assertTrue(self.app_info.valid())
     self.block_list_requested = 0
     self.block_removed_count = 0
     self.last_block_removed = 0
     self.block_cloned_count = 0
     self.last_block_cloned = 0
     self.editing_finished = False
     self.block_changed_count = 0
     self.last_block_changed = 0
开发者ID:zachmprince,项目名称:moose,代码行数:16,代码来源:test_BlockEditor.py

示例10: testTree

    def testTree(self):
        e = ExecutableInfo()
        e.clearCache()
        exe_path = Testing.find_moose_test_exe()
        e.setPath(exe_path)
        root = e.path_map["/"]
        self.assertIn("Mesh", root.children_list)
        m = root.children["Mesh"]
        self.assertEqual(m.hard, True)
        self.assertEqual(e.path_map["/Mesh"], m)

        out = e.dumpDefaultTree(hard_only=False)
        self.assertIn("Partitioner", out)
        self.assertIn("Partitioner", out)
        self.assertIn("ScalarKernels", out)
        self.assertNotIn("DirichletBC", out)
开发者ID:,项目名称:,代码行数:16,代码来源:

示例11: testInfo

    def testInfo(self):
        e = ExecutableInfo()
        e.clearCache()
        e.setPath("")
        self.assertFalse(e.valid())
        e.setPath("no_exist")
        self.assertFalse(e.valid())

        exe_path = Testing.find_moose_test_exe()
        e.setPath(exe_path)
        self.assertTrue(e.valid())

        e.setPath(exe_path)
        self.assertTrue(e.valid())

        e.setPath("")
        self.assertTrue(e.valid())

        e.setPath("no_exist")
        self.assertFalse(e.valid())

        # this should hit the cache
        e.setPath(exe_path)
        self.assertTrue(e.valid())
开发者ID:,项目名称:,代码行数:24,代码来源:

示例12: create_tree

 def create_tree(self):
     app_info = ExecutableInfo()
     app_info.setPath(Testing.find_moose_test_exe())
     self.assertTrue(app_info.valid())
     input_tree = InputTree(app_info)
     return input_tree
开发者ID:zachmprince,项目名称:moose,代码行数:6,代码来源:test_TimeStepEstimate.py

示例13: createBasic

 def createBasic(self):
     e = ExecutableInfo()
     e.setPath(Testing.find_moose_test_exe())
     t = InputTree(e)
     t.setInputFile(self.basic_input)
     return t
开发者ID:aeslaughter,项目名称:moose,代码行数:6,代码来源:test_InputTreeWriter.py

示例14: Tests

class Tests(Testing.PeacockTester):
    qapp = QApplication([])

    def setUp(self):
        super(Tests, self).setUp()
        self.test_input_file = "../../common/fsp_test.i"
        self.app_info = ExecutableInfo()
        self.app_info.setPath(Testing.find_moose_test_exe())
        self.tree = InputTree(self.app_info)
        self.tree.setInputFile(self.test_input_file)
        self.assertTrue(self.app_info.valid())
        self.block_list_requested = 0
        self.block_removed_count = 0
        self.last_block_removed = 0
        self.block_cloned_count = 0
        self.last_block_cloned = 0
        self.editing_finished = False
        self.block_changed_count = 0
        self.last_block_changed = 0

    def newWidget(self, path):
        b = self.tree.getBlockInfo(path)
        e = BlockEditor(b, self.tree.app_info.type_to_block_map)
        e.needBlockList.connect(lambda paths: self.needBlockList(e, paths))
        e.removeBlock.connect(self.removeBlock)
        e.cloneBlock.connect(self.cloneBlock)
        e.blockChanged.connect(self.blockChanged)
        e.editingFinished.connect(self.editingFinished)
        self.editing_finished = False
        return e

    def blockChanged(self, block):
        self.block_changed_count += 1
        self.last_block_changed = block

    def editingFinished(self):
        self.editing_finished = True

    def removeBlock(self, block):
        self.block_removed_count += 1
        self.last_block_removed = block

    def cloneBlock(self, block):
        self.block_cloned_count += 1
        self.last_block_cloned = block

    def needBlockList(self, e, blocks):
        self.block_list_requested += 1
        for b in blocks:
            e.setWatchedBlockList(b, ["child0", "child1", "child2"])

    def newCounter(self, node):
        self.new_node = node
        self.new_node_counter += 1

    def checkParamEditor(self, e, has_params, has_types):
        if has_types:
            self.assertTrue(isinstance(e.param_editor, ParamsByType))
        elif has_params:
            self.assertTrue(isinstance(e.param_editor, ParamsByGroup))
        else:
            self.assertTrue(isinstance(e.param_editor, ParamsTable))

    def checkButton(self, button, exists, enabled):
        if button is None:
            self.assertTrue(button is None and not exists)
        else:
            self.assertTrue(button is not None and exists)
        if button:
            self.assertEqual(button.isEnabled(), enabled)

    def checkWidget(self,
            e,
            apply_button=True,
            apply_enabled=False,
            user_block=False,
            reset_button=True,
            reset_enabled=False,
            new_param_button=True,
            new_param_enabled=True,
            has_params=False,
            has_types=False,
            comments=""
            ):
        self.checkParamEditor(e, has_params, has_types)
        self.checkButton(e.clone_button, user_block, True)
        self.checkButton(e.apply_button, apply_button, apply_enabled)
        self.checkButton(e.remove_button, user_block, True)
        self.checkButton(e.reset_button, reset_button, reset_enabled)
        self.checkButton(e.new_parameter_button, new_param_button, new_param_enabled)
        self.assertEqual(e.comment_edit.getComments(), comments)

    def testBlockComments(self):
        b = BlockInfo(None, "/Foo", True, "")
        c = "some comments"
        e = BlockEditor(b, self.tree.app_info.type_to_block_map)
        self.checkWidget(e)
        self.assertEqual(b.comments, "")
        e.comment_edit.setComments(c)
        self.checkWidget(e, apply_enabled=True, reset_enabled=True, comments=c)
#.........这里部分代码省略.........
开发者ID:zachmprince,项目名称:moose,代码行数:101,代码来源:test_BlockEditor.py

示例15: createExeInfo

 def createExeInfo(self):
     e = ExecutableInfo()
     e.setPath(Testing.find_moose_test_exe(dirname="modules/combined", exe_base="combined"))
     return e
开发者ID:zachmprince,项目名称:moose,代码行数:4,代码来源:test_InputTree.py


注:本文中的peacock.Input.ExecutableInfo.ExecutableInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。