Skip to content

Commit

Permalink
treewide: fix outstanding Python lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jaen committed Jun 7, 2024
1 parent 1120e12 commit 251a0ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion flavors/lineageos/update_device_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from typing import Any
import json
import urllib.request
import os
import pathlib

Expand Down
12 changes: 6 additions & 6 deletions scripts/robotnix_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
)
Expand Down

0 comments on commit 251a0ea

Please sign in to comment.