mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-12-23 04:11:56 +00:00
Make excluded stuff in FileManager configurable from __init__()
This commit is contained in:
parent
b224ed519d
commit
7858caf51a
@ -9,8 +9,8 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class FileManager:
|
||||
def __init__(self, working_directory, selected_file=None):
|
||||
self.exclude = ['__pycache__']
|
||||
def __init__(self, working_directory, selected_file=None, exclude=None):
|
||||
self.exclude = exclude if exclude is not None else []
|
||||
self._workdir = None
|
||||
self.workdir = working_directory
|
||||
self.filename = selected_file or self.files[0]
|
||||
@ -54,9 +54,9 @@ class FileManager:
|
||||
|
||||
|
||||
class SourceCodeEventHandler(TriggerlessEventHandler):
|
||||
def __init__(self, key, directory, selected_file=None):
|
||||
def __init__(self, key, directory, selected_file=None, exclude=None):
|
||||
super().__init__(key)
|
||||
self.filemanager = FileManager(directory, selected_file=selected_file)
|
||||
self.filemanager = FileManager(directory, selected_file=selected_file, exclude=exclude)
|
||||
|
||||
self.commands = {
|
||||
'read': self.read,
|
||||
|
@ -9,7 +9,7 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
ide = SourceCodeEventHandler('webide', tfwenv.WEBIDE_WD)
|
||||
ide = SourceCodeEventHandler('webide', tfwenv.WEBIDE_WD, ['__pycache__'])
|
||||
terminado = TerminadoEventHandler('shell')
|
||||
terminado.historymonitor.subscribe_callback(lambda hist: log.debug('User executed command: "{}"'.format(hist[-1])))
|
||||
processmanager = ProcessManagingEventHandler('processmanager', ide.monitor)
|
||||
|
Loading…
Reference in New Issue
Block a user