本文整理汇总了Python中processing.script.ScriptEditorDialog.ScriptEditorDialog.show方法的典型用法代码示例。如果您正苦于以下问题:Python ScriptEditorDialog.show方法的具体用法?Python ScriptEditorDialog.show怎么用?Python ScriptEditorDialog.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类processing.script.ScriptEditorDialog.ScriptEditorDialog
的用法示例。
在下文中一共展示了ScriptEditorDialog.show方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from processing.script.ScriptEditorDialog import ScriptEditorDialog [as 别名]
# 或者: from processing.script.ScriptEditorDialog.ScriptEditorDialog import show [as 别名]
def execute(self):
filePath = ScriptUtils.findAlgorithmSource(self.itemData.name())
if filePath is not None:
dlg = ScriptEditorDialog(filePath, iface.mainWindow())
dlg.show()
else:
QMessageBox.warning(None,
self.tr("Edit Script"),
self.tr("Can not find corresponding script file.")
)
示例2: execute
# 需要导入模块: from processing.script.ScriptEditorDialog import ScriptEditorDialog [as 别名]
# 或者: from processing.script.ScriptEditorDialog.ScriptEditorDialog import show [as 别名]
def execute(self):
settings = QgsSettings()
lastDir = settings.value('Processing/lastScriptsDir', '')
filename, selected_filter = QFileDialog.getOpenFileName(self.toolbox,
self.tr('Open Script', 'AddScriptFromFileAction'), lastDir,
self.tr('Script files (*.py)', 'AddScriptFromFileAction'))
if filename:
settings.setValue('Processing/lastScriptsDir',
QFileInfo(filename).absoluteDir().absolutePath())
dlg = ScriptEditorDialog(filePath=filename)
dlg.show()
示例3: execute
# 需要导入模块: from processing.script.ScriptEditorDialog import ScriptEditorDialog [as 别名]
# 或者: from processing.script.ScriptEditorDialog.ScriptEditorDialog import show [as 别名]
def execute(self):
dlg = ScriptEditorDialog(None)
pluginPath = os.path.split(os.path.dirname(__file__))[0]
templatePath = os.path.join(
pluginPath, 'script', 'ScriptTemplate.py')
with codecs.open(templatePath, 'r', encoding='utf-8') as f:
templateTxt = f.read()
dlg.editor.setText(templateTxt)
dlg.show()
示例4: execute
# 需要导入模块: from processing.script.ScriptEditorDialog import ScriptEditorDialog [as 别名]
# 或者: from processing.script.ScriptEditorDialog.ScriptEditorDialog import show [as 别名]
def execute(self):
alg = self.itemData
dlg = ScriptEditorDialog(None)
dlg.editor.setText('\n'.join(alg.asPythonCode(QgsProcessing.PythonQgsProcessingAlgorithmSubclass, 4)))
dlg.show()
示例5: execute
# 需要导入模块: from processing.script.ScriptEditorDialog import ScriptEditorDialog [as 别名]
# 或者: from processing.script.ScriptEditorDialog.ScriptEditorDialog import show [as 别名]
def execute(self):
dlg = ScriptEditorDialog(None)
dlg.show()
示例6: export_as_script_algorithm
# 需要导入模块: from processing.script.ScriptEditorDialog import ScriptEditorDialog [as 别名]
# 或者: from processing.script.ScriptEditorDialog.ScriptEditorDialog import show [as 别名]
def export_as_script_algorithm(self):
dlg = ScriptEditorDialog(None)
dlg.editor.setText('\n'.join(self.model.asPythonCode(QgsProcessing.PythonQgsProcessingAlgorithmSubclass, 4)))
dlg.show()