File: test.py

package info (click to toggle)
py-libmpdclient 0.11.1-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, squeeze, wheezy
  • size: 48 kB
  • ctags: 47
  • sloc: python: 261; makefile: 33
file content (38 lines) | stat: -rw-r--r-- 739 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/python

import mpdclient2
m = mpdclient2.connect()

print m.status() # -> prints status object

outputs = m.outputs()

print 'i got %d output(s)' % len(outputs)

for output in outputs:
    print "here's an output"
    print "  id:", output.outputid
    print "  name:", output.outputname
    print "  enabled:", ('no', 'yes')[int(output.outputenabled)]

######

print "let's find some beck songs"

beck_songs = m.find("artist", "beck")

print 'i got %d beck song(s)' % len(beck_songs)

if len(beck_songs) > 5:
    print ".. but let's just look at the first 5"

for i, song in enumerate(beck_songs[:5]):
    print "%4d. %s -- %s" % (i+1, song.album, song.title)


print m.currentsong()

m.find('foo', 'bar')
print m.talker.ack