Changeset 29


Ignore:
Timestamp:
Feb 17, 2007, 4:34:06 PM (18 years ago)
Author:
simon
Message:

Move string formatting out of function.

File:
1 edited

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())
Note: See TracChangeset for help on using the changeset viewer.