From 6e77bfb893ce580bc4c5454d356cbed7e3f0884a Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Tue, 23 Oct 2018 17:02:37 +0300 Subject: [PATCH] build_manifest.py: Use .format instead %s for templates --- gitlab/build_manifest.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gitlab/build_manifest.py b/gitlab/build_manifest.py index 71a5f57..2ee0e88 100755 --- a/gitlab/build_manifest.py +++ b/gitlab/build_manifest.py @@ -25,10 +25,10 @@ GSTREAMER_MODULES: List[str] = [ MANIFEST_TEMPLATE: str = """ - + -%s +{} """ @@ -38,6 +38,7 @@ def request(path: str) -> Dict[str, str]: return requests.get('https://gitlab.gnome.org/api/v4/' + path, headers=gitlab_header).json() + def find_repository_sha(module: str, branchname: str) -> Tuple[str, str]: for project in request('projects?search=' + module): if project['name'] != module: @@ -82,7 +83,7 @@ if __name__ == "__main__": # Shouldn't be needed. remote: str = "git://anongit.freedesktop.org/gstreamer/" projects: str = '' - project_template: str = ' \n' + project_template: str = " \n" user_remote: str = os.path.dirname(os.environ['CI_PROJECT_URL']) for module in GSTREAMER_MODULES: print(f"Checking {module}:", end=' ') @@ -98,7 +99,7 @@ if __name__ == "__main__": if not revision: revision = 'master' - projects += project_template % (module, remote, revision) + projects += project_template.format(module, remote, revision) with open('manifest.xml', mode='w') as manifest: - print(MANIFEST_TEMPLATE % (user_remote, projects), file=manifest) + print(MANIFEST_TEMPLATE.format(user_remote, projects), file=manifest) -- 2.7.4