forked from Mirror/pmbootstrap
Auto-format codebase with ruff (MR 2325)
See: https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2324 Closes: https://gitlab.com/postmarketOS/pmbootstrap/-/merge_requests/2278
This commit is contained in:
parent
5a8e2c6cad
commit
e421bb2d41
109 changed files with 4044 additions and 2984 deletions
|
@ -6,7 +6,7 @@ from typing import Optional
|
|||
from pmb.core.pkgrepo import pkgrepo_glob_one, pkgrepo_iglob
|
||||
|
||||
|
||||
def find_path(codename: str, file='') -> Optional[Path]:
|
||||
def find_path(codename: str, file="") -> Optional[Path]:
|
||||
"""Find path to device APKBUILD under `device/*/device-`.
|
||||
|
||||
:param codename: device codename
|
||||
|
@ -29,10 +29,10 @@ def list_codenames(vendor=None, archived=True):
|
|||
"""
|
||||
ret = []
|
||||
for path in pkgrepo_iglob("device/*/device-*"):
|
||||
if not archived and 'archived' in path.parts:
|
||||
if not archived and "archived" in path.parts:
|
||||
continue
|
||||
device = os.path.basename(path).split("-", 1)[1]
|
||||
if (vendor is None) or device.startswith(vendor + '-'):
|
||||
if (vendor is None) or device.startswith(vendor + "-"):
|
||||
ret.append(device)
|
||||
return ret
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue