Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading a plugin that adds to the processing plugin does not work correctly #24148

Closed
qgib opened this issue Feb 27, 2017 · 5 comments
Closed
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@qgib
Copy link
Contributor

qgib commented Feb 27, 2017

Author Name: Ari Jolma (Ari Jolma)
Original Redmine Issue: 16238
Affected QGIS version: master
Redmine category:processing/core
Assignee: Victor Olaya


Loading a plugin that adds to the processing plugin leads to a keyerror:

Traceback (most recent call last):
  File "/home/ajolma/usr/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 320, in addProvider
    providerItem = TreeProviderItem(provider_id, self.algorithmTree, self)
  File "/home/ajolma/usr/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 383, in __init__
    self.populate()
  File "/home/ajolma/usr/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 395, in populate
    provider = algList.algs[self.provider_id]
KeyError: 'perl'

This is probably due to a bug in core/alglist.py, where the provider is added to processing registry before adding it to the algs hash, leading to a chicken-and-egg type of problem.

The bug is not fatal since the plugin gets loaded and once it is activated in the processing options (a deactivate - activate cycle is needed), it is ok.

In addition, I did not get the _loadAlgorithms method of the provider to execute via any other way than through an unload-load-deactivate-activate cycle.

@qgib
Copy link
Contributor Author

qgib commented Feb 27, 2017

Author Name: Ari Jolma (Ari Jolma)


I forgot to mention that the plugin initially loads ok. This bug happens only when one unloads + loads the plugin, which I had to do to invoke the refreshing of the algorithm list.

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • easy_fix was configured as 0
  • regression was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Feb 2, 2018

Author Name: Alexander Bruy (@alexbruy)


Still true in latest master?


  • description was changed from Loading a plugin that adds to the processing plugin leads to a keyerror:
Traceback (most recent call last):
  File "/home/ajolma/usr/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 320, in addProvider
    providerItem = TreeProviderItem(provider_id, self.algorithmTree, self)
  File "/home/ajolma/usr/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 383, in __init__
    self.populate()
  File "/home/ajolma/usr/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 395, in populate
    provider = algList.algs[self.provider_id]
KeyError: 'perl'

This is probably due to a bug in core/alglist.py, where the provider is added to processing registry before adding it to the algs hash, leading to a chicken-and-egg type of problem.

The bug is not fatal since the plugin gets loaded and once it is activated in the processing options (a deactivate - activate cycle is needed), it is ok.

In addition, I did not get the _loadAlgorithms method of the provider to execute via any other way than through an unload-load-deactivate-activate cycle.
to Loading a plugin that adds to the processing plugin leads to a keyerror:

Traceback (most recent call last):
  File "/home/ajolma/usr/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 320, in addProvider
    providerItem = TreeProviderItem(provider_id, self.algorithmTree, self)
  File "/home/ajolma/usr/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 383, in __init__
    self.populate()
  File "/home/ajolma/usr/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 395, in populate
    provider = algList.algs[self.provider_id]
KeyError: 'perl'

This is probably due to a bug in core/alglist.py, where the provider is added to processing registry before adding it to the algs hash, leading to a chicken-and-egg type of problem.

The bug is not fatal since the plugin gets loaded and once it is activated in the processing options (a deactivate - activate cycle is needed), it is ok.

In addition, I did not get the _loadAlgorithms method of the provider to execute via any other way than through an unload-load-deactivate-activate cycle.

  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Feb 22, 2018

Author Name: Giovanni Manghi (@gioman)


Closing for lack of feedback, please reopen if necessary.


  • status_id was changed from Feedback to Closed
  • resolution was changed from to not reproducable

@qgib qgib closed this as completed Feb 22, 2018
@qgib
Copy link
Contributor Author

qgib commented Feb 22, 2018

Author Name: Arnaud Morvan (@arnaud-morvan)


There is no more "algList" in source code, registry should be used everywhere now, so this should not append anymore.

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

1 participant