Skip to content

Commit a1d6030

Browse files
author
games647
committed
Fix formatting
1 parent 43eee1d commit a1d6030

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/checkers/urlchecker.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ def extract_version(checker_data, url):
6060

6161
return m.group(1)
6262

63+
6364
def is_same_version(checker_data, current_url, new_version):
6465
"""
6566
Check if the new application version is the same with the current one. If the version number could be extracted,
6667
those strings are compared with each other to be resilient against load-balanced urls pointing to the same file.
6768
"""
68-
if new_version is None or new_version.version is None:
69+
if new_version.version is None:
6970
# No pattern given or failed parsing the new version, so check only if the url is different
7071
return current_url == new_version.url
7172

@@ -77,6 +78,7 @@ def is_same_version(checker_data, current_url, new_version):
7778

7879
return current_version_string == new_version.version
7980

81+
8082
class URLChecker(Checker):
8183
PRIORITY = 99
8284
CHECKER_DATA_TYPE = "rotating-url"
@@ -154,7 +156,9 @@ async def check(self, external_data: ExternalBase):
154156
if not is_rotating:
155157
new_version = new_version._replace(url=url) # pylint: disable=no-member
156158

157-
same_version = is_same_version(external_data.checker_data, external_data.current_version.url, new_version)
159+
same_version = is_same_version(
160+
external_data.checker_data, external_data.current_version.url, new_version
161+
)
158162
external_data.set_new_version(
159163
new_version,
160164
is_update=is_rotating and not same_version,

src/lib/externaldata.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,8 @@ def json(self) -> t.Dict[str, t.Any]:
319319
def matches(self, other: ExternalFile):
320320
for i in (self, other):
321321
assert i.checksum is None or isinstance(i.checksum, MultiDigest), i.checksum
322-
return (
323-
self.checksum == other.checksum
324-
and (self.size is None or other.size is None or self.size == other.size)
322+
return self.checksum == other.checksum and (
323+
self.size is None or other.size is None or self.size == other.size
325324
)
326325

327326
def is_same_version(self, other: ExternalFile):

0 commit comments

Comments
 (0)