index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds+github@gmail.com> | 2020-11-11 21:37:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-11 21:37:40 +0000 |
commit | be8ac2558ef31bbd135ad5cea6c7f4c562061d7a (patch) | |
tree | 3ca98a8fc779aea829568b5d9b30b04532e1da1e /archinstall/lib/systemd.py | |
parent | 9a1199333a0a00b74f884dfee1b324500d4b8060 (diff) | |
parent | 4dd20ae4d4abeed916c0d1271a637dcb3c80b9a6 (diff) |
-rw-r--r-- | archinstall/lib/systemd.py | 40 |
diff --git a/archinstall/lib/systemd.py b/archinstall/lib/systemd.py new file mode 100644 index 00000000..edd75098 --- /dev/null +++ b/archinstall/lib/systemd.py @@ -0,0 +1,40 @@ +class Ini(): + def __init__(self, *args, **kwargs): + """ + Limited INI handler for now. + Supports multiple keywords through dictionary list items. + """ + self.kwargs = kwargs + + def __str__(self): + result = '' + first_row_done = False + for top_level in self.kwargs: + if first_row_done: + result += f"\n[{top_level}]\n" + else: + result += f"[{top_level}]\n" + first_row_done = True + + for key, val in self.kwargs[top_level].items(): + if type(val) == list: + for item in val: + result += f"{key}={item}\n" + else: + result += f"{key}={val}\n" + + return result + +class Systemd(Ini): + def __init__(self, *args, **kwargs): + """ + Placeholder class to do systemd specific setups. + """ + super(Systemd, self).__init__(*args, **kwargs) + +class Networkd(Systemd): + def __init__(self, *args, **kwargs): + """ + Placeholder class to do systemd-network specific setups. + """ + super(Networkd, self).__init__(*args, **kwargs)
\ No newline at end of file |