1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

autoupdate_app_sources: use get_apps_repo

This commit is contained in:
Salamandar 2024-08-13 11:16:27 +02:00
parent 00d3c293dc
commit bac5db33b6

View file

@ -27,6 +27,7 @@ from rest_api import (
DownloadPageAPI,
RefType,
) # noqa: E402,E501 pylint: disable=import-error,wrong-import-position
import appslib.get_apps_repo as get_apps_repo
import appslib.logging_sender # noqa: E402 pylint: disable=import-error,wrong-import-position
from appslib.utils import (
get_catalog,
@ -89,10 +90,10 @@ def get_github() -> tuple[
return None, None, None
def apps_to_run_auto_update_for() -> list[str]:
def apps_to_run_auto_update_for(apps_repo: Path) -> list[str]:
apps_flagged_as_working_and_on_yunohost_apps_org = [
app
for app, infos in get_catalog().items()
for app, infos in get_catalog(apps_repo).items()
if infos["state"] == "working"
and "/github.com/yunohost-apps" in infos["url"].lower()
]
@ -744,6 +745,7 @@ def main() -> None:
parser.add_argument(
"-j", "--processes", type=int, default=multiprocessing.cpu_count()
)
get_apps_repo.add_args(parser)
args = parser.parse_args()
appslib.logging_sender.enable()
@ -756,10 +758,12 @@ def main() -> None:
sys.exit(1)
# Handle apps or no apps
apps = list(args.apps) if args.apps else apps_to_run_auto_update_for()
apps = list(args.apps) if args.apps else apps_to_run_auto_update_for(get_apps_repo.from_args(args))
apps_already = {} # for which a PR already exists
apps_updated = {}
apps_failed = {}
print(apps)
exit()
with multiprocessing.Pool(processes=args.processes) as pool:
tasks = pool.imap(