Re: [Qgis-user] Add processing script to toolbox
No, but previously I made a couple of scripts based on the template. These scripts resided in the default scripts directory and I guess there is some logic that loads them in the toolbox on startup? Regards, -- Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Add processing script to toolbox
>Hi Reginald, >I had a quick look at this. The issue here is that your script doesn't follow the QGIS 3 API for scripts, and >will need to be ported/upgraded. >I'd suggest a good approach would be to start from the template given when you select "Create New Script >from Template" from the processing toolbox toolbar. You basically put all your code into the >"processAlgorithm" function, so it only runs when the algorithm is executed, not when the script file is first >loaded. A quick scan shows that you use some deprecated 2.x api which will need to be fixed too - e.g. >iface.legendInterface() no longer exists. You can see a list of API breaks from 2.x to 3.x here: >https://qgis.org/api/api_break.html. There's also quite a lot of resources available via a quick google >search. >Hope that helps! >Nyall Hi Nyall, Thanks for looking in to this. Yesterday I installed qgis full from OSGEO4W installer and installed it in the default directory. When I opened QGIS 3.2 it showed the scripts that were adapted to the template were imported in the toolbox. So I guess there is some bug concerning changing the default directory “OSGEO4W64” to something else. Regards, -- Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Add processing script to toolbox
On Wed, 25 Jul 2018 at 19:32, Reginald wrote: > > Hi, > > I'm trying to add some scripts to the toolbox of QGIS-versie > 3.2.1-Bonn. Whatever I do to import the script in the toolbox fails. > I use the python icon that is in the menubar of Toolbox Processing. > I have run the scripts and they work with QGIS 3.21. > Any help? > For reference: I've followed up with Reginald off-list and the actual issue here is that the script uses 2.x API and needs upgrading to 3.x API. Nyall ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Add processing script to toolbox
On Mon, 30 Jul 2018 at 19:43, Reginald wrote: > > Hi Nyall, > > I have opened the options dialogue and clicked OK but everything remains the > same. > On a fresh install on another PC I still get the same behaviour. Can you share one of the scripts? Nyall ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Add processing script to toolbox
Hi Nyall, I have opened the options dialogue and clicked OK but everything remains the same. On a fresh install on another PC I still get the same behaviour. Regards, -- Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Add processing script to toolbox
On Wed, 25 Jul 2018 at 19:32, Reginald wrote: > > Hi, > > I'm trying to add some scripts to the toolbox of QGIS-versie > 3.2.1-Bonn. Whatever I do to import the script in the toolbox fails. > I use the python icon that is in the menubar of Toolbox Processing. > I have run the scripts and they work with QGIS 3.21. > Any help? Can you confirm whether these scripts show up if you open the QGIS Settings dialog and then click OK? Nyall ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Add processing script to toolbox
Hi Jean-Baptiste, I get the following warning: WARNINGKon script niet kopiëren: C:/Users/reginaldc/AppData/Roaming/QGIS/QGIS3/profiles/default/processing/scripts/notarisrapport3.py 'C:/Users/reginaldc/AppData/Roaming/QGIS/QGIS3/profiles/default/processing/scripts/notarisrapport3.py' and 'C:\\Users\\reginaldc\\AppData\\Roaming\\QGIS\\QGIS3\\profiles\\default\\processing\\scripts\\notarisrapport3.py' are the same file The problem is that the script doesn't show up in the treeview. I can open it using 'open existing script'. Regards, -- Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Add processing script to toolbox
Hi, Any error message ? 2018-07-25 11:32 GMT+02:00 Reginald : > Hi, > > I'm trying to add some scripts to the toolbox of QGIS-versie > 3.2.1-Bonn. Whatever I do to import the script in the toolbox fails. > I use the python icon that is in the menubar of Toolbox Processing. > I have run the scripts and they work with QGIS 3.21. > Any help? > > Regards, > > > > > -- > Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html > ___ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user