本文整理汇总了Python中processing.script.ScriptEditorDialog.ScriptEditorDialog类的典型用法代码示例。如果您正苦于以下问题:Python ScriptEditorDialog类的具体用法?Python ScriptEditorDialog怎么用?Python ScriptEditorDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ScriptEditorDialog类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
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
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
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
def execute(self):
alg = self.itemData
dlg = ScriptEditorDialog(None)
dlg.editor.setText('\n'.join(alg.asPythonCode(QgsProcessing.PythonQgsProcessingAlgorithmSubclass, 4)))
dlg.show()
示例5: execute
def execute(self):
dlg = ScriptEditorDialog(None)
dlg.show()
示例6: export_as_script_algorithm
def export_as_script_algorithm(self):
dlg = ScriptEditorDialog(None)
dlg.editor.setText('\n'.join(self.model.asPythonCode(QgsProcessing.PythonQgsProcessingAlgorithmSubclass, 4)))
dlg.show()