Add upload/download of sud.json over the Sud websocket channel
Sud.download() returns the on-disk document; Sud.upload() validates, persists, and resets the schedule, refusing mid-brew or malformed input so the current schedule is never left half-applied.
This commit is contained in:
@@ -69,6 +69,11 @@ class SudTask(ATask):
|
||||
self.sud.start()
|
||||
elif 'Confirm' in pair[0]:
|
||||
self.sud.confirm()
|
||||
elif 'Download' in pair[0]:
|
||||
await self.send({'Json': self.sud.download()})
|
||||
elif 'Upload' in pair[0]:
|
||||
if self.sud.upload(pair[1]):
|
||||
await self.send({'Name': self.sud.name, 'Description': self.sud.description})
|
||||
|
||||
async def send(self, data):
|
||||
await self.msg_handler.send(data)
|
||||
|
||||
Reference in New Issue
Block a user