From 251a0eaefb8eef4fbdd687d32fd5d46f309fa270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20Ma=C5=84ko?= Date: Sat, 25 May 2024 15:52:06 +0200 Subject: [PATCH] treewide: fix outstanding Python lint issues --- flavors/lineageos/update_device_metadata.py | 1 - scripts/robotnix_common.py | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/flavors/lineageos/update_device_metadata.py b/flavors/lineageos/update_device_metadata.py index 286701eb..79f710b2 100755 --- a/flavors/lineageos/update_device_metadata.py +++ b/flavors/lineageos/update_device_metadata.py @@ -4,7 +4,6 @@ from typing import Any import json -import urllib.request import os import pathlib diff --git a/scripts/robotnix_common.py b/scripts/robotnix_common.py index 814b2d44..fa5db2ad 100644 --- a/scripts/robotnix_common.py +++ b/scripts/robotnix_common.py @@ -33,21 +33,21 @@ def save(filename: str, data: Any) -> None: ) -def get_store_path(path): +def get_store_path(path_str: str) -> str: """Get actual path to a Nix store path; supports handling local remotes""" - prefix = os.getenv("NIX_REMOTE") + prefix_str = os.getenv("NIX_REMOTE") - if not prefix: - return path + if not prefix_str: + return path_str - prefix = Path(prefix) + prefix = Path(prefix_str) if not prefix.is_absolute(): raise Exception( f"Must be run on a local Nix store. Current Nix store: {prefix}" ) - path = Path(path).resolve() + path = Path(path_str).resolve() remote_path = prefix.resolve().joinpath( path.relative_to(f"{path.drive}{path.root}") )