From 4a2e037fd6f8f0db28d262a0418626056b6e93e1 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 7 Oct 2020 15:01:10 +0200 Subject: [PATCH] gst-worktree: add support for wrap file without 'directory' field The script is currently not usable because of pango.wrap not having the 'directory' field and relying on the default from the file name. Part-of: --- gst-worktree.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gst-worktree.py b/gst-worktree.py index 9999bcf2ee..0032a2a6db 100755 --- a/gst-worktree.py +++ b/gst-worktree.py @@ -29,7 +29,9 @@ def parse_wrapfile(wrapf): if 'wrap-git' not in cgp: return None section = cgp['wrap-git'] - return section['directory'], section['revision'] + # Default to the wrapper filename if 'directory' field is missing + directory = section.get('directory', os.path.splitext(os.path.basename(wrapf))[0]) + return directory, section['revision'] def get_wrap_subprojects(srcdir, gst_branch): '''