Explorar el Código

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

master
JustAnotherArchivist hace 1 año
padre
commit
9c1f803e13
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. +4
    -2
      github-list-repos

+ 4
- 2
github-list-repos Ver fichero

@@ -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):


Cargando…
Cancelar
Guardar