summaryrefslogtreecommitdiff
path: root/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'config.py')
-rw-r--r--config.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/config.py b/config.py
index d8bdd7d..a86475d 100644
--- a/config.py
+++ b/config.py
@@ -6,6 +6,8 @@ class Config:
__DIR = os.path.dirname(__file__)
ASSETS_IMPORT_PATH = "/assets"
ASSETS_IMPORT_PATH_STATIC = "https://static.wazul.moe"
+ MAIN_ROOT_URL = "https://wazul.moe"
+ GIT_ROOT_URL = "https://git.wazul.moe"
RSS_FILE_NAME = "feed.xml"
TIMEZONE = datetime.timezone(datetime.timedelta(hours=2))
@@ -40,3 +42,18 @@ class Config:
CODENAMES_ROOT_URL = "https://codenames.wazul.moe"
CODENAMES_ASSETS_SOURCE_DIR = os.path.join(__DIR, "codenames/assets")
+
+ # HELPER FUNCTIONS
+ @staticmethod
+ def change_url_to_local(url: str) -> str:
+ return url.replace("https://", "http://").replace("wazul.moe", "localhost")
+
+ @staticmethod
+ def change_config_to_local():
+ Config.ASSETS_IMPORT_PATH_STATIC = Config.change_url_to_local(Config.ASSETS_IMPORT_PATH_STATIC)
+ Config.MAIN_ROOT_URL = Config.change_url_to_local(Config.MAIN_ROOT_URL)
+ Config.GIT_ROOT_URL = Config.change_url_to_local(Config.GIT_ROOT_URL)
+ Config.BLOG_ROOT_URL = Config.change_url_to_local(Config.BLOG_ROOT_URL)
+ Config.COMIC_ROOT_URL = Config.change_url_to_local(Config.COMIC_ROOT_URL)
+ Config.CODENAMES_ROOT_URL = Config.change_url_to_local(Config.CODENAMES_ROOT_URL)
+