Re: [dev] [wmii] Python monitor function failure

2010-06-23 Thread Thomas Dahms
On 06/23/2010 02:58 PM, m g wrote: > You can use the codecs module. Something like: > > import codecs > > @defmonitor > def anowplaying(self): > try: > np = codecs.open('/tmp/shell-fm', 'r', 'utf-8').read() > except: > np = '' > return wmii.cache['normcolors'], np Th

Re: [dev] [wmii] Python monitor function failure

2010-06-23 Thread m g
You can use the codecs module. Something like: import codecs @defmonitor def anowplaying(self): try: np = codecs.open('/tmp/shell-fm', 'r', 'utf-8').read() except: np = '' return wmii.cache['normcolors'], np Though im not so sure having a blanket except is so useful.

[dev] [wmii] Python monitor function failure

2010-06-23 Thread Thomas Dahms
Hi, I have this status bar function in my wmiirc.py: @defmonitor def anowplaying(self): try: np=open('/tmp/shell-fm').read() except: np=' ' return wmii.cache['normcolors'], np Where /tmp/shell-fm is a now-playing file generated by shell-fm. Until recently, this just w