code refactoring , mod update fix

This commit is contained in:
Ayush Saini 2023-08-15 16:43:07 +05:30
parent 7d5eb76ea7
commit 5e1ab245a9
93 changed files with 193555 additions and 26399 deletions

View file

@ -5,15 +5,15 @@
from __future__ import annotations
from typing import TYPE_CHECKING
import json
from functools import lru_cache
import json
import _babase
from typing import TYPE_CHECKING
if TYPE_CHECKING:
pass
SETTINGS_PATH = _babase.env().get("python_directory_user", "") + "/setting.json"
@ -29,11 +29,13 @@ def get_settings_data() -> dict:
with open(SETTINGS_PATH, mode="r", encoding="utf-8") as data:
return json.load(data)
def refresh_cache() -> None:
get_settings_data.cache_clear()
# lets cache it again
get_settings_data()
def commit(data: dict) -> None:
"""Commits the data in setting file.