diff options
Diffstat (limited to 'config.py')
| -rw-r--r-- | config.py | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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) + |
