file_manager: implement file_list_changed notifcation

This notification is moved from moonraker.py.  Instead of sending a filelist, it now updates the file list and sends all relevant information to the client.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine
2020-07-26 20:05:43 -04:00
committed by Eric Callahan
parent 829dd27aa2
commit b6f8ba775c
4 changed files with 30 additions and 28 deletions

View File

@@ -336,16 +336,6 @@ class Server:
ServerError("Klippy Host not connected", 503))
return base_request
def notify_filelist_changed(self, filename, action):
file_manager = self.lookup_plugin('file_manager')
try:
filelist = file_manager.get_file_list(format_list=True)
except ServerError:
filelist = []
result = {'filename': filename, 'action': action,
'filelist': filelist}
self.send_event("server:filelist_changed", result)
async def _kill_server(self):
# XXX - Currently this function is not used.
# Should I expose functionality to shutdown