Revision 373765333135 () - Diff

Link to this snippet: https://friendpaste.com/iYeN6E0DbNlRMAA6x6gee
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python

import urllib
import pynotify
from time import sleep, time
from simplejson import loads

server = '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)