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

Anne Ghisla a.ghisla at studenti.uninsubria.it
Tue Aug 5 06:54:13 EDT 2008


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.osgeo.org/pipermail/qgis-developer/attachments/20080805/32910f5c/attachment.bin


More information about the Qgis-developer mailing list