#!/usr/bin/env python3importasabimportasab.libraryimportasab.zookeeperclassMyApplication(asab.Application):def__init__(self):super().__init__()asab.Config["library"]["providers"]="git+https://github.com/TeskaLabs/asab.git"self.LibraryService=asab.library.LibraryService(self,"LibraryService",)# Continue only if the library is readyself.PubSub.subscribe("Library.ready!",self.on_library_ready)self.PubSub.subscribe("Library.change!",self.on_library_change)# NOTE: Git Provider periodically pulls changes once per minuteasyncdefon_library_ready(self,event_name,library=None):items=awaitself.LibraryService.list("/",recursive=True)print("# Library\n")foriteminitems:print(" *",item)print("\n===")# Add subscription for changes in pathsawaitself.LibraryService.subscribe(["/asab"])defon_library_change(self,msg,provider,path):print("\N{rabbit} New changes in the library found by provider: '{}'".format(provider))if__name__=='__main__':app=MyApplication()app.run()