1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import time
24 import signal
25 import parted
26 from constants import *
27 from flags import flags
28 from iutil import strip_markup
29 from installinterfacebase import InstallInterfaceBase
30
31 import gettext
32 _ = lambda x: gettext.ldgettext("anaconda", x)
33
34 import logging
35 log = logging.getLogger("anaconda")
36
37
46
47 stepToClasses = { "install" : setupProgressDisplay }
48
56
60
63
64 - def set(self, amount):
65 if amount == self.total:
66 print(_("Completed"))
67
70
71 - def __init__(self, title, text, total, updpct = 0.05, pulse = False):
72 self.total = total
73 print(text)
74 print(_("In progress"))
75
82
85
87 errtxt = _("(%s)\nCommand line mode requires all choices to be specified in a "
88 "kickstart configuration file." % (title,))
89 raise RuntimeError(errtxt)
90
93
96
99
100 - def progressWindow(self, title, text, total, updpct = 0.05, pulse = False):
102
104 errtxt = _("The following error was found while parsing the "
105 "kickstart configuration file:\n\n%s") % (text,)
106 raise RuntimeError(errtxt)
107
108 - def messageWindow(self, title, text, type="ok", default = None,
109 custom_icon = None, custom_buttons = []):
110 if type == "ok":
111 print(text)
112 else:
113 errtxt = _("(%s)\n%s" % (title, text))
114 raise RuntimeError(errtxt)
115
116 - def detailedMessageWindow(self, title, text, longText=None, type="ok",
117 default=None, custom_buttons=None,
118 custom_icon=None, expanded=False):
124
125 - def passphraseEntryWindow(self, device):
126 errtxt = _("Can't have a question in command line mode!")
127 errtxt += "\n(passphraseEntryWindow: '%s')" % (device,)
128 raise RuntimeError(errtxt)
129
131 errtxt = _("Can't have a question in command line mode!")
132 errtxt += "\n(getLUKSPassphrase)"
133 raise RuntimeError(errtxt)
134
136 errtxt = "(enableNetwork)\n"
137 errtxt += _("Can't have a question in command line mode!")
138 raise RuntimeError(errtxt)
139
141 errtxt = "(questionInitializeDASD)\n"
142 errtxt += _("Can't have a question in command line mode!")
143 raise RuntimeError(errtxt)
144
145 - def mainExceptionWindow(self, shortText, longTextFile):
147
150
153
154 - def run(self, anaconda):
157
159 if stepToClasses.has_key(step):
160 stepToClasses[step](self.anaconda)
161 else:
162 errtxt = _("In interactive step can't continue. (%s)" %(step,))
163 raise RuntimeError(errtxt)
164
166 self.instProgress = c
167
170 self.pct = 0
171 self.display = ""
172
175
184 - def set_text(self, txt):
187 stripped = strip_markup(txt)
188 if stripped != self.display:
189 self.display = stripped
190 print(self.display)
191
200