Continue writig thesis
This commit is contained in:
39
listings/config.ts
Normal file
39
listings/config.ts
Normal file
@ -0,0 +1,39 @@
|
||||
export const config = {
|
||||
documentTitle: 'Avatao Tutorials',
|
||||
dashboard: {
|
||||
route: 'dashboard',
|
||||
triggerFirstFSMStep: 'step_1',
|
||||
askReloadSite: false,
|
||||
recoverAfterPageReload: true,
|
||||
terminalOrConsole: 'terminal',
|
||||
currentLayout: 'terminal-ide-web',
|
||||
iframeUrl: '/webservice',
|
||||
hideMessages: false
|
||||
},
|
||||
ide: {
|
||||
route: 'ide',
|
||||
autoSaveInterval: 444,
|
||||
defaultCode: 'Loading your file...',
|
||||
defaultLanguage: 'text',
|
||||
deployProcessName: 'webservice',
|
||||
showDeployButton: true,
|
||||
reloadIframeOnDeploy: false,
|
||||
showConsoleOnDeploy: true,
|
||||
autoDetectFileLanguage: true,
|
||||
},
|
||||
messages: {
|
||||
route: 'messages',
|
||||
showNextButton: false,
|
||||
messageQueueWPM: 150
|
||||
},
|
||||
console: {
|
||||
route: 'console',
|
||||
defaultContent: '',
|
||||
rewriteContentWithProcessLogsOnDeploy: 'stdout',
|
||||
showLiveLogs: true,
|
||||
defaultLogs: {
|
||||
stdout: '',
|
||||
stderr: ''
|
||||
}
|
||||
},
|
||||
};
|
15
listings/event_handler_main.py
Normal file
15
listings/event_handler_main.py
Normal file
@ -0,0 +1,15 @@
|
||||
fsm = FSMManagingEventHandler( # TFW FSM
|
||||
key='fsm',
|
||||
fsm_type=TestFSM
|
||||
)
|
||||
ide = IdeEventHandler( # Web IDE backend
|
||||
key='ide',
|
||||
allowed_directories=[TFWENV.IDE_WD, TFWENV.WEBSERVICE_DIR],
|
||||
directory=TFWENV.IDE_WD,
|
||||
exclude=['*.pyc']
|
||||
)
|
||||
logmonitor = LogMonitoringEventHandler( # Sends live logs of webservice process to frontend
|
||||
key='logmonitor',
|
||||
process_name='webservice',
|
||||
log_tail=2000
|
||||
)
|
16
listings/test_fsm.py
Normal file
16
listings/test_fsm.py
Normal file
@ -0,0 +1,16 @@
|
||||
from os.path import exists
|
||||
from tfw.fsm import LinearFSM
|
||||
from tfw.networking import MessageSender
|
||||
|
||||
class TestFSM(LinearFSM):
|
||||
def __init__(self):
|
||||
super().__init__(2)
|
||||
self.subscribe_predicate('step_1', self.step_1_allowed)
|
||||
|
||||
@staticmethod
|
||||
def step_1_allowed():
|
||||
return exists('allow_step_1')
|
||||
|
||||
def on_enter_1(self, event_data):
|
||||
MessageSender().message_sender.send('FSM', 'Entered state 1!')
|
||||
|
12
listings/test_fsm.yml
Normal file
12
listings/test_fsm.yml
Normal file
@ -0,0 +1,12 @@
|
||||
states:
|
||||
- name: '0'
|
||||
- name: '1'
|
||||
on_enter: >
|
||||
python3 -c "from tfwconnector import MessageSender;
|
||||
MessageSender().send('FSM', 'Entered state 1!')"
|
||||
transitions:
|
||||
- trigger: step_1
|
||||
source: '0'
|
||||
dest: '1'
|
||||
predicates:
|
||||
- '[ -f allow_step_1 ]' # in bash -f means that the file exists
|
16
listings/test_tfw_structure.txt
Normal file
16
listings/test_tfw_structure.txt
Normal file
@ -0,0 +1,16 @@
|
||||
.
|
||||
├── config.yml
|
||||
│
|
||||
├── hack/
|
||||
│ └── tfw.sh
|
||||
│
|
||||
├── controller/
|
||||
│ └── Dockerfile
|
||||
│
|
||||
└── solvable/
|
||||
├── Dockerfile
|
||||
├── frontend
|
||||
├── nginx
|
||||
├── src
|
||||
└── supervisor
|
||||
|
Reference in New Issue
Block a user