#!/usr/bin/python
import pyatspi

EVENT_COUNTER = {}

def listener(e):
    app = e.host_application
    if not (app and app.name == 'nautilus'):
        return

    count = EVENT_COUNTER.get(e.type, 0) + 1
    print "%i. %s" % (count, e)
    EVENT_COUNTER[e.type] = count

pyatspi.Registry.registerEventListener(listener, "object:property-change:accessible-name")
pyatspi.Registry.start()
