[Eric] plugins
Jürgen Urner
jUrner at arcor.de
Sat Jul 14 18:34:09 BST 2007
Detlev Offenbach wrote:
> On Samstag, 14. Juli 2007, Jürgen Urner wrote:
>
>> Detlev Offenbach wrote:
>>
>>> On Sonntag, 8. Juli 2007, Jürgen Urner wrote:
>>>
>>>> Currently from a package zip everything is dumped to eric4plugins.
>>>> On uninstall, only the plugin file is removed.
>>>>
>>>> Would be nice if plugins could be packages, and maybe a force check on
>>>> install
>>>> that a plugin consists only of one package or one script to enshure
>>>> propper removal.
>>>>
>>>> Jürgen
>>>>
>>>>
>>>> _______________________________________________
>>>> Eric mailing list
>>>> Eric at riverbankcomputing.com
>>>> http://www.riverbankcomputing.com/mailman/listinfo/eric
>>>>
>>> plugin package files should have one file in the top directory, which is
>>> the plugin script and one package (directory), that contains als the
>>> files. The plugin script should contain a module attribute "packageName"
>>> that contains the name of the package as a string. If the uninstall
>>> routine doesn't find this attribute, it will give an error message. Maybe
>>> this precondition should be checked at installation time.
>>>
>> That would be Eric extracts "packageName" only. What about other files
>> (dirs) present in
>> a plugin zip? And what happens if a plugin accidently overwrites another
>> packages content?
>> Wouldn't plugin handling be easier if plugins were only allowed to be
>> one single files or one
>> single package?
>>
>
> That is exactly the convention for plugin packages. I could modify the
> installer like that:
>
> 1) extract the plugin module from the zip file and get the "packageName"
> attribute
>
> 2) refuse to install, if it isn't found
>
> 3) check if there is a package of the same name already installed in the
> specified area
>
> 4) if so and the plugin module is there as well assume an update
>
uninstall old, install new. Don't care if it's a conflicting plugin of
another autor.
Otherwise you'd be tempted to test for author to check identity.
Slippery slope.
> 5) if no update give the user an info and abort
>
> 6) otherwise extract the zip contents and install all files residing in the
> directory given by packageName
>
> Would that be ok?
ok
>
>> Another thing ...maybe I've overlooked something ...but a notification
>> on unistall plugin
>> would be nice to do cleanups.
>>
>
> What kind of notification? There are a bunch of error notifications and a
> success notification.
Notifications for the plugin not user. Would be nice for example to clean
Erics settings on uninstall from entries a plugin has made. The next plugin
with the same name might get strange values in return as a test if its
QSettings.value() call is bullet proof.
mySetting = QSettings.value(...
ed.setText(mySetting)
# outch! ...some long gone plugin used to store its Xp activation key there
No help if two active plugins accidently use the same key. That's yet
another
story, But a notification on plugin install and uninstall would allow
for some
sanity checks and clean up.
Jürgen
More information about the Eric
mailing list