initial checkin
[grml-etc.git] / etc / skel / .wmi / szs2.1 / text.py
1 #!/usr/bin/python
2
3 # module to show specific text static or as marquee
4
5 from szstoolbox import CFG,XTRA
6
7 def init():
8         cfg = CFG('text')
9         xtra = XTRA()
10         global xtra,txt,bar,marq,l
11         txt = str(cfg.read('txt')).strip()
12         bar = str(cfg.read('bar')).strip()
13         marq = int(cfg.read('marquee'))
14         if marq == 1:
15                 l = int(cfg.read('length'))
16         else:
17                 l = None
18
19 def main():
20         ret = ['','']
21         if not 'txt' in globals():
22                 init()
23         else:
24                 if marq == 1:
25                         ret[0] = xtra.strrotate(txt,l)[1]
26                 else:
27                         ret[0] = txt
28
29                 if len(bar) > 0:
30                         ret[1] = bar
31                 else:
32                         ret[1] = '' 
33
34                 return ret
35
36         return ret