Commit b1eee15e authored by shadMod's avatar shadMod 💬

replaced UITWWW_DIR with data_path in Downloads().__init__

replaced BASE_DIR with data_path in main.init
parent 7a31eb04
Pipeline #337 passed with stage
in 0 seconds
......@@ -80,7 +80,7 @@ def create_app(data_path, debug=False):
return app
def init_data_directory(data_path):
def init_data_directory(data_path: str):
"""Initialize the data directory"""
src_directory = os.path.dirname(os.path.abspath(__file__))
......
......@@ -30,7 +30,7 @@ from . import cache
from . import launchpad
from .constants import UITWWW_DIR
CONFIG_FILE = "/../data/downloads.toml"
DOWNLOAD_FILE = "downloads.toml"
CACHE_FILE = "download-cache.json"
CACHE_FILE_VERSION = 1
......@@ -43,7 +43,7 @@ class Downloads:
self._sha256sums = None
# Load the configuration
path = UITWWW_DIR + CONFIG_FILE
path = os.path.join(data_path, DOWNLOAD_FILE)
self.config = toml.load(
path, _dict=collections.OrderedDict,
)
......
......@@ -88,7 +88,7 @@ def init(data, debug):
uitwww.init_data_directory(data_path)
print("Created data directory:", data)
compiler = CompileVersion(
path_out=BASE_DIR + "/data/downloads.toml",
path_out=data_path + "/downloads.toml",
constants=UITWWW_DIR + "/src/download/assets/constants.json",
)
compiler.compile_download()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment