mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-07-02 09:19:56 +00:00
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:
parent
860017fd8d
commit
77ceef46a7
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue