main.py 384 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env python2
  2. from mpd import MPDClient
  3. import config
  4. client = MPDClient()
  5. def setup():
  6. client.connect(config.HOST, config.PORT)
  7. def cleanup():
  8. client.close()
  9. client.disconnect()
  10. def reload_config():
  11. cleanup()
  12. setup()
  13. def main():
  14. client.send_idle()
  15. events = client.fetch_idle()
  16. for event in events:
  17. print '[hmmm::event]', event