couchmon delete lock Revision 373765333135 (Tue May 05 2009 at 15:27) - Diff Link to this snippet: https://friendpaste.com/iYeN6E0DbNlRMAA6x6gee Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 123456789101112131415161718192021#!/usr/bin/env pythonimport urllibimport pynotifyfrom time import sleep, timefrom simplejson import loadsserver = 'http://localhost:5984/'pynotify.init('couchmon')n = pynotify.Notification(server)while True: tasks = loads(urllib.urlopen('%s_active_tasks' % server).read()) if tasks: n.props.body = "\n".join(["%s (%s): %s" % (t['type'], t['task'], t['status']) for t in tasks]) n.show() sleep(5)