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.") )
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()
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()
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()
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('Processing scripts (*.py *.PY)', 'AddScriptFromFileAction')) if filename: settings.setValue('Processing/lastScriptsDir', QFileInfo(filename).absoluteDir().absolutePath()) dlg = ScriptEditorDialog(filePath=filename) dlg.show()
def execute(self): """ Called whenever the action is triggered """ file_path = self.itemData.description_file if file_path is not None: dlg = ScriptEditorDialog(file_path, iface.mainWindow()) dlg.show() else: QMessageBox.warning( None, self.tr("Edit Script"), self.tr("Can not find corresponding script file."))
def execute(self): dlg = ScriptEditorDialog(None) dlg.show()
def execute(self): alg = self.itemData dlg = ScriptEditorDialog(None) dlg.editor.setText('\n'.join(alg.asPythonCode(QgsProcessing.PythonQgsProcessingAlgorithmSubclass, 4))) dlg.show()
def export_as_script_algorithm(self): dlg = ScriptEditorDialog(None) dlg.editor.setText('\n'.join(self.model.asPythonCode(QgsProcessing.PythonQgsProcessingAlgorithmSubclass, 4))) dlg.show()
def exportAsScriptAlgorithm(self): dlg = ScriptEditorDialog(None) dlg.editor.setText('\n'.join(self.model().asPythonCode(QgsProcessing.PythonQgsProcessingAlgorithmSubclass, 4))) dlg.show()
def execute(self): """ Called whenever the action is triggered """ dlg = ScriptEditorDialog(None) dlg.show()