本文整理汇总了Python中peacock.Input.ExecutableInfo.ExecutableInfo.setPath方法的典型用法代码示例。如果您正苦于以下问题:Python ExecutableInfo.setPath方法的具体用法?Python ExecutableInfo.setPath怎么用?Python ExecutableInfo.setPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类peacock.Input.ExecutableInfo.ExecutableInfo
的用法示例。
在下文中一共展示了ExecutableInfo.setPath方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setExecutablePath
# 需要导入模块: from peacock.Input.ExecutableInfo import ExecutableInfo [as 别名]
# 或者: from peacock.Input.ExecutableInfo.ExecutableInfo import setPath [as 别名]
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()
示例2: newWidget
# 需要导入模块: from peacock.Input.ExecutableInfo import ExecutableInfo [as 别名]
# 或者: from peacock.Input.ExecutableInfo.ExecutableInfo import setPath [as 别名]
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
示例3: testPickle
# 需要导入模块: from peacock.Input.ExecutableInfo import ExecutableInfo [as 别名]
# 或者: from peacock.Input.ExecutableInfo.ExecutableInfo import setPath [as 别名]
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)
示例4: testCombined
# 需要导入模块: from peacock.Input.ExecutableInfo import ExecutableInfo [as 别名]
# 或者: from peacock.Input.ExecutableInfo.ExecutableInfo import setPath [as 别名]
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)
示例5: newWidget
# 需要导入模块: from peacock.Input.ExecutableInfo import ExecutableInfo [as 别名]
# 或者: from peacock.Input.ExecutableInfo.ExecutableInfo import setPath [as 别名]
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
示例6: testTree
# 需要导入模块: from peacock.Input.ExecutableInfo import ExecutableInfo [as 别名]
# 或者: from peacock.Input.ExecutableInfo.ExecutableInfo import setPath [as 别名]
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)
示例7: createWidget
# 需要导入模块: from peacock.Input.ExecutableInfo import ExecutableInfo [as 别名]
# 或者: from peacock.Input.ExecutableInfo.ExecutableInfo import setPath [as 别名]
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
示例8: newWidget
# 需要导入模块: from peacock.Input.ExecutableInfo import ExecutableInfo [as 别名]
# 或者: from peacock.Input.ExecutableInfo.ExecutableInfo import setPath [as 别名]
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
示例9: testInfo
# 需要导入模块: from peacock.Input.ExecutableInfo import ExecutableInfo [as 别名]
# 或者: from peacock.Input.ExecutableInfo.ExecutableInfo import setPath [as 别名]
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())
示例10: create_tree
# 需要导入模块: from peacock.Input.ExecutableInfo import ExecutableInfo [as 别名]
# 或者: from peacock.Input.ExecutableInfo.ExecutableInfo import setPath [as 别名]
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
示例11: createBasic
# 需要导入模块: from peacock.Input.ExecutableInfo import ExecutableInfo [as 别名]
# 或者: from peacock.Input.ExecutableInfo.ExecutableInfo import setPath [as 别名]
def createBasic(self):
e = ExecutableInfo()
e.setPath(Testing.find_moose_test_exe())
t = InputTree(e)
t.setInputFile(self.basic_input)
return t
示例12: Tests
# 需要导入模块: from peacock.Input.ExecutableInfo import ExecutableInfo [as 别名]
# 或者: from peacock.Input.ExecutableInfo.ExecutableInfo import setPath [as 别名]
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)
#.........这里部分代码省略.........
示例13: createExeInfo
# 需要导入模块: from peacock.Input.ExecutableInfo import ExecutableInfo [as 别名]
# 或者: from peacock.Input.ExecutableInfo.ExecutableInfo import setPath [as 别名]
def createExeInfo(self):
e = ExecutableInfo()
e.setPath(Testing.find_moose_test_exe(dirname="modules/combined", exe_base="combined"))
return e