Loading tools/builder/builder.py +15 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,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 +383,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 +14 −2 Original line number Diff line number Diff line Loading @@ -13,8 +13,6 @@ import requests 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 +97,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 +118,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 +15 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,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 +383,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 +14 −2 Original line number Diff line number Diff line Loading @@ -13,8 +13,6 @@ import requests 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 +97,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 +118,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