Loading tools/builder/builder.py +16 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ from urllib.parse import quote, urlencode import requests from yaml import full_load, YAMLError from jinja2 import Environment, FileSystemLoader, TemplateNotFound import argparse # Import the config module from tools.utils.utils import Config Loading Loading @@ -363,6 +364,17 @@ def add_placeholder(): template = env.get_template(utils.TEMPLATE_PLACEHOLDER) file_handle.write(template.render()) def argparse_setup(): """Setup argparse Return ------ obj Python object with arguments parsed """ parser = argparse.ArgumentParser() return parser.parse_args() def main(): """ Main function, multiple-purpose: Loading @@ -372,8 +384,12 @@ def main(): - Create jobs index """ # Setup argparse args = argparse_setup() # logging logging.basicConfig(level=logging.INFO) # Iterate over every directories in jobs directory to create their job.md for the documentation jobs = listdir(utils.JOBS_DIR) for job in jobs: Loading tools/job_gitlab_labels/job_gitlab_labels.py +15 −2 Original line number Diff line number Diff line Loading @@ -8,13 +8,12 @@ import sys from urllib.parse import quote, urlencode from os import getenv, listdir import requests import argparse # Import the config module from tools.utils.utils import Config utils = Config() def get_labels(project_name, with_counts=False, include_ancestor_groups=True, search=""): """Get labels of the project, can also serach for a specific label with search filter Loading Loading @@ -99,6 +98,17 @@ def delete_label(project_name, label_name): logging.info(f"Deleting a label {label_name} for the project {project_name}") return (requests.delete(url, headers=headers)) def argparse_setup(): """Setup argparse Return ------ obj Python object with arguments parsed """ parser = argparse.ArgumentParser() return parser.parse_args() if __name__ == "__main__": """Main function if used as a program Looping through all jobs to check if their scoped Loading @@ -109,6 +119,9 @@ if __name__ == "__main__": boolean 0 if nothing is wrong, 1 otherwise """ # Setup argparse args = argparse_setup() # Setup logging logging.basicConfig( encoding="utf-8", Loading Loading
tools/builder/builder.py +16 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ from urllib.parse import quote, urlencode import requests from yaml import full_load, YAMLError from jinja2 import Environment, FileSystemLoader, TemplateNotFound import argparse # Import the config module from tools.utils.utils import Config Loading Loading @@ -363,6 +364,17 @@ def add_placeholder(): template = env.get_template(utils.TEMPLATE_PLACEHOLDER) file_handle.write(template.render()) def argparse_setup(): """Setup argparse Return ------ obj Python object with arguments parsed """ parser = argparse.ArgumentParser() return parser.parse_args() def main(): """ Main function, multiple-purpose: Loading @@ -372,8 +384,12 @@ def main(): - Create jobs index """ # Setup argparse args = argparse_setup() # logging logging.basicConfig(level=logging.INFO) # Iterate over every directories in jobs directory to create their job.md for the documentation jobs = listdir(utils.JOBS_DIR) for job in jobs: Loading
tools/job_gitlab_labels/job_gitlab_labels.py +15 −2 Original line number Diff line number Diff line Loading @@ -8,13 +8,12 @@ import sys from urllib.parse import quote, urlencode from os import getenv, listdir import requests import argparse # Import the config module from tools.utils.utils import Config utils = Config() def get_labels(project_name, with_counts=False, include_ancestor_groups=True, search=""): """Get labels of the project, can also serach for a specific label with search filter Loading Loading @@ -99,6 +98,17 @@ def delete_label(project_name, label_name): logging.info(f"Deleting a label {label_name} for the project {project_name}") return (requests.delete(url, headers=headers)) def argparse_setup(): """Setup argparse Return ------ obj Python object with arguments parsed """ parser = argparse.ArgumentParser() return parser.parse_args() if __name__ == "__main__": """Main function if used as a program Looping through all jobs to check if their scoped Loading @@ -109,6 +119,9 @@ if __name__ == "__main__": boolean 0 if nothing is wrong, 1 otherwise """ # Setup argparse args = argparse_setup() # Setup logging logging.basicConfig( encoding="utf-8", Loading