forked from CreatBot/CreatBotKlipperScreen
fixup for 34f80ce4
This commit is contained in:
@@ -194,7 +194,7 @@ class MoonrakerApi:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def get_file_dir(self, path='gcodes', callback=None, *args):
|
def get_file_dir(self, path='gcodes', callback=None, *args):
|
||||||
logging.debug("Sending server.files.directory")
|
logging.debug(f"Sending server.files.directory {path}")
|
||||||
return self._ws.send_method(
|
return self._ws.send_method(
|
||||||
"server.files.list",
|
"server.files.list",
|
||||||
{"path": path},
|
{"path": path},
|
||||||
@@ -212,7 +212,7 @@ class MoonrakerApi:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def get_dir_info(self, callback=None, directory='gcodes', *args):
|
def get_dir_info(self, callback=None, directory='gcodes', *args):
|
||||||
logging.debug("Sending server.files.get_directory")
|
logging.debug(f"Sending server.files.get_directory {directory}")
|
||||||
return self._ws.send_method(
|
return self._ws.send_method(
|
||||||
"server.files.get_directory",
|
"server.files.get_directory",
|
||||||
{"path": directory},
|
{"path": directory},
|
||||||
|
@@ -91,9 +91,9 @@ class KlippyFiles:
|
|||||||
if 'result' not in result or 'dirs' not in result['result']:
|
if 'result' not in result or 'dirs' not in result['result']:
|
||||||
return
|
return
|
||||||
for x in result['result']['dirs']:
|
for x in result['result']['dirs']:
|
||||||
if x not in self.directories:
|
if x not in self.directories and not x['dirname'].startswith('.'):
|
||||||
self.directories.append(x)
|
self.directories.append(x)
|
||||||
self.get_dir_info(x['dirname'])
|
self.get_dir_info(f"{params['path']}/{x['dirname']}")
|
||||||
|
|
||||||
def add_file(self, item, notify=True):
|
def add_file(self, item, notify=True):
|
||||||
if 'filename' not in item and 'path' not in item:
|
if 'filename' not in item and 'path' not in item:
|
||||||
|
Reference in New Issue
Block a user