config: rename load.py to file.py (MR 2252)

It's weird to have a function with the same name as the module, rename
it to avoid confusion.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-06-10 23:11:00 +02:00 committed by Oliver Smith
parent 59ad8fd507
commit f643673f48
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 3 additions and 2 deletions

View file

@ -12,7 +12,7 @@ from pmb.types import PmbArgs
import pmb.helpers.apk import pmb.helpers.apk
import pmb.helpers.run import pmb.helpers.run
import pmb.config import pmb.config
import pmb.config.load import pmb.config.file
import pmb.parse.apkindex import pmb.parse.apkindex
import pmb.helpers.http import pmb.helpers.http
import pmb.parse.version import pmb.parse.version

View file

@ -11,7 +11,7 @@ from typing import Dict, List, Sequence
# #
# FIXME (#2324): this sucks, we should re-organise this and not rely on "lifting" # FIXME (#2324): this sucks, we should re-organise this and not rely on "lifting"
# this functions this way # this functions this way
from pmb.config.load import load, save, serialize from pmb.config.file import load, save, serialize
from pmb.config.sudo import which_sudo from pmb.config.sudo import which_sudo
from pmb.config.other import is_systemd_selected from pmb.config.other import is_systemd_selected

View file

@ -54,6 +54,7 @@ def load(path: Path) -> Config:
# One time migration "mirror_alpine" -> mirrors.alpine # One time migration "mirror_alpine" -> mirrors.alpine
if "mirror_alpine" in cfg["pmbootstrap"] or "mirrors_postmarketos" in cfg["pmbootstrap"]: if "mirror_alpine" in cfg["pmbootstrap"] or "mirrors_postmarketos" in cfg["pmbootstrap"]:
logging.info("Migrating config file to 3.0 format.")
save(path, config) save(path, config)
return config return config