Module hooks :: Class HookManager
[show private | hide private]
[frames | no frames]

Class HookManager

Manager --+
          |
         HookManager


Manages creating hooks on demand as well as retrieving hooks and such.
Method Summary
  __init__(self)
  addHook(self, hookname, newhook)
Adds a pre-existing hook to the manager so we can manage it.
  addSession(self, newsession, basesession)
Tells the manager to create a new session based on another session. (inherited from Manager)
  clear(self, ses)
Removes everything the manager was managing--essentially reinitializes it. (inherited from Manager)
Hook getHook(self, hookname)
Retrieves a hook by the name of hookname.
list of strings getHookList(self)
Returns a list of hooks that are currently in existence.
string getHookStatus(self)
Returns information about the hooks that have things registered to them for #diagnostics output.
string getInfo(self, ses, text)
Returns information managed by this class. (inherited from Manager)
list of strings getState(self, ses)
Returns the state of something as a list of command strings without the command char (which is added by #write). (inherited from Manager)
string getStatus(self, ses)
Returns a one-liner status of the state of this manager for a given session. (inherited from Manager)
  register(self, hookname, func, place)
Registers a function with a given hook.
  removeSession(self, ses)
Tells the manager to remove information regarding the session. (inherited from Manager)
  unregister(self, hookname, func)
If the hook exists, unregisters the func from the hook.

Method Details

addHook(self, hookname, newhook)

Adds a pre-existing hook to the manager so we can manage it.
Parameters:
hookname - the name for the hook
           (type=string)
newhook - the hook to add
           (type=Hook)

getHook(self, hookname)

Retrieves a hook by the name of hookname. If the hook does not exist, then it creates the hook.
Parameters:
hookname - the name of the hook
           (type=string)
Returns:
the existing or newly created Hook instance
           (type=Hook)

getHookList(self)

Returns a list of hooks that are currently in existence.
Returns:
the list of hooks in existence
           (type=list of strings)

getHookStatus(self)

Returns information about the hooks that have things registered to them for #diagnostics output.
Returns:
the diagnostic string
           (type=string)

register(self, hookname, func, place=99)

Registers a function with a given hook. If the hook doesn't exist, then it instantiates the hook.
Parameters:
hookname - the name of the hook
           (type=string)
func - the function to call when that hook is spammed
           (type=function)
place - the function will get this place in the call order. functions with the same place specified will get arbitrary ordering. defaults to LAST.
           (type=int)

unregister(self, hookname, func)

If the hook exists, unregisters the func from the hook.
Parameters:
hookname - the name of the hook
           (type=string)
func - the function to remove from the hook
           (type=function)

Generated by Epydoc 1.1 on Mon Apr 28 21:11:25 2003 http://epydoc.sf.net