ADD: Gitlab pages

This commit is contained in:
2023-02-08 08:42:32 +00:00
parent b46367b842
commit ce55fc1c23
5 changed files with 49 additions and 10 deletions

View File

@ -32,12 +32,14 @@ def db_check_diff(current_pmodule_state, Pmodules_db_path, Pmodules_states):
print_pmodules_differences(
current_pmodule_state, old_pmodule_state, Pmodules_states
)
else:
print_to_markdown([], [], [])
# There is no database available or there are differences with the old pmodule state, writing current state.
if no_current_db or compare_states_sha(
current_pmodule_state, old_pmodule_state, current_sha
):
write_curent_state(current_pmodule_state, current_sha, Pmodules_db_path)
write_current_state(current_pmodule_state, current_sha, Pmodules_db_path)
def compare_states_sha(current_pmodule_state, old_pmodule_state, current_sha):
@ -58,11 +60,11 @@ def print_to_markdown(new_module_list, deleted_module_list, changed_module_list)
for index in range(0, len(changed_module_list) - 1, 2):
md_file.write(
changed_module_list[index]
+ "<br>Changed state from "
+ "<br/>Changed state from "
+ changed_module_list[index + 1].split()[1]
+ " to ---> "
+ changed_module_list[index].split()[1]
+ "<br>"
+ "<br/>"
)
standard_print(md_file, deleted_module_list, "Deleted modules:")
@ -143,10 +145,10 @@ def standard_print(file, module_list, string):
file.write("\n# " + string + " \n")
for diff in module_list:
if diff != "":
file.write(diff + "<br>")
file.write(diff + "<br/>")
def write_curent_state(current_pmodule_state, current_sha, Pmodules_db_path):
def write_current_state(current_pmodule_state, current_sha, Pmodules_db_path):
# Emptying Pmodules database first
if os.path.exists(Pmodules_db_path):
shutil.rmtree(Pmodules_db_path)