Exemplo n.º 1
0
    def test_add(self):
        def target(p):
            pass

        path = '/tmp/file_' + chr(255)
        monitor = PathMonitor()
        monitor.add(path, target)
Exemplo n.º 2
0
def plugin_loaded():
    """
    Initialize the plugin.
    Called (once) immediately after the plugin is loaded.
     - setup path monitoring.
     - validate registration.  If registered:
       - setup plugin configuration.
    """
    global path_monitor
    path = ConsumerIdentity.certpath()
    path_monitor = PathMonitor()
    path_monitor.add(path, certificate_changed)
    path_monitor.start()
    while True:
        try:
            validate_registration()
            if registered:
                update_settings()
            # DONE
            break
        except Exception as e:
            log.warn(str(e))
            sleep(60)
Exemplo n.º 3
0
 def test_add(self):
     def target(p):
         pass
     path = '/tmp/file_' + chr(255)
     monitor = PathMonitor()
     monitor.add(path, target)