diff --git a/app/classes/shared/controller.py b/app/classes/shared/controller.py index 7c5bf2a8..d486e22a 100644 --- a/app/classes/shared/controller.py +++ b/app/classes/shared/controller.py @@ -51,7 +51,7 @@ class Controller: continue # if this server path no longer exists - let's warn and bomb out - if not helper.check_path_exits(s['path']): + if not helper.check_path_exists(s['path']): logger.warning("Unable to find server {} at path {}. Skipping this server".format(s['server_name'], s['path'])) diff --git a/app/classes/shared/helpers.py b/app/classes/shared/helpers.py index 5784010f..68ddec24 100644 --- a/app/classes/shared/helpers.py +++ b/app/classes/shared/helpers.py @@ -9,6 +9,7 @@ import base64 import socket import random import logging +import html from datetime import datetime from socket import gethostname @@ -280,7 +281,7 @@ class Helpers: return "%.1f%s%s" % (num, 'Y', suffix) @staticmethod - def check_path_exits(path: str): + def check_path_exists(path: str): logger.debug('Looking for path: {}'.format(path)) if os.path.exists(path): @@ -463,6 +464,34 @@ class Helpers: return data + @staticmethod + def generate_tree(folder, output=""): + for raw_filename in os.listdir(folder): + print(raw_filename) + filename = html.escape(raw_filename) + print(filename) + rel = os.path.join(folder, raw_filename) + if os.path.isdir(rel): + output += \ + """