Changeset 29

Show
Ignore:
Timestamp:
17/02/07 16:34:06 (5 years ago)
Author:
simon
Message:

Move string formatting out of function.

Files:
1 modified

Legend:

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

    r28 r29  
    2727    } 
    2828fields = ['artist', 'album', 'track', 'title'] 
    29 format = '♫ %(state)s: %(song)s' 
    3029strip_paths = [ 
    3130    'albums', 
     
    4645        ' - '.join([song[f] for f in fields if song.has_key(f)]) \ 
    4746        or strip_expr.sub('', splitext(song['file'])[0]).replace(sep, ' - ') 
    48     return format % songinfo 
     47    return songinfo 
    4948 
    5049if __name__ == '__main__': 
    5150    from mpdclient2 import connect 
    52     print get_status(connect()) 
     51    format = '♫ %(state)s: %(song)s' 
     52    print format % get_status(connect())