Format code with black and autopep8

This commit fixes the style issues introduced in 860017f according to the output
from black and autopep8.

Details: https://deepsource.io/gh/GradienceTeam/Gradience/transform/43e44155-dc6d-4ee4-8305-dba40b160c08/
This commit is contained in:
deepsource-autofix[bot] 2022-09-12 21:11:48 +00:00 committed by GitHub
parent 860017fd8d
commit 77ceef46a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,10 +25,12 @@ from .utils import to_slug_case, buglog
import aiohttp
import asyncio
async def fetch(session, url):
async with session.get(url) as response:
return await response.text()
async def main(repo):
async with aiohttp.ClientSession() as session:
try:
@ -67,8 +69,9 @@ async def main(repo):
def fetch_presets(repo) -> [dict, list]:
return asyncio.run(main(repo))
async def _download_preset(name, repo_name, url) -> None:
async with aiohttp.ClientSession() as session:
async with aiohttp.ClientSession() as session:
try:
http = await fetch(session, url)
except aiohttp.ClientError as error:
@ -87,7 +90,7 @@ async def _download_preset(name, repo_name, url) -> None:
with open(
os.path.join(
os.environ.get("XDG_CONFIG_HOME",
os.environ["HOME"] + "/.config"),
os.environ["HOME"] + "/.config"),
"presets",
repo_name,
to_slug_case(name) + ".json",
@ -100,5 +103,6 @@ async def _download_preset(name, repo_name, url) -> None:
except OSError as error:
buglog(f"Failed to write data to a file. Exc: {error}")
def download_preset(name, repo_name, url) -> None:
asyncio.run(_download_preset(name, repo_name, url))