瀏覽代碼

Get rid of shell quoting and print name/fullname on separate lines instead

master
JustAnotherArchivist 1 年之前
父節點
當前提交
9c1f803e13
共有 1 個檔案被更改,包括 4 行新增2 行删除
  1. +4
    -2
      github-list-repos

+ 4
- 2
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'<a href="/([^/>"]+/[^/>"]+)" itemprop="name codeRepository"(\s[^>]*)?>', r.text):


Loading…
取消
儲存