From f7a12ed161c6eddeb7f71747526eb5690ffc59b1 Mon Sep 17 00:00:00 2001 From: Nfsaavedra Date: Tue, 19 Mar 2024 20:55:51 +0000 Subject: [PATCH] run black on scripts folder --- scripts/docker_images_scraper.py | 11 ++++------- scripts/obsolete_commads_scraper.py | 8 ++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/scripts/docker_images_scraper.py b/scripts/docker_images_scraper.py index 6e7a67a9..4e006df3 100644 --- a/scripts/docker_images_scraper.py +++ b/scripts/docker_images_scraper.py @@ -1,18 +1,15 @@ import requests next_url = "https://hub.docker.com/api/content/v1/products/search?image_filter=official&page=1&page_size=100&q=&type=image" -headers = { - "Accept": "application/json", - "Search-Version": "v3" -} +headers = {"Accept": "application/json", "Search-Version": "v3"} images_list = [] while next_url: res = requests.get(next_url, headers=headers).json() - next_url = res['next'] - images = [i['name'] for i in res['summaries']] + next_url = res["next"] + images = [i["name"] for i in res["summaries"]] images_list += images -with open("official_images", 'w') as f: +with open("official_images", "w") as f: f.write("\n".join(images_list)) diff --git a/scripts/obsolete_commads_scraper.py b/scripts/obsolete_commads_scraper.py index 17341f2a..8fbcb59a 100644 --- a/scripts/obsolete_commads_scraper.py +++ b/scripts/obsolete_commads_scraper.py @@ -5,9 +5,9 @@ page = requests.get(URL) soup = BeautifulSoup(page.content, "html.parser") -table = soup.find('table', cellpadding="5", border="1") -tds = table.find_all('td', valign='top') +table = soup.find("table", cellpadding="5", border="1") +tds = table.find_all("td", valign="top") obsolete = [td.text for td in tds if len(td) == 1] -with open("obsolete_commands", 'w') as f: - f.write("\n".join(obsolete)) \ No newline at end of file +with open("obsolete_commands", "w") as f: + f.write("\n".join(obsolete))