@@ -0,0 +1,1303 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport time%0A%0Aimport dbus.service%0Afrom gi.repository import GObject%0Afrom dbus.mainloop.glib import DBusGMainLoop%0A%0A%0A# user test path: edit this variable to hold any watch you'd like to test%0Auser_test_path = ''%0A%0A%0Adef callback(access_time):%0A    print time.ctime(access_time)%0A%0Adef parrot_proxy():%0A    if not user_test_path:%0A        print 'Error: must set %22user_test_path%22 to valid path'%0A        return%0A    conn = dbus.bus.BusConnection(%0A                    'unix:path=/run/user/1000/dbus/user_bus_socket',%0A                     mainloop=DBusGMainLoop()%0A                                 )%0A    bus = dbus.service.BusName('org.Parrot', conn)%0A    proxy = conn.get_object(bus.get_name(), '/org/Parrot')%0A    proxy.connect_to_signal('accessed', callback, %0A                            dbus_interface='org.Parrot.Inotify')%0A%0A    watch_method = proxy.get_dbus_method('current_watch')%0A    add_watch = proxy.get_dbus_method('add_watch')%0A    print %22Calling 'add_watch' method...%22%0A    add_watch(user_test_path)%0A    print %22Calling 'current_watch' method...%22%0A    cur_watch = watch_method() %0A    print %22Currently watched: %25s%22 %25 cur_watch%0A    print %22Waiting on signal 'accessed'...%22%0A    %0A    loop = GObject.MainLoop()%0A    loop.run()%0A%0A%0Aif __name__ == %22__main__%22:%0A    parrot_proxy()%0A

change dbus_signal file name