mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-12-22 23:51:56 +00:00
Nicen some EventHandler API docstrings
This commit is contained in:
parent
b1592e8ebb
commit
0b651abb7d
@ -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))
|
||||
|
@ -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'])
|
||||
|
Loading…
Reference in New Issue
Block a user