diff --git a/regina/main.py b/regina/main.py index 714557c..554b281 100644 --- a/regina/main.py +++ b/regina/main.py @@ -6,6 +6,8 @@ from os.path import isfile, isdir from visualize import visualize from settings_manager import read_settings_file +version = "1.0" + # default settings, these are overwriteable through a config file settings = { # GENERAL @@ -87,6 +89,7 @@ if __name__ == '__main__': if not isfile(config_file): error(f"Not a file: '{config_file}'") read_settings_file(config_file, settings) + settings["version"] = version if not settings["server-name"]: missing_arg("server-name") if not settings["access-log"]: missing_arg("log") diff --git a/regina/template.html b/regina/template.html index 12e98c1..60f2a30 100644 --- a/regina/template.html +++ b/regina/template.html @@ -34,5 +34,6 @@ Referer ranking +

These analytics were generated by regina %regina_version

diff --git a/regina/visualize.py b/regina/visualize.py index 21097e7..cb1b751 100644 --- a/regina/visualize.py +++ b/regina/visualize.py @@ -340,11 +340,15 @@ def visualize(loaded_settings: dict): img_dir = settings["img_dir"] img_filetype = settings["img_filetype"] names = { + # general + "regina_version": settings["version"] + # paths "img_file_ranking": f"{img_dir}/ranking_all_time_files.{img_filetype}", "img_referer_ranking": f"{img_dir}/ranking_all_time_referers.{img_filetype}", "img_browser_ranking": f"{img_dir}/ranking_all_time_browsers.{img_filetype}", "img_operating_system_ranking": f"{img_dir}/ranking_all_time_operating_systems.{img_filetype}", "img_daily": f"{img_dir}/user_request_count_daily.{img_filetype}", + # values "mobile_user_percentage": 0.0, "server-name": settings["server-name"], "last_x_days": settings["last_x_days"],