[Qgis-developer] Plugin tweaks
Borys Jurgiel
borys at wolf.most.org.pl
Fri Dec 19 08:24:43 EST 2008
Tuesday 09 of December 2008 20:25:35 vatto napisał(a):
> Hum... and what about those "the name must be the same" that came with
> plugininstaller new version?
> Until now I didn't understand exactly what must be with the same name.
Sorry for my growing lags and let me explain:
Plugin Installer just needs a plugin identifier to be able to relate two
plugin instances: the installed one with the one available in repositories.
The most obvious identifier is the plugin directory, because it's just the
module name in Python. It's also unique. So only one problem is how to
implement this identifier in repository.
We could use yet another xml tag for storing the identifier but I think it
would be more confusing, unclear and vulnerable to the packagers' mistakes.
And it's definitely too late to implement so big change now.
So I've decided to pass the identifier as the .zip base name. I think it's the
most clear and obvious to pack the directory into the zip package named the
same:
identifier.zip
To be exact, the identifier can't contain any dots, so only the part of the
name UNTIL THE FIRST DOT is recognized as the identifier. All further
characters are rejected. It brings one more advantage which I introduced
after my last email: you can freely add suffixes to the zip base names. So if
you wish to provide your plugin in a few versions (for different APIs), you
can name it in this manner:
identifier.zip
identifier.optional_suffix.zip
identifier.another_suffix.zip
They all will be recognized as 'identifier'. The suffixes will be rejected by
Installer but they allow you to put a few zips into one directory in repo.
Installer will choose the highest version compatible with the current API. Of
course the directory inside the identifier.suffix.zip file has to be named
without any suffix!
If you don't want to use the suffixes and wish to meet the rigid
rule "identifier.zip contains the directory named: identifier" you can use
the same filename and put into different locations. For example:
http://someHost/someDirectory/identifier.zip
http://someHost/anotherDirectory/identifier.zip
I hope it's clear now. "identifier.zip contains the directory named
identifier" or "identifier.suffix.zip contains the directory named
identifier". As you wish. We have only to remember to apply the suffix to the
zip name BUT NOT to the contained directory.
I believe it's the simplest and most reliable solution I've found. If you have
a better idea please let me know.
> I thought about python plugins template (or a new plugin script) to
> standarize as it happens with c++. It could help with the plugin installer
> standards. Maurício de Paulo
It would be great. I think we need complete wiki overhaul and there will be
the best place for it. Or in our new www.pyqgis.org domain.
More information about the Qgis-developer
mailing list