4

I have some script that I would like to share easily.

I have read here that its possible to create a plugin using a set of scripts using "Scripts/Tools group in the Processing toolbox, double-click on the Create script collection plugin item"

Unfortunately I don't have this tools in scripts in ubuntu 16.04 with QGIS 2.14.3, or in windows.

Does anyone know how to solve this problem because if I go into QGIS source I have seen this code that is missing in my QGIS installation: CreateScriptCollectionPluginAction.py.


Now this tools is available in Qgis and works well when you apply the following change (@Joseph helped): C:\Program Files\QGIS 2.16.1\apps\qgis\python\plugins\processing\script And then change the line after the imports:

WIDGET, BASE = uic.loadUiType( os.path.join(pluginPath, 'ui', 'DlgConfig.ui')) with

WIDGET, BASE = uic.loadUiType( os.path.join(pluginPath, 'ui', 'scriptselector.ui')) Re/start QGIS and hopefully it will work:

It works well because when I go to plugin I can enable it. However, unfortunately, after that I am not able to see any new menu where to find the script, whatever in Plugins, processing option.

Did you know where to find the menu ?

3
  • 1
    Have you evaluated the QGIS Resource Sharing plugin? Would it work for you? Commented Sep 29, 2016 at 14:53
  • When you run it, it creates three files and a scripts folder. If you put all of these into a new folder with an example name like "Hello" and move this into the /qgis2/python/plugins/ directory and re/start QGIS, you will see the "Hello" plugin from the menubar: Plugins > Manage and Install Plugins....
    – Joseph
    Commented Sep 30, 2016 at 9:43
  • For sure, I have seen that and enable the new plugin without any error message. Unfornutately, even if I close and restart Qgis, I don't see anithing more in the menu. May be I missunderstound something... Because for me, the goal of this tool is to create a new plugin from script in order that this new plugin allow asking the different tools in a specific menu of Qgis and not in qgis script. Furthermore, for me it will be an easy way to share my script using plugin repository. Commented Sep 30, 2016 at 10:31

4 Answers 4

3

After asking to 3liz team they explain me that this feature is for next release.

So I will try to build real processing provider plugin but I will also try installing dev build to see if i can try this new feature.

2

I also receive the error when trying to run the Create script collection plugin (plugin):

AttributeError: 'ScriptSelector' object has no attribute 'scriptsTree'


This post mentions that you need to edit the ScriptSelector.py file which for my Windows QGIS 2.16.1 standalone installation is found in:

C:\Program Files\QGIS 2.16.1\apps\qgis\python\plugins\processing\script

And then change the line after the imports:

WIDGET, BASE = uic.loadUiType(
    os.path.join(pluginPath, 'ui', 'DlgConfig.ui')) 

with

WIDGET, BASE = uic.loadUiType(
    os.path.join(pluginPath, 'ui', 'scriptselector.ui')) 

Re/start QGIS and hopefully it will work:

Create script collection plugin

0

Now Qgis 2.16 release is available.

Unfortunatly, the tools "create script collection plugin" return an error when running whatever windows or Ubuntu Do you know what is the problem because this features is really interesting.

Best

Traceback (most recent call last): File "C:/PROGRA~1/QGIS2~1.16/apps/qgis/./python/plugins\processing\gui\ProcessingToolbox.py", line 276, in executeAlgorithm action.execute() File "C:/PROGRA~1/QGIS2~1.16/apps/qgis/./python/plugins\processing\script\CreateScriptCollectionPluginAction.py", line 83, in execute dlg = ScriptSelector() File "C:/PROGRA~1/QGIS2~1.16/apps/qgis/./python/plugins\processing\script\ScriptSelector.py", line 64, in init self.scriptsTree.addTopLevelItem(groupItem) AttributeError: 'ScriptSelector' object has no attribute 'scriptsTree'

1
  • 2
    Hi @CédricLardeux, you should edit your question to include these new details :)
    – Joseph
    Commented Sep 29, 2016 at 14:53
0

The QGIS Resource Sharing plugin (http://qgis-contribution.github.io/QGIS-ResourceSharing) was made for this purpose (sharing resources, among them processing scripts, processing models, symbols, layer styles, SVGs, R scripts, expressions, ...). You can place your Collection on github or elsewhere on the Web and share it, as long as you follow the required repository structure (processing scripts must for instance be placed in a sub-folder named processing). Details about how to share QGIS resources using the plugin are found on the plugin's web page referenced above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.