Changeset 32 for mpd-status

Show
Ignore:
Timestamp:
17/05/07 19:16:18 (5 years ago)
Author:
simon
Message:

A doc-comment, shock! Remove my custom list of prefixes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • mpd-status/trunk/mpdstatus.py

    r31 r32  
    2121from sre import compile 
    2222import sys 
     23 
    2324state_map = { 
    2425    'play': u'Playing', 
     
    2627    'stop': u'Stopped' 
    2728    } 
     29"""Mapping from the states we get from mpd to nicer display names.""" 
     30 
    2831fields = ['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 
     34strip_paths = [] 
     35"""List of path prefixes to remove from the filename for display.""" 
     36 
    3737 
    3838strip_expr = compile(u'(%s)/' % ur'|'.join(strip_paths)) 
    3939 
    4040def 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    """ 
    4148    songinfo = {} 
    4249    songinfo['state'] = state_map[connection.status()['state']]