On Tue, Oct 18, 2016 at 12:37:39PM +0200, Victor Olaya wrote: > I made a fix to the check that verifies if a string parameter is left > blank or not. Before, it just checked that it was None, so empty > strings where considered valid values. However, an empty string should > be considered a null one (mainly, to raise an exception if that is > used for a parameter that is not optional). Before that, an empty > string was accepted even if the parameter was mandatory. > > looks like ogr algorithms use unicode(getParameterValue()), and they > should instead get the param value and check whether is None or not. > > Actually, there is no need to cast it to str or unicode, the value is > already a string. So it looks like ogr algorithms have to be modified > to adapat to this. > > A simpler solution is that now, when a null value is passed (None, > empty string, anything that evaluates to false...), it sets the value > of the parameter as None. It could set it to an empty string, so no > need to do any change. Not such a clean solution, but it will work. > > Any thoughts on that?
It sounds like having getParamaterValue() always return a string (possibly empty) would reduce regression probabilities. Or do you think it's important to distinguish between empty string and None ? --strk; _______________________________________________ Qgis-developer mailing list [email protected] List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
