Re: [Qgis-developer] how to turn my plugin into a processing subplugin
Thanks to all for your answers, it's great to get good advice quickly. It's more clear to me now how to proceed, I'll give it a try ! Julie. Le 02/12/2016 à 08:16, Victor Olaya a écrit : If you convert your plugin functionality into Processing scripts, then it's very easy to distribute them, no need create a plugin manually and add them to it. Just create your scripts and make sure they are available in the toolbox. Then, in the "Scripts" group of the toolbox, you will find a tool called "Create script collection plugin". Just select the scripts that you want to distribute, and it will package them into a plugin that you can share in the plugins server. Installing the plugin will add the scripts to the toolbox. Hope this helps 2016-12-01 22:25 GMT+01:00 Nyall Dawson: On 29 Nov 2016 1:22 AM, "Julie Pierson" wrote: Hi all, I would like to answer this issue for my plugin : https://github.com/UMR-PASSAGES/DissolveWithStats/issues/2, and turn it into a processing subplugin. I read this : https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/processing.html, but I'm still not sure how to go on. I'm guessing that my script will be accessible from the Scripts/Tools part of the processing toolbox. But I don't understand : - where these scripts are hosted, and how do I submit it - where do I start ? Should I just make a new version of my plugin without the GUI ? Have a look at https://github.com/jdugge/BufferByPercentage/commit/c52d161b40abf6bbd45e7ec421eb311623592e90 That's a similar commit which added a processing module to an existing plugin. The hardest(?) part is refactoring your plugin to split all the logic out from any existing gui. Buts that's a good thing to do in any case. Nyall Sorry if the answers are obvious ! Thanks, Julie. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] how to turn my plugin into a processing subplugin
If you convert your plugin functionality into Processing scripts, then it's very easy to distribute them, no need create a plugin manually and add them to it. Just create your scripts and make sure they are available in the toolbox. Then, in the "Scripts" group of the toolbox, you will find a tool called "Create script collection plugin". Just select the scripts that you want to distribute, and it will package them into a plugin that you can share in the plugins server. Installing the plugin will add the scripts to the toolbox. Hope this helps 2016-12-01 22:25 GMT+01:00 Nyall Dawson: > > > On 29 Nov 2016 1:22 AM, "Julie Pierson" wrote: > > Hi all, > > I would like to answer this issue for my plugin : > https://github.com/UMR-PASSAGES/DissolveWithStats/issues/2, and turn it into > a processing subplugin. I read this : > https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/processing.html, > but I'm still not sure how to go on. > > I'm guessing that my script will be accessible from the Scripts/Tools part > of the processing toolbox. But I don't understand : > - where these scripts are hosted, and how do I submit it > - where do I start ? Should I just make a new version of my plugin without > the GUI ? > > > Have a look at > https://github.com/jdugge/BufferByPercentage/commit/c52d161b40abf6bbd45e7ec421eb311623592e90 > > That's a similar commit which added a processing module to an existing > plugin. > > The hardest(?) part is refactoring your plugin to split all the logic out > from any existing gui. Buts that's a good thing to do in any case. > > Nyall > > > Sorry if the answers are obvious ! > > Thanks, > > Julie. > ___ > Qgis-developer mailing list > Qgis-developer@lists.osgeo.org > List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer > > > > ___ > Qgis-developer mailing list > Qgis-developer@lists.osgeo.org > List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] how to turn my plugin into a processing subplugin
Le 2016-11-28 16:20, Julie Pierson a écrit : Hi all, I would like to answer this issue for my plugin : https://github.com/UMR-PASSAGES/DissolveWithStats/issues/2, and turn it into a processing subplugin. I read this : https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/processing.html, but I'm still not sure how to go on. I'm guessing that my script will be accessible from the Scripts/Tools part of the processing toolbox. But I don't understand : - where these scripts are hosted, and how do I submit it - where do I start ? Should I just make a new version of my plugin without the GUI ? Sorry if the answers are obvious ! Thanks, Julie. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer Hello, I think that you can first try to convert your plugin to a Processing Python script as stated here: https://docs.qgis.org/testing/en/docs/user_manual/processing/scripts.html When you create a Processing Python script from the dedicated dialog, it is stored into your ~/.qgis3/processing/script/ directory. To fill the script code, you will have to extract the "algorithm" part of your plugin (the things that do the stats or the dissolve part which seems to be stored into 'dissolve_stats_dialog.py') and put it into a Python script. For input/output, just use the dedicated "comments" syntax at the beginning of the script: ##myvector=vector defines an input vector which will be available in myvector Python variable. Once inputs and outputs are defined, there is no need to deal with dialogs to open/choose files, just use the "comments" variables and Processing will build the dialogs for you. The script will be processed by Processing as is: the code will be interpreted as a Python script. You can add as many classes/functions you'd like into the script. Don't use the `if __name__ == '__main__'` Python syntax for the main loop. I think it is not interpreted correctly by Processing (not 100% sure though). Once your plugin is converted, you can make a PR to https://github.com/qgis/QGIS-Processing which is the repository for 'Get models from on-line scripts collection' Processing dialog box and it will become available to anybody. Cheers, -- Médéric RIBREUX https://medspx.fr ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] how to turn my plugin into a processing subplugin
Hi all, I would like to answer this issue for my plugin : https://github.com/UMR-PASSAGES/DissolveWithStats/issues/2, and turn it into a processing subplugin. I read this : https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/processing.html, but I'm still not sure how to go on. I'm guessing that my script will be accessible from the Scripts/Tools part of the processing toolbox. But I don't understand : - where these scripts are hosted, and how do I submit it - where do I start ? Should I just make a new version of my plugin without the GUI ? Sorry if the answers are obvious ! Thanks, Julie. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer