From 0b651abb7d139654f2a3ea5219f10025e2186a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Thu, 19 Apr 2018 10:47:20 +0200 Subject: [PATCH] Nicen some EventHandler API docstrings --- lib/tfw/components/terminado_event_handler.py | 6 ++++-- lib/tfw/components/webide_event_handler.py | 16 ++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/tfw/components/terminado_event_handler.py b/lib/tfw/components/terminado_event_handler.py index e2501bc..9578b33 100644 --- a/lib/tfw/components/terminado_event_handler.py +++ b/lib/tfw/components/terminado_event_handler.py @@ -54,7 +54,8 @@ class TerminadoEventHandler(EventHandlerBase): Writes a string to the terminal session (on the pty level). Useful for pre-typing and executing commands for the user. - :param data['shellcmd']: command to be written to the pty + :param data: TFW message data containing keys: + |-shellcmd: command to be written to the pty """ self.terminado_server.pty.write(data['shellcmd']) @@ -62,7 +63,8 @@ class TerminadoEventHandler(EventHandlerBase): """ Reads the history of commands executed. - :param data['count']: the number of history elements to return + :param data: TFW message data containing keys: + |-count: the number of history elements to return :return: message with list of commands in data['history'] """ data['count'] = int(data.get('count', 1)) diff --git a/lib/tfw/components/webide_event_handler.py b/lib/tfw/components/webide_event_handler.py index 1f81f0c..7196981 100644 --- a/lib/tfw/components/webide_event_handler.py +++ b/lib/tfw/components/webide_event_handler.py @@ -141,7 +141,8 @@ class WebideEventHandler(EventHandlerBase, MonitorManagerMixin): """ Overwrites a file with the desired string. - :param data['content']: string containing the desired file contents + :param data: TFW message data containing keys: + |-string: containing the desired file contents """ self.monitor.ignore = self.monitor.ignore + 1 try: @@ -155,7 +156,8 @@ class WebideEventHandler(EventHandlerBase, MonitorManagerMixin): """ Selects a file from the current directory. - :param data['filename']: name of file to select relative to the current directory + :param data: TFW message data containing keys: + |-filename: name of file to select relative to the current directory """ try: self.filemanager.filename = data['filename'] @@ -167,9 +169,10 @@ class WebideEventHandler(EventHandlerBase, MonitorManagerMixin): """ Select a new working directory to display files from. - :param data['directory']: absolute path of diretory to select. - must be a path whitelisted in - self.allowed_directories + :param data: TFW message data containing keys: + |-directory: absolute path of diretory to select. + must be a path whitelisted in + self.allowed_directories """ try: self.filemanager.workdir = data['directory'] @@ -187,7 +190,8 @@ class WebideEventHandler(EventHandlerBase, MonitorManagerMixin): """ Overwrite list of excluded files - :param data['exclude']: list of filename patterns to be excluded, e.g.: ["*.pyc", "*.o"] + :param data: TFW message data containing keys: + |-exclude: list of filename patterns to be excluded, e.g.: ["*.pyc", "*.o"] """ try: self.filemanager.exclude = list(data['exclude'])