[Qgis-developer] Re: plug-in requirements
Barry Rowlingson
b.rowlingson at lancaster.ac.uk
Wed May 14 03:10:55 EDT 2008
volkan kepoglu wrote:
> Whether rpy is installed or not, can simple be checked with try and except
> commands. There maybe better way, but it is working in posix and nt. In nt,
> pywin32 also requires in order to run rpy.
I think you've missed the point of my message - I was proposing a
standard for plugins to specify their requirements, I wasn't talking
about how you'd implement these tests.
Eventually the python plugin system would work with this in order to
test requirements for plugins before installing.
The test for any specific python module is simply to do an import
inside a try, the test for Qgis version requires looking at
QGis.qgisVersion, the test for an R package is a couple of lines of rpy
code, and so on. The 'other' test allows plugins to describe and test
any other conditions - I only gave the nt/posix case as an example. It
could check that the PC has 1Gb of spare disk space, or that the machine
is on a network, or anything you can do in python.
All this might not be a good idea since it might need the plugin on
the python search path if the __init__.py file imports other parts from
the plugin - that would make it hard for requirements to be tested by
things like the plugin server...
Barry
More information about the Qgis-developer
mailing list