mirror of
				https://github.com/avatao-content/test-tutorial-framework
				synced 2025-11-04 11:02:56 +00:00 
			
		
		
		
	Extend docstrings in event_handler_main
This commit is contained in:
		@@ -13,6 +13,10 @@ LOG = logging.getLogger(__name__)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def cenator(history):
 | 
					def cenator(history):
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					    Logs commands executed in terminal to messages.
 | 
				
			||||||
 | 
					    !! Please remove from production code. !!
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
    LOG.debug('User executed command: "%s"', history[-1])
 | 
					    LOG.debug('User executed command: "%s"', history[-1])
 | 
				
			||||||
    MessageSender().send('JOHN CENA', f'You\'ve executed "{history[-1]}"')
 | 
					    MessageSender().send('JOHN CENA', f'You\'ve executed "{history[-1]}"')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -20,7 +24,7 @@ def cenator(history):
 | 
				
			|||||||
class TestCommands(TerminalCommands):
 | 
					class TestCommands(TerminalCommands):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Some example commands useful for debugging.
 | 
					    Some example commands useful for debugging.
 | 
				
			||||||
    Please remove from production code and inherit your own
 | 
					    !! Please remove from production code !! and inherit your own
 | 
				
			||||||
    class from TerminalCommands if you need to define custom
 | 
					    class from TerminalCommands if you need to define custom
 | 
				
			||||||
    commands in your challenge.
 | 
					    commands in your challenge.
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
@@ -92,8 +96,6 @@ if __name__ == '__main__':
 | 
				
			|||||||
    )
 | 
					    )
 | 
				
			||||||
    eventhandlers = {ide, terminal, processmanager, logmonitor}
 | 
					    eventhandlers = {ide, terminal, processmanager, logmonitor}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    terminal.historymonitor.subscribe_callback(cenator)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    commands = TestCommands(bashrc=f'/home/{TAOENV.USER}/.bashrc')
 | 
					    commands = TestCommands(bashrc=f'/home/{TAOENV.USER}/.bashrc')
 | 
				
			||||||
    terminal.historymonitor.subscribe_callback(commands.callback)
 | 
					    terminal.historymonitor.subscribe_callback(commands.callback)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user