initial checkin
[grml-etc.git] / etc / skel / .wmi / szs2.1 / szstoolbox-developer-reference.txt
1 Documentation for module szstoolbox.
2
3 Classes in szstoolbox:
4
5 Error(Exception):
6         """A general Exception which can be used/inherited 
7            from any module""" 
8
9 msg:
10 """ all functions to give messages to whatever """
11         (__init__)
12         usage:  """ prints a helpmessage to stdout
13                     Usage: msg.usage([modulename [, moduletext]])
14                     Returns: nothing """
15                     
16         help:   """ prints debugmessages if lvl >= debuglvl
17                     Usage: debug(message, lvl, source [, x=0])
18                     Returns: cache if x != 0 else True """
19                     
20         debug:  """ prints debugmessages if lvl >= debuglvl
21                     Usage: debug(message, lvl, source [, x=0])
22                     Returns: cache if x != 0 else True """
23                     
24         say:    """ parses the languagefiles and give the right text
25                     Usage: msg.say(dict, msgcode)
26                     Returns: the message in right language """
27                     
28         log:    """ sends messages to the configured logfile
29                     should only used by msg.debug """
30
31
32 cfg:
33 """ functions for reading and writing the config """
34         (__init__)
35         settings:       """ returns the actual settings
36                             Usage: cfg.settings()
37                             Returns: ['value','group','cfgF path'] """
38                       
39         read:           """ reads the configurationfile and returns the values
40                             Usage: cfg.read(value)
41                             Returns: whats inside value """
42                             
43         write:          """ this function does nothing at the moment
44                             in future it writes into the configfiles """
45
46
47 xtra:
48 """ some extra functions like counters """
49         (__init__)
50         countadd:       """ counter for addition
51                             Usage: xtra.countadd([y [,x ]])
52                             where y (standard 1) is the value to add to x
53                             Returns: the new value of x """
54                             
55         countsub:       """ counter for substraction
56                             Usage: xtra.countsub([y ],x ]),
57                             where y (standard 1) is the value to substract
58                             from x
59                             Returns: the new value of x """
60                             
61         strrotate:      """ trying to build a string rotator
62                             Usage: xtra.strrotate(str, length)
63                             where 'str' is the String to rotate in 'length' units
64                             Returns: part of str """
65                             ATTENTION: this function is untested, bugreports
66                             and suggestions are desired
67                             
68         savevar:        """ saves variables in the cache, so your module
69                             can use it later again...
70                             Usage: xtra.savevar(name, value)
71                             Returns: Boolean """
72                             
73         getvar:         """ returns the value of name
74                             Usage: xtra.getvar(name)
75                             Returns: value of name """
76                             
77         delvar:         """ deletes the variable from list
78                             Usage: xtra.delvar(name)
79                             Returns: Boolean """
80
81
82 Global variables in szstoolbox:
83
84 global cfgF:                    name of configuration file
85 global langF:                   name of language file
86 global langmod:                 alias for imported language module
87 global logfile:                 name of log file
88 global language:                name of the language (eg 'en' or 'de')
89 global accuracy:                accuracy (positions after decimal point)
90 global interval:                renew time
91 global debuglevel:              debuglevel
92 global cfgG:                    cfg('global')
93 global starttime:               secs since epoch where the script was started
94 global kernel_version:  Linux Kernel version