taskWeeChat - Tasks: task #5594, Add unregister function to the...

 
 

task #5594: Add unregister function to the script plugin API

Submitter:  Marcus Eggenberger <egs>
Submitted:  Wed 24 May 2006 05:14:17 PM UTC
   
 
Category:  other plugins Should Start On:  Wed 24 May 2006 12:00:00 AM UTC
Should be Finished on:  Mon 24 Jul 2006 12:00:00 AM UTC Priority:  * 1 - Later
Status:  None Privacy:  Public
Assigned to:  None Percent Complete:  0%
Originator Name:  Open/Closed:  Open
Planned Release:  None IRC nick: 
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 23 Dec 2007 04:15:23 PM UTC, comment #2: 

...
if weechat.register(NAME, VERSION, "clean", "description"):
    raise Exception, "foo"
...

Script is NOT registered after exception arises.
Same statement is valid for die() and perl.
Maybe this way of exception handling is bug, maybe it's feature, I don't know.

// darkk

Anonymous
Wed 24 May 2006 05:15:19 PM UTC, comment #1: 

(the python indentation has been screwed but I think it's clear anyway)

Marcus Eggenberger <egs>
Wed 24 May 2006 05:14:17 PM UTC, original submission:  

This task encourages the introduction of a new function weechat.unregister to the script plugin API, which unloads the current plugin. At the time beeing there is no counterpart to the function weechat.register.

This function would be especialy helpful if a plugin cannot operate correctly due to the lack of a specific requirement.
If a requirement is not met, it should be reported to the user. Therefore the plugin has to be registered in weechat. At this point the plugin cannot be automaticaly unloaded though it isn't of any use.

Here's an illustration with a pseudo-script in python-notation what it could be like:

weechat.register(NAME, VERSION, ENDFUNCTION, DESCRIPTION)
try:
    checkRequirements()
except:
    weechat.prnt("Requirement <xy> is not met","")
    weechat.prnt("solution: do stuff","")
    weechat.unregister("Plugin has not been registered in weechat")


Marcus Eggenberger <egs>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.13-4448.
Corresponding source code