Mercurial > codedump
comparison updatechromium.py @ 40:2aa9614cb39a
flake8
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 21 Jun 2021 15:16:15 -0400 |
parents | a93c352af05e |
children |
comparison
equal
deleted
inserted
replaced
39:a93c352af05e | 40:2aa9614cb39a |
---|---|
66 if check_for_file("chromium") == 0: | 66 if check_for_file("chromium") == 0: |
67 print("Chromium is still running! Exiting...") | 67 print("Chromium is still running! Exiting...") |
68 sys.exit(1) | 68 sys.exit(1) |
69 owner = "ungoogled-software" | 69 owner = "ungoogled-software" |
70 repo = "ungoogled-chromium-archlinux" | 70 repo = "ungoogled-chromium-archlinux" |
71 json = json.loads(urllib.request.urlopen(f"https://api.github.com/repos/{owner}/{repo}/releases").read()) | 71 json = json.loads(urllib.request.urlopen( |
72 f"https://api.github.com/repos/{owner}/{repo}/releases").read()) | |
72 check_version(json[0]["tag_name"]) | 73 check_version(json[0]["tag_name"]) |
73 for i in json[0]["assets"]: | 74 for i in json[0]["assets"]: |
74 if i["content_type"] == "application/octet-stream": | 75 if i["content_type"] == "application/octet-stream": |
75 download_url(f"{i['browser_download_url']}", "/tmp/chromium.tar.zst") | 76 download_url(f"{i['browser_download_url']}", "/tmp/chromium.tar.zst") |
76 os.system("sudo pacman -U /tmp/chromium.tar.zst") | 77 os.system("sudo pacman -U /tmp/chromium.tar.zst") |