From 9c1f803e13a857a6c22a47bd6220fd7a77800a21 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Mon, 23 Jan 2023 07:21:47 +0000 Subject: [PATCH] Get rid of shell quoting and print name/fullname on separate lines instead --- github-list-repos | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/github-list-repos b/github-list-repos index 484b513..6bf01c2 100755 --- a/github-list-repos +++ b/github-list-repos @@ -60,7 +60,8 @@ for user in users: if not mfullname: print('Error: could not find name h1', file = sys.stderr) sys.exit(1) - print(f'{shlex.quote(html.unescape(musername.group(1).strip()))} {shlex.quote(html.unescape(mfullname.group(1).strip()))}') + print(html.unescape(musername.group(1).strip().replace('\n', ' ').replace('\r', ' '))) + print(html.unescape(mfullname.group(1).strip().replace('\n', ' ').replace('\r', ' '))) r = get(f'https://github.com/orgs/{user}/repositories') page = 1 while True: @@ -82,7 +83,8 @@ for user in users: fullname = html.unescape(m.group(1).strip()) else: fullname = '' - print(f'{shlex.quote(html.unescape(musername.group(1).strip()))} {shlex.quote(fullname)}') + print(html.unescape(musername.group(1).strip()).replace('\n', ' ').replace('\r', ' ')) + print(fullname.replace('\n', ' ').replace('\r', ' ')) r = get(f'https://github.com/{user}?tab=repositories') while True: for m in re.finditer(r'"]+)" itemprop="name codeRepository"(\s[^>]*)?>', r.text):