mirror of
https://github.com/WGDashboard/WGDashboard-PRW.git
synced 2026-08-03 22:42:57 +00:00
Chore: Corrected some documentation and missing parameters
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
|
.idea/*
|
||||||
*.db
|
*.db
|
||||||
dist
|
dist
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ from .config_utils import config_utils
|
|||||||
class config():
|
class config():
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def filter(config_data: dict, filter_keyword: str) -> tuple[bool, dict]:
|
def filter(config_data: dict, filter_keyword: str) -> tuple[bool, dict]:
|
||||||
'''
|
"""
|
||||||
Helper function to grab a specific part of the config
|
Helper function to grab a specific part of the config
|
||||||
'''
|
"""
|
||||||
lower_filter_keyword = filter_keyword.lower()
|
lower_filter_keyword = filter_keyword.lower()
|
||||||
|
|
||||||
for section_name, section_values in config_data.items():
|
for section_name, section_values in config_data.items():
|
||||||
@@ -23,9 +23,9 @@ class config():
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def read() -> tuple[bool, dict]:
|
def read() -> tuple[bool, dict]:
|
||||||
'''
|
"""
|
||||||
check some basic things and then return the dict containing the config data
|
check some basic things and then return the dict containing the config data
|
||||||
'''
|
"""
|
||||||
|
|
||||||
ok, candidate_path = config_utils.search_known_paths()
|
ok, candidate_path = config_utils.search_known_paths()
|
||||||
if not ok:
|
if not ok:
|
||||||
@@ -46,7 +46,7 @@ class config():
|
|||||||
|
|
||||||
ok, config_data = config.read()
|
ok, config_data = config.read()
|
||||||
if not ok:
|
if not ok:
|
||||||
log.error("failed to read the config succesfully")
|
log.error("failed to read the config successfully")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if not config_utils.find_section(config_data, lower_target_section):
|
if not config_utils.find_section(config_data, lower_target_section):
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import os
|
|||||||
class config_utils():
|
class config_utils():
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def search_known_paths() -> tuple[bool, str]:
|
def search_known_paths() -> tuple[bool, str]:
|
||||||
'''
|
"""
|
||||||
Look at predefined paths on the filesystem for a config file
|
Look at predefined paths on the filesystem for a config file
|
||||||
'''
|
"""
|
||||||
|
|
||||||
possible_config_locations = [
|
possible_config_locations = [
|
||||||
"./config.ini",
|
"./config.ini",
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class localeman:
|
|||||||
return json.load(lang_file)
|
return json.load(lang_file)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_available_languages():
|
def get_available_languages(self):
|
||||||
available_languages_path = "./static/locales/supported_locales.json"
|
available_languages_path = "./static/locales/supported_locales.json"
|
||||||
|
|
||||||
with open(os.path.join(available_languages_path), "r") as f:
|
with open(os.path.join(available_languages_path), "r") as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user