From 40beb9ca9481904eee676571567e0e73a5a5ae6c Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 7 Jan 2022 14:15:27 +0000 Subject: [PATCH] Format code with yapf and isort This commit fixes the style issues introduced in 903c954 according to the output from yapf and isort. Details: https://deepsource.io/gh/colinxu2020/pywallpaper/transform/0b8b63d7-7342-4167-8d4c-3b155013a9e7/ --- libs.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libs.py b/libs.py index fdce367..0e4809a 100644 --- a/libs.py +++ b/libs.py @@ -38,17 +38,20 @@ def read_config(key: str) -> typing.Any: """ return config.get_config("pywallpaper")[key] -def get_page(url, headers: dict[str, str]=None): + +def get_page(url, headers: dict[str, str] = None): """ Get a page from network. - + Arguments: url: Remote address. """ if headers is None: headers = {} headers.setdefault("user-agent", "Python/Urllib/Pywallpaper/Spider keyword:Gecko") - return req.urlopen(req.Request(url, headers=headers)) # skipcq: BAN-B310 # This is INTENTIONAL, this is use to allow user define special url. + return req.urlopen( + req.Request(url, headers=headers) + ) # skipcq: BAN-B310 # This is INTENTIONAL, this is use to allow user define special url. def get_source() -> dict[str, str]: @@ -75,7 +78,9 @@ def get_wallpaper(day: int = 0) -> tuple: except KeyError: pass - exec(source["filter"], None, pkg_locals) # skipcq: PYL-W0122 # This is INTENTIONAL to run USER DEFINED filter script. + exec( + source["filter"], None, pkg_locals + ) # skipcq: PYL-W0122 # This is INTENTIONAL to run USER DEFINED filter script. pic_title, link = pkg_locals["pic_title"], pkg_locals["links"] return pic_title, link