I have 2 scripts within QGIS processing toolbox and I can't seem to work out how to access the parameters of 1 script from the other. Since QGIS sets up the processing parameters (by 'looking for' the ## notation) before the rest of the script is run, the parameters are already set up by the time the second script is called. Has anyone found a work around for this?
#script a import imp, os.path def import_(filename): (path, name) = os.path.split(filename) (name, ext) = os.path.splitext(name) (file, filename, data) = imp.find_module(name, [path]) return imp.load_module(name, file, filename, data) foo = import_("path to b") foo.getParameters()
and script b...
#script b def getParameters(): ##parameter_1=string ##parameter_2=number return
The reason I'm trying to do this is because QGIS makes a local copy of the script to run when a user clicks 'add script from file'. So, if I later want to change the input parameters, I would need to inform the user that the script is updated and that they need to 'add script from file' again to get the most recent version. If I can create a script for local copies that just calls the main server script, I can make updates without having to get all the script users to manually change to the latest version.
I know plugins are a more appropriate way to control this kind of workflow, but in the corporate I'm working on I don't have (and can't get) Qt installed to make the GUI.