Changeset 32
- Timestamp:
- May 17, 2007, 7:16:18 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mpd-status/trunk/mpdstatus.py
r31 r32 21 21 from sre import compile 22 22 import sys 23 23 24 state_map = { 24 25 'play': u'Playing', … … 26 27 'stop': u'Stopped' 27 28 } 29 """Mapping from the states we get from mpd to nicer display names.""" 30 28 31 fields = ['artist', 'album', 'track', 'title'] 29 strip_paths = [ 30 u'albums', 31 u'classical', 32 u'houseofdoom', 33 u'mods', 34 u'original', 35 u'soundtracks' 36 ] 32 """The fields to display.""" 33 34 strip_paths = [] 35 """List of path prefixes to remove from the filename for display.""" 36 37 37 38 38 strip_expr = compile(u'(%s)/' % ur'|'.join(strip_paths)) 39 39 40 40 def get_status(connection): 41 """Get playing state and song information. 42 43 @return: Play state and song information. 44 @rtype: C{dict} 45 @param connection: mpd connection to use. 46 @type connection: C{mpdclient2.mpd_connection} 47 """ 41 48 songinfo = {} 42 49 songinfo['state'] = state_map[connection.status()['state']]
Note: See TracChangeset
for help on using the changeset viewer.