added type hints
This commit is contained in:
@@ -105,7 +105,7 @@ def run_worker(todo: dict) -> None:
|
||||
os.chdir(sys.path[0])
|
||||
|
||||
|
||||
def do_repo_work():
|
||||
def do_repo_work() -> None:
|
||||
for repo in d:
|
||||
if d[repo]:
|
||||
logging.info("[REPO/%s] Adding %s", repo, ", ".join(d[repo]))
|
||||
@@ -141,7 +141,7 @@ def already_running() -> bool:
|
||||
return True
|
||||
|
||||
|
||||
def find_all_files_for_pkg(name, repo) -> list:
|
||||
def find_all_files_for_pkg(name: str, repo: str) -> list:
|
||||
searchpath = os.path.join(config["basedir"]["repo"], repo, "os", config["arch"]) + "/" + name + "-*.pkg.*"
|
||||
pkgs = glob.glob(searchpath)
|
||||
|
||||
@@ -152,7 +152,7 @@ def find_all_files_for_pkg(name, repo) -> list:
|
||||
return pkgs
|
||||
|
||||
|
||||
def get_failed_packages(repo) -> list:
|
||||
def get_failed_packages(repo: str) -> list:
|
||||
if os.path.exists(os.path.join(config["basedir"]["repo"], repo + "_failed.txt")):
|
||||
with open(os.path.join(config["basedir"]["repo"], repo + "_failed.txt")) as p:
|
||||
return p.read().splitlines()
|
||||
@@ -160,7 +160,7 @@ def get_failed_packages(repo) -> list:
|
||||
return []
|
||||
|
||||
|
||||
def setup_chroot():
|
||||
def setup_chroot() -> None:
|
||||
if not os.path.exists(os.path.join(config["basedir"]["chroot"], "root")):
|
||||
pathlib.Path(config["basedir"]["chroot"]).mkdir(parents=True, exist_ok=True)
|
||||
s = subprocess.run(["mkarchroot", "-C", "/usr/share/devtools/pacman-extra.conf",
|
||||
|
Reference in New Issue
Block a user