Package modules :: Module modutils
[show private | hide private]
[frames | no frames]

Module modules.modutils

This module holds helper functions for building other Lyntin modules. This module will likely make things easier for you, however, it is not an API module and the contents herein are subject to change if we need to change them. Having said that, I will note it doesn't change much.
Function Summary
  load_commands(commands_dict)
Takes in a dict and loads all the commands in that dict.
  unload_commands(commands_list)
Takes in a list of command names and removes the commands from Lyntin by calling exported.remove_command.
  unsomething_helper(args, func, ses, sing, plur)
Helps automate some of the un(something) commands.

Function Details

load_commands(commands_dict)

Takes in a dict and loads all the commands in that dict.

The dict is a mapping of command name to arguments to be passed to exported.add_command. Pretty much we just turn around and call exported.add_command with the arguments in the dict without any transformation at all.
Parameters:
commands_dict - the map holding the command names and the arguments we need to call exported.add_command repeatedly
           (type=dict)

unload_commands(commands_list)

Takes in a list of command names and removes the commands from Lyntin by calling exported.remove_command.
Parameters:
commands_list - the list of command names to remove
           (type=list of strings)

unsomething_helper(args, func, ses, sing, plur)

Helps automate some of the un(something) commands. These are commands that remove data from a given manager. For example, unalias, unaction....

This method also handles printing out status information to the user as to how many somethings were removed.
Parameters:
args - the map with the str and quiet arguments in it
           (type=dict)
func - the function to call to actually do the work. it should take in a single string argument.
           (type=function)
ses - the session to apply this to
           (type=Session)
sing - the singular form of the unsomething--for output (ex: "alias")
           (type=string)
plur - the plural form of the unsomething--for output (ex: "aliases")
           (type=string)

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