blob: 2e6fde90f56fa8743965d16c292af5fd6657c346 (
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
#!/bin/python
import os
if "DISPLAY" in os.environ and os.environ["DISPLAY"]:
mode="gui"
else:
mode="tui"
if mode == "gui":
# We need this so we can tell GI to look for overrides objects
# also in anaconda source directories
import gi.overrides
for p in os.environ.get("ANACONDA_WIDGETS_OVERRIDES", "").split(":"):
gi.overrides.__path__.insert(0, p)
# set the root path to / so the imported spokes
# know where to apply their changes
from pyanaconda.constants import ROOT_PATH
ROOT_PATH = "/"
from pyanaconda.addons import collect_addon_paths
addon_paths = ["/usr/share/initial-setup/modules", "/usr/share/anaconda/addons"]
addon_module_paths = collect_addon_paths(addon_paths)
# Too bad anaconda does not have modularized logging
from pyanaconda import anaconda_log
anaconda_log.init()
# Prepare new data object
from pyanaconda import kickstart
data = kickstart.AnacondaKSHandler(addon_module_paths["ks"])
# Replace storage commands by Dummy objects
# TODO
# Read the installed kickstart
parser = kickstart.AnacondaKSParser(data)
parser.readKickstart("anaconda-ks.cfg")
if mode == "gui":
# Import IS gui specifics
import gui
# Add addons to search paths
gui.InitialSetupGraphicalUserInterface.update_paths(addon_module_paths)
# Initialize the UI
ui = gui.InitialSetupGraphicalUserInterface(None, None, None)
else:
# Import IS gui specifics
import tui
# Add addons to search paths
tui.InitialSetupTextUserInterface.update_paths(addon_module_paths)
# Initialize the UI
ui = tui.InitialSetupTextUserInterface(None, None, None)
# Pass the data object to user inteface
ui.setup(data)
# Start the application
ui.run()
# Print the kickstart file
print data
|