Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/systemd.py
blob: edd7509858d6db8511b98e5ba8df4ffa9a90e8f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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)