Replace hacky 'call-out-to-shell' with an actual API call
Might possibly have a shot at, if nothing else, helping us get a little closer to finding the cause of #2.
This commit is contained in:
parent
302d352da4
commit
dbfac1ace5
2
app.py
2
app.py
|
@ -183,7 +183,7 @@ def ship(request,ship=None):
|
|||
author = f.readline().strip()
|
||||
yield f"=> /{urlencoded}/AUTHOR © {year} {author}\n"
|
||||
else:
|
||||
username = (subprocess.run(["/usr/bin/stat","-c","%U",os.path.join("/var/gopher",ship_unquoted)],stdout=subprocess.PIPE).stdout or b"unknown").decode("utf-8").strip()
|
||||
username = (Path("/var/gopher") / ship_unquoted).owner()
|
||||
yield f"© {year} {username}\n"
|
||||
license_file = os.path.join("/var/gopher",ship_unquoted,"LICENSE")
|
||||
if os.path.exists(license_file):
|
||||
|
|
Loading…
Reference in New Issue