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

NameError with Processing - global name self is not defined #19629

Closed
qgib opened this issue Oct 5, 2014 · 6 comments
Closed

NameError with Processing - global name self is not defined #19629

qgib opened this issue Oct 5, 2014 · 6 comments
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
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Oct 5, 2014

Author Name: Pedro Venâncio (Pedro Venâncio)
Original Redmine Issue: 11335
Affected QGIS version: master
Redmine category:processing/modeller
Assignee: Victor Olaya


After update to QGIS 2.5.0-92 (OSGeo4W) I get this error:

Couldn't load plugin processing due an error when calling its initGui() method

Traceback (most recent call last):
  File "C:/OSGEO4~1/apps/qgis-dev/./python\\qgis\\utils.py", line 217, in startPlugin
    plugins[packageName].initGui()
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\ProcessingPlugin.py", line 54, in initGui
    Processing.initialize()
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\core\\Processing.py", line 153, in initialize
    Processing.loadFromProviders()
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\core\\Processing.py", line 166, in loadFromProviders
    Processing.loadAlgorithms()
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\core\\Processing.py", line 210, in loadAlgorithms
    Processing.modeler.loadAlgorithms()
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\core\\AlgorithmProvider.py", line 57, in loadAlgorithms
    self._loadAlgorithms()
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\modeler\\ModelerAlgorithmProvider.py", line 74, in _loadAlgorithms
    self.loadFromFolder(folder)
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\modeler\\ModelerAlgorithmProvider.py", line 84, in loadFromFolder
    alg = ModelerAlgorithm.fromFile(fullpath)
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\modeler\\ModelerAlgorithm.py", line 541, in fromFile
    alg = ModelerAlgorithm.fromOldFormatFile(filename)
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\modeler\\ModelerAlgorithm.py", line 637, in fromOldFormatFile
    raise WrongModelException(self.tr('Error in model definition line: %s\
%s', 'ModelerAlgorithm') % (line.strip(), traceback.format_exc()))
NameError: global name 'self' is not defined

It seems something related with the backward compatibility of models.


@qgib
Copy link
Contributor Author

qgib commented Oct 5, 2014

Author Name: Victor Olaya (@volaya)


There are two problems in here. One, the model is not being loaded, so the backwards compatibility is not perfect. Two, there is an error in the internationalization code that Alex added during the HF. I will work on the first one. Coudl you attach the model that is causing this problem? Thanks!


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2014

Author Name: Pedro Venâncio (Pedro Venâncio)


Hi Victor,

I attach two models:

  • with 1_1_preparacao.model, I get no error;

  • with 1_preparacao.model, I get the error described.


  • 7892 was configured as 1_preparacao.model
  • 7891 was configured as 1_1_preparacao.model

@qgib
Copy link
Contributor Author

qgib commented Oct 7, 2014

Author Name: Victor Olaya (@volaya)


The error with int i18n is fixed. The error of not being able to load your model is actually not a modeler error. The syntax of the raster calculator has changed, so all old models using it will break.

I will try to manually edit you model and send a corrected one back to you, since it is a very big model and i guess you do not want to create it again :-)

@qgib
Copy link
Contributor Author

qgib commented Oct 7, 2014

Author Name: Pedro Venâncio (Pedro Venâncio)


Hi Victor,

No, it is not necessary, I take care of it! Don't worry! These are not yet final models!

Thank you so much!

Best regards!

@qgib
Copy link
Contributor Author

qgib commented Oct 9, 2014

Author Name: Paolo Cavallini (@pcav)


Seems fixed here.

@qgib
Copy link
Contributor Author

qgib commented Oct 9, 2014

Author Name: Pedro Venâncio (Pedro Venâncio)


  • status_id was changed from Feedback to Closed

@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
@qgib qgib added this to the Version 2.6 milestone May 25, 2019
@qgib qgib closed this as completed 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