Skip to content

Commit 0abf945

Browse files
committed
Remove task over api
1 parent 5e0ec74 commit 0abf945

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

CaSSAndRA/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22

3-
#Version:0.203.1 Bug fix in resume action if a task is pre-loaded
3+
#Version:0.204.0 Remove task over api
44
# package imports
55
import os
66
import sys

CaSSAndRA/src/backend/comm/api.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def check_cmd(self, buffer: dict) -> None:
218218
logger.info('No valid object in api message found. Aborting')
219219

220220
def check_tasks_cmd(self, buffer: dict) -> None:
221-
allowed_cmds = ['select', 'load', 'save', 'calculate']
221+
allowed_cmds = ['select', 'load', 'save', 'calculate', 'remove']
222222
if 'command' in buffer:
223223
command = [buffer['command']]
224224
command = list(set(command).intersection(allowed_cmds))
@@ -230,6 +230,9 @@ def check_tasks_cmd(self, buffer: dict) -> None:
230230
elif command[0] == 'save':
231231
self.command = command[0]
232232
self.perform_tasks_save_cmd(buffer)
233+
elif command[0] == 'remove':
234+
self.command = command[0]
235+
self.perform_tasks_remove_cmd(buffer)
233236
else:
234237
self.command = command[0]
235238
self.perform_tasks_load_cmd(buffer)
@@ -424,6 +427,14 @@ def perform_tasks_save_cmd(self, buffer: dict) -> None:
424427
except Exception as e:
425428
logger.error('Task save over api failed.')
426429
logger.error(str(e))
430+
431+
def perform_tasks_remove_cmd(self, buffer: dict) -> None:
432+
try:
433+
value = buffer['value']
434+
saveddata.remove_task(tasks.saved, tasks.saved_parameters, value, current_map.name)
435+
except Exception as e:
436+
logger.error('Task remove over api failed')
437+
logger.error(str(e))
427438

428439
def perform_tasks_load_cmd(self, buffer: dict) -> None:
429440
if 'value' in buffer:

CaSSAndRA/src/backend/data/appdata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
logger = logging.getLogger(__name__)
33

44

5-
version = '0.203.1'
5+
version = '0.204.0'
66

77
# global ui messages
88
cmdTransmissionFailed: bool = False

0 commit comments

Comments
 (0)