I am trying to port my old QGIS 2.x processing scripts to QGIS 3.x. One of my scripts just needs two variables to initiate several processes to set-up a working environment in my QGIS map document (downloading layers, subsetting data, etc). Using the template script (QGIS 3.2.0) I have changed the static variables, 'INPUT' and 'OUTPUT' to 'START' and 'END'. I then changed the initAlogrithm function to:
def initAlgorithm(self, config=None):
"""
Here we define the inputs and output of the algorithm, along
with some other properties.
"""
self.addParameter(
QgsProcessingParameterString(
self.START,
self.tr('Model Start Time'),
'YYYYMMDDHH'
)
)
self.addParameter(
QgsProcessingParameterString(
self.END,
self.tr('Model End Time'),
'YYYYMMDDHH'
)
)
Then in the processAlgorithm() function, I tried calling the inputs as:
start_time = self.parameterAsString(
parameters,
self.START,
context)
This yields the following error:
TypeError: invalid result from AssimStartUp.processAlgorithm(), NoneType cannot be converted to a C/C++ QMap<QString,QVariant> in this context
So, what am I doing wrong that is prohibiting the string from the input window being passed into the processAlgorithm() function?