[Qgis-developer] [Python plugin] handle error conditions

Anne Ghisla a.ghisla at studenti.uninsubria.it
Tue Aug 5 12:46:40 EDT 2008


Hi Tim - answer is below.

Scrive Tim Sutton <tim at linfiniti.com>:

> Hi Anne
> 
> I tried to run your plugin (downloaded last week) but when QGIS starts I
> get:
> 
> Couldn't load plugin "pluginProva" from
> ['/home/timlinux/apps/share/qgis/python' <etc>]
> 
> Here is what I have checked out and where the plugin is installed:
> 
> [pluginProva] pwd
> /home/timlinux/.qgis/python/plugins/pluginProva

the plugin looks for R files in its directory, and for the moment the path
points to the user plugin directory. If the plugin is installed in official
plugin folder, it runs but can't call R.
I don't know which OS you are using, nor if the dependencies are the ones I
wrote on the wiki page [1] and I'm sure they work.
Consider also to get the head revision (I entered testing phase and I update
code often with bugfixes).
If you are using Mac, a full error report will be extremely useful! 

regards,

Anne

[1] http://wiki.qgis.org/qgiswiki/GSoC2008Rbinding

> [pluginProva] svn info
> Path: .
> URL: svn://home.prea.net/svn/GSoC/pluginProva
> Repository Root: svn://home.prea.net/svn
> Repository UUID: 60e9be08-f12e-11dc-b9d3-6b2ab16386f6
> Revision: 78
> Node Kind: directory
> Schedule: normal
> Last Changed Author: anne
> Last Changed Rev: 76
> Last Changed Date: 2008-07-31 11:53:12 +0200 (Thu, 31 Jul 2008)
> 
> 
> 
> Regards
> Tim
> 
> 2008/8/5 Anne Ghisla <a.ghisla at studenti.uninsubria.it>:
> > Hello all, and especially Python plugin developers,
> >
> > The plugin for home range analysis is now almost ready, but success of
> > execution depends on correct parameters given by the user, otherwise it
> > raises Python errors or gives the false idea that everything is going
> > fine.
> > I'm trying to handle some potential errors as soon as possible.
> > The worst error source is that there is no (point) layer available. For
> > the moment I let QGIS print a warning into console and raise a
> > QMessageBox.
> > Is it possible from the __init__ method of the interface to abort window
> > drawing? If I call the interface close() method, the interface gets
> > drawn anyway.
> > It will be fine if the user calls the method from menu, gets a message
> > box about lack of layers, and nothing else after.
> >
> > Significant part of the code is here:
> > http://rafb.net/p/0G3Wiw24.html
> >
> > lines 23 (call), 55.
> >
> > thanks in advance for any hint!
> >
> > Anne Ghisla
> >
> >
> > _______________________________________________
> > Qgis-developer mailing list
> > Qgis-developer at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
> >
> >
> 
> 
> 
> -- 
> Tim Sutton
> QGIS Project Steering Committee Member - Release Manager
> Visit http://qgis.org for a great open source GIS
> Blog: http://tim.linfiniti.com
> Skype: timlinux
> Irc: timlinux on #qgis at freenode.net
> 
> 






More information about the Qgis-developer mailing list