#NEWLINE# @ click . command ( ) #NEWLINE# @ click_config . wrap ( module = Config , sections = ( 'logger' , 'mysql' ) , watch = True ) #NEWLINE# def waiter( watcher ) : #NEWLINE# #INDENT# '\n    :type watcher: click_config.inotify.Watcher\n    ' #NEWLINE# originalPort = Config . mysql . port #NEWLINE# with restoring_config ( 'a.yaml' ) : #NEWLINE# #INDENT# watcher . io_loop . call_later ( 0.01 , alter_yaml , 'a.yaml' , { #NEWLINE# #INDENT# 'mysql' : { #NEWLINE# #INDENT# 'port' : ( Config . mysql . port + 1 ) , #NEWLINE# 'host' : 'remotehost' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# ( section , key , value ) = watcher . io_loop . run_sync ( ( lambda : wait_for_change ( ( 'mysql' , 'port' ) , watcher ) ) ) #NEWLINE# watcher . stop ( ) #NEWLINE# #UNINDENT# assert ( ( section , key ) == ( 'mysql' , 'port' ) ) #NEWLINE# assert ( section == Config . mysql . port == ( originalPort + 1 ) )