1 | import wx |
---|
2 | import wx.wizard as wiz |
---|
3 | import sys |
---|
4 | import os |
---|
5 | import gettext |
---|
6 | import string |
---|
7 | import subprocess |
---|
8 | import time |
---|
9 | from subprocess import Popen |
---|
10 | import commands |
---|
11 | from wx.lib.mixins.listctrl import CheckListCtrlMixin |
---|
12 | import wx.lib.filebrowsebutton as filebrowse |
---|
13 | |
---|
14 | cat = gettext.GNUTranslations(open(sys.argv[1])) |
---|
15 | _ = cat.gettext |
---|
16 | |
---|
17 | global command_log |
---|
18 | command_log = '' |
---|
19 | global FinalArgs |
---|
20 | FinalArgs = ['','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''] |
---|
21 | #global client_pxe_cfg_filename |
---|
22 | #client_pxe_cfg_filename = '' |
---|
23 | global PXE_CFG_Files |
---|
24 | PXE_CFG_Files = [] |
---|
25 | global Labels |
---|
26 | Labels = [] |
---|
27 | #global selected_hosts, selected_clients, lenghth |
---|
28 | |
---|
29 | #---------------------------------------------------------------------- |
---|
30 | ClonezillaStartSaveArgs = { |
---|
31 | 1: ("-q", _('msg_ocs_param_q')), |
---|
32 | 2: ("-c", _('msg_ocs_param_c')), |
---|
33 | 3: ("-nogui", _('msg_ocs_param_nogui')), |
---|
34 | 4: ("-a", _('msg_ocs_param_a')), |
---|
35 | 5: ("-f", _('msg_ocs_param_f')), |
---|
36 | 6: ("-s", _('msg_ocs_param_s')), |
---|
37 | 7: ("-ntfs-ok", _('msg_ocs_param_notfs_ok')), |
---|
38 | } |
---|
39 | |
---|
40 | #---------------------------------------------------------------------- |
---|
41 | ClonezillaStartRestoreArgs = { |
---|
42 | 1: ("-g auto", _('msg_ocs_param_g_auto')), |
---|
43 | 2: ("-x", _('msg_ocs_param_x')), |
---|
44 | 3: ("-brdcst", _('msg_ocs_param_broadcast')), |
---|
45 | 4: ("-v", _('msg_ocs_param_v')), |
---|
46 | 5: ("-nogui", _('msg_ocs_param_nogui')), |
---|
47 | 6: ("-c", _('msg_ocs_param_c')), |
---|
48 | 7: ("-u", _('msg_ocs_param_u')), |
---|
49 | 8: ("-t", _('msg_ocs_param_t')), |
---|
50 | 9: ("-j0", _('msg_ocs_param_j0')), |
---|
51 | 10: ("-ns", _('msg_ocs_param_ns')), |
---|
52 | 11: ("-k", _('msg_ocs_param_k')), |
---|
53 | 12: ("-r", _('msg_ocs_param_r')), |
---|
54 | 13: ("-e", _('msg_ocs_param_e')), |
---|
55 | 14: ("-f", _('msg_ocs_param_f')), |
---|
56 | 15: ("-s", _('msg_ocs_param_s')), |
---|
57 | 16: ("-a", _('msg_ocs_param_a')), |
---|
58 | 17: ("-o", _('msg_ocs_param_o')), |
---|
59 | 18: ("-hn0", _('msg_ocs_param_hn0')), |
---|
60 | 19: ("-hn1", _('msg_ocs_param_hn1')), |
---|
61 | } |
---|
62 | |
---|
63 | #---------------------------------------------------------------------- |
---|
64 | class CSSCheckListCtrl(wx.ListCtrl, CheckListCtrlMixin): |
---|
65 | def __init__(self, parent, log): |
---|
66 | wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT) |
---|
67 | CheckListCtrlMixin.__init__(self) |
---|
68 | self.log = log |
---|
69 | self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated) |
---|
70 | |
---|
71 | def OnItemActivated(self, evt): |
---|
72 | self.ToggleItem(evt.m_itemIndex) |
---|
73 | |
---|
74 | # this is called by the base class when an item is checked/unchecked |
---|
75 | def OnCheckItem(self, index, flag): |
---|
76 | data = self.GetItemData(index) |
---|
77 | arg = ClonezillaStartSaveArgs[data][0] |
---|
78 | if flag: |
---|
79 | FinalArgs[index+3] = arg |
---|
80 | else: |
---|
81 | FinalArgs[index+3] = '' |
---|
82 | |
---|
83 | #---------------------------------------------------------------------- |
---|
84 | class CSRCheckListCtrl(wx.ListCtrl, CheckListCtrlMixin): |
---|
85 | def __init__(self, parent, log): |
---|
86 | wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT) |
---|
87 | CheckListCtrlMixin.__init__(self) |
---|
88 | self.log = log |
---|
89 | self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated) |
---|
90 | |
---|
91 | def OnItemActivated(self, evt): |
---|
92 | self.ToggleItem(evt.m_itemIndex) |
---|
93 | |
---|
94 | # this is called by the base class when an item is checked/unchecked |
---|
95 | def OnCheckItem(self, index, flag): |
---|
96 | data = self.GetItemData(index) |
---|
97 | arg = ClonezillaStartRestoreArgs[data][0] |
---|
98 | if flag: |
---|
99 | if index == 18: |
---|
100 | FinalArgs[index+4] = arg |
---|
101 | else: |
---|
102 | FinalArgs[index+3] = arg |
---|
103 | else: |
---|
104 | if index == 18: |
---|
105 | FinalArgs[index+4] = '' |
---|
106 | else: |
---|
107 | FinalArgs[index+3] = '' |
---|
108 | |
---|
109 | #---------------------------------------------------------------------- |
---|
110 | def makePageTitle(wizPg, title): |
---|
111 | sizer = wx.BoxSizer(wx.VERTICAL) |
---|
112 | wizPg.SetSizer(sizer) |
---|
113 | title = wx.StaticText(wizPg, -1, title) |
---|
114 | title.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD)) |
---|
115 | sizer.Add(title, 0, wx.ALIGN_CENTRE|wx.ALL, 5) |
---|
116 | sizer.Add(wx.StaticLine(wizPg, -1), 0, wx.EXPAND|wx.ALL, 5) |
---|
117 | return sizer |
---|
118 | |
---|
119 | #---------------------------------------------------------------------- |
---|
120 | class WizardBasePage(wiz.PyWizardPage): |
---|
121 | def __init__(self, parent, title): |
---|
122 | wiz.PyWizardPage.__init__(self, parent) |
---|
123 | self.next = self.prev = None |
---|
124 | self.sizer = makePageTitle(self, title) |
---|
125 | |
---|
126 | def SetNext(self, next): |
---|
127 | self.next = next |
---|
128 | |
---|
129 | def SetPrev(self, prev): |
---|
130 | self.prev = prev |
---|
131 | |
---|
132 | def GetNext(self): |
---|
133 | return self.next |
---|
134 | |
---|
135 | def GetPrev(self): |
---|
136 | return self.prev |
---|
137 | |
---|
138 | #---------------------------------------------------------------------- |
---|
139 | class SetAllClientsPage(wiz.PyWizardPage): |
---|
140 | def __init__(self, parent, title): |
---|
141 | wiz.PyWizardPage.__init__(self, parent) |
---|
142 | self.next = self.prev = None |
---|
143 | self.sizer = makePageTitle(self, title) |
---|
144 | |
---|
145 | self.cb = wx.CheckBox(self, -1, _('msg_title_set_all_clients')) |
---|
146 | self.cb.SetValue(True) |
---|
147 | self.sizer.Add(self.cb, 0, wx.ALL, 5) |
---|
148 | FinalArgs[1] = '-nl' |
---|
149 | |
---|
150 | def SetNext(self, next): |
---|
151 | self.next = next |
---|
152 | |
---|
153 | def SetPrev(self, prev): |
---|
154 | self.prev = prev |
---|
155 | |
---|
156 | def GetNext(self): |
---|
157 | next = self.next |
---|
158 | if self.cb.GetValue(): |
---|
159 | FinalArgs[1] = '-nl' |
---|
160 | next = next.GetNext() |
---|
161 | else: |
---|
162 | FinalArgs[1] = '-h' |
---|
163 | return next |
---|
164 | |
---|
165 | def GetPrev(self): |
---|
166 | return self.prev |
---|
167 | |
---|
168 | #---------------------------------------------------------------------- |
---|
169 | class SelectOneClientPage(wiz.PyWizardPage): |
---|
170 | def __init__(self, parent, title): |
---|
171 | wiz.PyWizardPage.__init__(self, parent) |
---|
172 | self.next = self.prev = None |
---|
173 | self.sizer = makePageTitle(self, title) |
---|
174 | self.selected_hosts = [] |
---|
175 | self.selected_clients = '' |
---|
176 | self.lenghth = 0 |
---|
177 | self.filename_temp = [] |
---|
178 | |
---|
179 | file = open("/home/chris/ip_list", "r") |
---|
180 | ip_list = file.read() |
---|
181 | tokens = ("%s" % ip_list).split() |
---|
182 | self.lenghth = len(tokens) |
---|
183 | for i in range(0,len(tokens)): |
---|
184 | self.selected_hosts.insert(len(tokens),"") |
---|
185 | i = i+1 |
---|
186 | file.close() |
---|
187 | |
---|
188 | rb = wx.RadioBox( |
---|
189 | self, -1, _('msg_choose_mode'), (35, 50), (260,590), |
---|
190 | tokens, 1, wx.RA_SPECIFY_COLS |
---|
191 | ) |
---|
192 | |
---|
193 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
194 | FinalArgs[1] = '-h' |
---|
195 | FinalArgs[2] = "\"" + tokens[0] + "\"" |
---|
196 | |
---|
197 | def EvtRadioBox(self, event): |
---|
198 | FinalArgs[2] = "" |
---|
199 | FinalArgs[2] = "\"" + event.GetString() + "\"" |
---|
200 | |
---|
201 | def SetNext(self, next): |
---|
202 | self.next = next |
---|
203 | |
---|
204 | def SetPrev(self, prev): |
---|
205 | self.prev = prev |
---|
206 | |
---|
207 | def GetNext(self): |
---|
208 | next = self.next |
---|
209 | return next |
---|
210 | |
---|
211 | def GetPrev(self): |
---|
212 | FinalArgs[1] = "" |
---|
213 | FinalArgs[2] = "" |
---|
214 | return self.prev |
---|
215 | |
---|
216 | #---------------------------------------------------------------------- |
---|
217 | class SelectClientsPage(wiz.PyWizardPage): |
---|
218 | def __init__(self, parent, title): |
---|
219 | wiz.PyWizardPage.__init__(self, parent) |
---|
220 | self.next = self.prev = None |
---|
221 | self.sizer = makePageTitle(self, title) |
---|
222 | self.selected_hosts = [] |
---|
223 | self.selected_clients = '' |
---|
224 | self.lenghth = 0 |
---|
225 | self.filename_temp = [] |
---|
226 | |
---|
227 | g = open("/home/chris/ip_list", "r") |
---|
228 | ip_list = g.read() |
---|
229 | tokens = ("%s" % ip_list).split() |
---|
230 | self.lenghth = len(tokens) |
---|
231 | for i in range(0,len(tokens)): |
---|
232 | self.selected_hosts.insert(len(tokens),"") |
---|
233 | i = i+1 |
---|
234 | g.close() |
---|
235 | |
---|
236 | lb = wx.CheckListBox(self, -1, (35,50), (290,250), tokens) |
---|
237 | self.Bind(wx.EVT_CHECKLISTBOX, self.EvtCheckListBox, lb) |
---|
238 | lb.SetSelection(0) |
---|
239 | counts = lb.GetCount() |
---|
240 | self.lb = lb |
---|
241 | pos = lb.GetPosition().x + lb.GetSize().width + 25 |
---|
242 | |
---|
243 | def EvtCheckListBox(self, event): |
---|
244 | j = 0 |
---|
245 | index = event.GetSelection() |
---|
246 | label = self.lb.GetString(index) |
---|
247 | if self.lb.IsChecked(index): |
---|
248 | del self.selected_hosts[index] |
---|
249 | self.selected_hosts.insert(index,label) |
---|
250 | if not (self.lb.IsChecked(index)): |
---|
251 | self.selected_hosts.remove(label) |
---|
252 | self.selected_hosts.insert(index,'') |
---|
253 | self.lb.SetSelection(index) #so that (un)checking also selects (moves the highlight) |
---|
254 | self.selected_clients = '' |
---|
255 | clients_pxe_cfg_filename = '' |
---|
256 | self.filename_temp = [] |
---|
257 | while j < self.lenghth: |
---|
258 | if self.selected_hosts[j] != '': |
---|
259 | self.selected_clients = self.selected_clients + self.selected_hosts[j] + ' ' |
---|
260 | ip = self.selected_hosts[j] |
---|
261 | ip_divide = ("%s" % ip).split(".") |
---|
262 | clients_pxe_cfg_filename = string.upper("%x" % int(ip_divide[0],10) + "%x" % int(ip_divide[1],10) + "%x" % int(ip_divide[2],10) + "%x" % int(ip_divide[3],10)) |
---|
263 | self.filename_temp.append(clients_pxe_cfg_filename) |
---|
264 | j = j+1 |
---|
265 | self.selected_clients = '\"' + self.selected_clients + '\"' |
---|
266 | FinalArgs[2] = self.selected_clients |
---|
267 | |
---|
268 | def SetNext(self, next): |
---|
269 | self.next = next |
---|
270 | |
---|
271 | def SetPrev(self, prev): |
---|
272 | self.prev = prev |
---|
273 | |
---|
274 | def GetNext(self): |
---|
275 | global PXE_CFG_Files |
---|
276 | if self.selected_clients == '\"\"' or self.selected_clients == '': |
---|
277 | FinalArgs[1] = '-nl' |
---|
278 | FinalArgs[2] = '' |
---|
279 | else: |
---|
280 | FinalArgs[1] = '-h' |
---|
281 | PXE_CFG_Files[:] = self.filename_temp[:] |
---|
282 | return self.next |
---|
283 | |
---|
284 | def GetPrev(self): |
---|
285 | self.selected_clients = '' |
---|
286 | clients_pxe_cfg_filename = '' |
---|
287 | self.filename_temp = [] |
---|
288 | return self.prev |
---|
289 | |
---|
290 | #---------------------------------------------------------------------- |
---|
291 | class RemoteLinuxGraPage(wiz.PyWizardPage): |
---|
292 | def __init__(self, parent, title): |
---|
293 | wiz.PyWizardPage.__init__(self, parent) |
---|
294 | self.next = self.prev = None |
---|
295 | self.sizer = makePageTitle(self, title) |
---|
296 | |
---|
297 | wx.StaticText(self, -1, _('msg_remote_linux_graphic'),(50,100)) |
---|
298 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
299 | FinalArgs[3] = 'remote-linux-gra' |
---|
300 | self.j = 0 |
---|
301 | self.command = '' |
---|
302 | |
---|
303 | def SetNext(self, next): |
---|
304 | self.next = next |
---|
305 | |
---|
306 | def SetPrev(self, prev): |
---|
307 | self.prev = prev |
---|
308 | |
---|
309 | def GetNext(self): |
---|
310 | global command_log |
---|
311 | self.j = self.j + 1 |
---|
312 | for i in range(0,36): |
---|
313 | if FinalArgs[i] != '' and self.j == 2: |
---|
314 | self.command = self.command + FinalArgs[i] + ' ' |
---|
315 | if self.j == 2: |
---|
316 | command_log = os.popen('sudo %s' % self.command).read() |
---|
317 | return self.next |
---|
318 | |
---|
319 | def GetPrev(self): |
---|
320 | prev = self.prev |
---|
321 | prev = prev.GetPrev() |
---|
322 | return prev |
---|
323 | |
---|
324 | #---------------------------------------------------------------------- |
---|
325 | class RemoteLinuxTxtPage(wiz.PyWizardPage): |
---|
326 | def __init__(self, parent, title): |
---|
327 | wiz.PyWizardPage.__init__(self, parent) |
---|
328 | self.next = self.prev = None |
---|
329 | self.sizer = makePageTitle(self, title) |
---|
330 | |
---|
331 | wx.StaticText(self, -1, _('msg_remote_linux_text'),(50,100)) |
---|
332 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
333 | FinalArgs[3] = 'remote-linux-txt' |
---|
334 | self.j = 0 |
---|
335 | self.command = '' |
---|
336 | |
---|
337 | def SetNext(self, next): |
---|
338 | self.next = next |
---|
339 | |
---|
340 | def SetPrev(self, prev): |
---|
341 | self.prev = prev |
---|
342 | |
---|
343 | def GetNext(self): |
---|
344 | global command_log |
---|
345 | self.j = self.j + 1 |
---|
346 | for i in range(0,36): |
---|
347 | if FinalArgs[i] != '' and self.j == 2: |
---|
348 | self.command = self.command + FinalArgs[i] + ' ' |
---|
349 | if self.j == 2: |
---|
350 | command_log = os.popen('sudo %s' % self.command).read() |
---|
351 | return self.next |
---|
352 | |
---|
353 | def GetPrev(self): |
---|
354 | prev = self.prev |
---|
355 | prev = prev.GetPrev() |
---|
356 | return prev |
---|
357 | |
---|
358 | #---------------------------------------------------------------------- |
---|
359 | class TerminalPage(wiz.PyWizardPage): |
---|
360 | def __init__(self, parent, title): |
---|
361 | wiz.PyWizardPage.__init__(self, parent) |
---|
362 | self.next = self.prev = None |
---|
363 | self.sizer = makePageTitle(self, title) |
---|
364 | |
---|
365 | wx.StaticText(self, -1, _('msg_thin_client'),(50,100)) |
---|
366 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
367 | FinalArgs[3] = 'terminal' |
---|
368 | self.j = 0 |
---|
369 | self.command = '' |
---|
370 | |
---|
371 | def SetNext(self, next): |
---|
372 | self.next = next |
---|
373 | |
---|
374 | def SetPrev(self, prev): |
---|
375 | self.prev = prev |
---|
376 | |
---|
377 | def GetNext(self): |
---|
378 | global command_log |
---|
379 | self.j = self.j + 1 |
---|
380 | for i in range(0,36): |
---|
381 | if FinalArgs[i] != '' and self.j == 2: |
---|
382 | self.command = self.command + FinalArgs[i] + ' ' |
---|
383 | if self.j == 2: |
---|
384 | command_log = os.popen('sudo %s' % self.command).read() |
---|
385 | return self.next |
---|
386 | |
---|
387 | def GetPrev(self): |
---|
388 | prev = self.prev |
---|
389 | prev = prev.GetPrev() |
---|
390 | return prev |
---|
391 | |
---|
392 | #---------------------------------------------------------------------- |
---|
393 | class RemoteMemTestPage(wiz.PyWizardPage): |
---|
394 | def __init__(self, parent, title): |
---|
395 | wiz.PyWizardPage.__init__(self, parent) |
---|
396 | self.next = self.prev = None |
---|
397 | self.sizer = makePageTitle(self, title) |
---|
398 | |
---|
399 | wx.StaticText(self, -1, _('msg_remote_memtest'),(50,100)) |
---|
400 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
401 | FinalArgs[3] = 'remote-memtest' |
---|
402 | |
---|
403 | def SetNext(self, next): |
---|
404 | self.next = next |
---|
405 | |
---|
406 | def SetPrev(self, prev): |
---|
407 | self.prev = prev |
---|
408 | |
---|
409 | def GetNext(self): |
---|
410 | global command_log |
---|
411 | self.j = self.j + 1 |
---|
412 | for i in range(0,36): |
---|
413 | if FinalArgs[i] != '' and self.j == 2: |
---|
414 | self.command = self.command + FinalArgs[i] + ' ' |
---|
415 | if self.j == 2: |
---|
416 | command_log = os.popen('sudo %s' % self.command).read() |
---|
417 | return self.next |
---|
418 | |
---|
419 | def GetPrev(self): |
---|
420 | prev = self.prev |
---|
421 | prev = prev.GetPrev() |
---|
422 | return prev |
---|
423 | |
---|
424 | #---------------------------------------------------------------------- |
---|
425 | class RemotefdosPage(wiz.PyWizardPage): |
---|
426 | def __init__(self, parent, title): |
---|
427 | wiz.PyWizardPage.__init__(self, parent) |
---|
428 | self.next = self.prev = None |
---|
429 | self.sizer = makePageTitle(self, title) |
---|
430 | |
---|
431 | wx.StaticText(self, -1, _('msg_remote_fdos'),(50,100)) |
---|
432 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
433 | FinalArgs[3] = 'remote-fdos' |
---|
434 | |
---|
435 | def SetNext(self, next): |
---|
436 | self.next = next |
---|
437 | |
---|
438 | def SetPrev(self, prev): |
---|
439 | self.prev = prev |
---|
440 | |
---|
441 | def GetNext(self): |
---|
442 | global command_log |
---|
443 | self.j = self.j + 1 |
---|
444 | for i in range(0,36): |
---|
445 | if FinalArgs[i] != '' and self.j == 2: |
---|
446 | self.command = self.command + FinalArgs[i] + ' ' |
---|
447 | if self.j == 2: |
---|
448 | command_log = os.popen('sudo %s' % self.command).read() |
---|
449 | return self.next |
---|
450 | |
---|
451 | def GetPrev(self): |
---|
452 | prev = self.prev |
---|
453 | prev = prev.GetPrev() |
---|
454 | return prev |
---|
455 | |
---|
456 | #---------------------------------------------------------------------- |
---|
457 | class ClonezillaStartSavePage1(wiz.PyWizardPage): |
---|
458 | def __init__(self, parent, title): |
---|
459 | wiz.PyWizardPage.__init__(self, parent) |
---|
460 | self.next = self.prev = None |
---|
461 | self.sizer = makePageTitle(self, title) |
---|
462 | ModeList = [_('msg_clonezilla_save_disk'), _('msg_clonezilla_save_parts')] |
---|
463 | |
---|
464 | rb = wx.RadioBox( |
---|
465 | self, -1, _('msg_choose_mode'), (35, 50), (260,90), |
---|
466 | ModeList, 1, wx.RA_SPECIFY_COLS |
---|
467 | ) |
---|
468 | |
---|
469 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
470 | FinalArgs[0] = '/opt/drbl/sbin/drbl-ocs -b' |
---|
471 | FinalArgs[12] = 'startdisk' |
---|
472 | FinalArgs[13] = 'save' |
---|
473 | |
---|
474 | def EvtRadioBox(self, event): |
---|
475 | if event.GetInt() == 0: |
---|
476 | FinalArgs[12] = 'startdisk' |
---|
477 | FinalArgs[13] = 'save' |
---|
478 | if event.GetInt() == 1: |
---|
479 | FinalArgs[12] = 'startpart' |
---|
480 | FinalArgs[13] = 'save' |
---|
481 | |
---|
482 | def SetNext(self, next): |
---|
483 | self.next = next |
---|
484 | |
---|
485 | def SetPrev(self, prev): |
---|
486 | self.prev = prev |
---|
487 | |
---|
488 | def GetNext(self): |
---|
489 | return self.next |
---|
490 | |
---|
491 | def GetPrev(self): |
---|
492 | return self.prev |
---|
493 | |
---|
494 | #---------------------------------------------------------------------- |
---|
495 | class ClonezillaStartSavePage2(wiz.PyWizardPage): |
---|
496 | def __init__(self, parent, title): |
---|
497 | wiz.PyWizardPage.__init__(self, parent) |
---|
498 | self.next = self.prev = None |
---|
499 | self.sizer = makePageTitle(self, title) |
---|
500 | |
---|
501 | wx.StaticText(self,-1,_('msg_ask_if_input_save_image_name_in_server'),wx.DLG_PNT(self, 5, 20),wx.DLG_SZE(self, 210, 300),wx.TE_MULTILINE) |
---|
502 | |
---|
503 | self.cb = wx.CheckBox(self, -1, 'YES',(20,130)) # not translated |
---|
504 | self.cb.SetValue(True) |
---|
505 | |
---|
506 | def SetNext(self, next): |
---|
507 | self.next = next |
---|
508 | |
---|
509 | def SetPrev(self, prev): |
---|
510 | self.prev = prev |
---|
511 | |
---|
512 | def GetNext(self): |
---|
513 | next = self.next |
---|
514 | if not self.cb.GetValue(): |
---|
515 | next = next.GetNext() |
---|
516 | return next |
---|
517 | |
---|
518 | def GetPrev(self): |
---|
519 | return self.prev |
---|
520 | |
---|
521 | #---------------------------------------------------------------------- |
---|
522 | class ClonezillaStartSavePage3(wiz.PyWizardPage): |
---|
523 | def __init__(self, parent, title): |
---|
524 | wiz.PyWizardPage.__init__(self, parent) |
---|
525 | self.next = self.prev = None |
---|
526 | self.sizer = makePageTitle(self, title) |
---|
527 | |
---|
528 | wx.StaticText(self, -1, _('msg_input_image_name'), (10, 160)) |
---|
529 | self.text_img = wx.TextCtrl(self, -1, '', (10, 180), size=(200, -1)) |
---|
530 | |
---|
531 | wx.StaticText(self, -1, _('msg_input_device_name'), (10, 210)) |
---|
532 | self.text_dev = wx.TextCtrl(self, -1, '', (10, 230), size=(190, -1)) |
---|
533 | |
---|
534 | def SetNext(self, next): |
---|
535 | self.next = next |
---|
536 | |
---|
537 | def SetPrev(self, prev): |
---|
538 | self.prev = prev |
---|
539 | |
---|
540 | def GetNext(self): |
---|
541 | FinalArgs[14] = self.text_img.GetValue() |
---|
542 | FinalArgs[15] = self.text_dev.GetValue() |
---|
543 | return self.next |
---|
544 | |
---|
545 | def GetPrev(self): |
---|
546 | return self.prev |
---|
547 | |
---|
548 | #---------------------------------------------------------------------- |
---|
549 | class ClonezillaStartSavePage4(wiz.PyWizardPage): |
---|
550 | def __init__(self, parent, title): |
---|
551 | wiz.PyWizardPage.__init__(self, parent) |
---|
552 | self.next = self.prev = None |
---|
553 | self.sizer = makePageTitle(self, title) |
---|
554 | |
---|
555 | self.list = CSSCheckListCtrl(self, title) |
---|
556 | sizer = wx.BoxSizer() |
---|
557 | sizer.Add(self.list, 1, wx.EXPAND) |
---|
558 | self.SetSizer(sizer) |
---|
559 | |
---|
560 | self.list.InsertColumn(0, _('argument')) #not translated |
---|
561 | self.list.InsertColumn(1, _('meannings'), wx.LIST_FORMAT_LEFT) #not translated |
---|
562 | |
---|
563 | for key, data in ClonezillaStartSaveArgs.iteritems(): |
---|
564 | index = self.list.InsertStringItem(sys.maxint, data[0]) |
---|
565 | self.list.SetStringItem(index, 1, data[1]) |
---|
566 | self.list.SetItemData(index, key) |
---|
567 | |
---|
568 | self.list.SetColumnWidth(0, wx.LIST_AUTOSIZE) |
---|
569 | self.list.SetColumnWidth(1, wx.LIST_AUTOSIZE) |
---|
570 | |
---|
571 | self.list.CheckItem(0) |
---|
572 | self.list.CheckItem(1) |
---|
573 | |
---|
574 | def SetNext(self, next): |
---|
575 | self.next = next |
---|
576 | |
---|
577 | def SetPrev(self, prev): |
---|
578 | self.prev = prev |
---|
579 | |
---|
580 | def GetNext(self): |
---|
581 | next = self.next |
---|
582 | if self.list.IsChecked(0) == self.list.IsChecked(1) == self.list.IsChecked(2) == self.list.IsChecked(3) == self.list.IsChecked(4) == self.list.IsChecked(5) == 0: |
---|
583 | next = 0 |
---|
584 | return next |
---|
585 | |
---|
586 | def GetPrev(self): |
---|
587 | prev = self.prev |
---|
588 | prev = prev.GetPrev() |
---|
589 | return prev |
---|
590 | |
---|
591 | #---------------------------------------------------------------------- |
---|
592 | class ClonezillaStartSavePage5(wiz.PyWizardPage): |
---|
593 | def __init__(self, parent, title): |
---|
594 | wiz.PyWizardPage.__init__(self, parent) |
---|
595 | self.next = self.prev = None |
---|
596 | self.sizer = makePageTitle(self, title) |
---|
597 | |
---|
598 | ArgList = [_('msg_ocs_param_p_choose'), _('msg_ocs_param_p_true'), |
---|
599 | _('msg_ocs_param_p_poweroff'), _('msg_ocs_param_p_reboot')] |
---|
600 | |
---|
601 | rb = wx.RadioBox( |
---|
602 | self, -1, _('msg_choose_post_mode_after_clone'), (35,50), (290,150), |
---|
603 | ArgList, 1, wx.RA_SPECIFY_COLS |
---|
604 | ) |
---|
605 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
606 | rb.SetSelection(3) |
---|
607 | FinalArgs[9] = '-p reboot' |
---|
608 | |
---|
609 | def EvtRadioBox(self, event): |
---|
610 | if event.GetSelection() == 0: |
---|
611 | FinalArgs[9] = '-p choose' |
---|
612 | if event.GetSelection() == 1: |
---|
613 | FinalArgs[9] = '-p true' |
---|
614 | if event.GetSelection() == 2: |
---|
615 | FinalArgs[9] = '-p poweroff' |
---|
616 | if event.GetSelection() == 3: |
---|
617 | FinalArgs[9] = '-p reboot' |
---|
618 | |
---|
619 | def SetNext(self, next): |
---|
620 | self.next = next |
---|
621 | |
---|
622 | def SetPrev(self, prev): |
---|
623 | self.prev = prev |
---|
624 | |
---|
625 | def GetNext(self): |
---|
626 | return self.next |
---|
627 | |
---|
628 | def GetPrev(self): |
---|
629 | return self.prev |
---|
630 | |
---|
631 | #---------------------------------------------------------------------- |
---|
632 | class ClonezillaStartSavePage6(wiz.PyWizardPage): |
---|
633 | def __init__(self, parent, title): |
---|
634 | wiz.PyWizardPage.__init__(self, parent) |
---|
635 | self.next = self.prev = None |
---|
636 | self.sizer = makePageTitle(self, title) |
---|
637 | |
---|
638 | ArgList = [ _('msg_ocs_param_z0'), _('msg_ocs_param_z1'), _('msg_ocs_param_z2'), _('msg_ocs_param_z3')] |
---|
639 | rb = wx.RadioBox(self, -1, _('msg_choose_post_mode_after_clone'), (35,50), (340,150), ArgList, 1, wx.RA_SPECIFY_COLS) |
---|
640 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
641 | rb.SetSelection(3) |
---|
642 | FinalArgs[10] = '-z3' |
---|
643 | self.j = 0 |
---|
644 | self.command = '' |
---|
645 | |
---|
646 | def EvtRadioBox(self, event): |
---|
647 | if event.GetSelection() == 0: |
---|
648 | FinalArgs[10] = '-z0' |
---|
649 | if event.GetSelection() == 1: |
---|
650 | FinalArgs[10] = '-z1' |
---|
651 | if event.GetSelection() == 2: |
---|
652 | FinalArgs[10] = '-z2' |
---|
653 | if event.GetSelection() == 3: |
---|
654 | FinalArgs[10] = '-z3' |
---|
655 | |
---|
656 | def SetNext(self, next): |
---|
657 | self.next = next |
---|
658 | |
---|
659 | def SetPrev(self, prev): |
---|
660 | self.prev = prev |
---|
661 | |
---|
662 | def GetNext(self): |
---|
663 | global command_log |
---|
664 | self.j = self.j + 1 |
---|
665 | if FinalArgs[1] == '-nl': |
---|
666 | FinalArgs[1] = '' |
---|
667 | if self.j == 2: |
---|
668 | for i in range(0,36): |
---|
669 | if FinalArgs[i] != '': |
---|
670 | self.command = self.command + FinalArgs[i] + ' ' |
---|
671 | #print 'popen starts' |
---|
672 | #fo = os.popen('sudo %s' % self.command) |
---|
673 | #print '3 seconds..' |
---|
674 | #time.sleep(3) |
---|
675 | #print ('this is fo: %s' % fo) |
---|
676 | #command_log = command_log + fo.readline() |
---|
677 | #------------------------------------------------------------------------------------------------------------------------- |
---|
678 | #test = Popen(['sudo', '%s'.strip() % self.command], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
---|
679 | #time.sleep(5) |
---|
680 | #print self.command |
---|
681 | #print test.stdout.read() |
---|
682 | #while : |
---|
683 | #time.sleep(1) |
---|
684 | #print test.readline() |
---|
685 | #------------------------------------------------------- |
---|
686 | file = open('tmp.log','w') |
---|
687 | os.system('sudo %s > tmp.log' % self.command) |
---|
688 | time.sleep(6) |
---|
689 | file.close() |
---|
690 | file = open('tmp.log') |
---|
691 | while True: |
---|
692 | line = file.readline() |
---|
693 | if len(line) == 0: # Zero length indicates EOF |
---|
694 | break |
---|
695 | command_log = command_log + line |
---|
696 | file.close() |
---|
697 | os.remove('tmp.log') |
---|
698 | return self.next |
---|
699 | |
---|
700 | def GetPrev(self): |
---|
701 | return self.prev |
---|
702 | |
---|
703 | #---------------------------------------------------------------------- |
---|
704 | class ClonezillaStartRestorePage1(wiz.PyWizardPage): |
---|
705 | def __init__(self, parent, title): |
---|
706 | wiz.PyWizardPage.__init__(self, parent) |
---|
707 | self.next = self.prev = None |
---|
708 | self.sizer = makePageTitle(self, title) |
---|
709 | ModeList = [_('msg_clonezilla_restore_disk'), _('msg_clonezilla_restore_parts')] |
---|
710 | |
---|
711 | rb = wx.RadioBox(self, -1, _('msg_choose_mode'), (35, 50), (260,90), ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
712 | |
---|
713 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
714 | FinalArgs[0] = '/opt/drbl/sbin/drbl-ocs -b' |
---|
715 | FinalArgs[32] = 'startdisk' |
---|
716 | |
---|
717 | def EvtRadioBox(self, event): |
---|
718 | if event.GetInt() == 0: |
---|
719 | FinalArgs[32] = 'startdisk' |
---|
720 | if event.GetInt() == 1: |
---|
721 | FinalArgs[32] = 'startpart' |
---|
722 | |
---|
723 | def SetNext(self, next): |
---|
724 | self.next = next |
---|
725 | |
---|
726 | def SetPrev(self, prev): |
---|
727 | self.prev = prev |
---|
728 | |
---|
729 | def GetNext(self): |
---|
730 | return self.next |
---|
731 | |
---|
732 | def GetPrev(self): |
---|
733 | return self.prev |
---|
734 | |
---|
735 | #---------------------------------------------------------------------- |
---|
736 | class ClonezillaStartRestorePage2(wiz.PyWizardPage): |
---|
737 | def __init__(self, parent, title): |
---|
738 | wiz.PyWizardPage.__init__(self, parent) |
---|
739 | self.next = self.prev = None |
---|
740 | self.sizer = makePageTitle(self, title) |
---|
741 | |
---|
742 | self.list = CSRCheckListCtrl(self, title) |
---|
743 | sizer = wx.BoxSizer() |
---|
744 | sizer.Add(self.list, 1, wx.EXPAND) |
---|
745 | self.SetSizer(sizer) |
---|
746 | |
---|
747 | self.list.InsertColumn(0, _('argument')) #not translated |
---|
748 | self.list.InsertColumn(1, _('meannings'), wx.LIST_FORMAT_LEFT) #not translated |
---|
749 | |
---|
750 | for key, data in ClonezillaStartRestoreArgs.iteritems(): |
---|
751 | index = self.list.InsertStringItem(sys.maxint, data[0]) |
---|
752 | self.list.SetStringItem(index, 1, data[1]) |
---|
753 | self.list.SetItemData(index, key) |
---|
754 | |
---|
755 | self.list.SetColumnWidth(0, wx.LIST_AUTOSIZE) |
---|
756 | self.list.SetColumnWidth(1, wx.LIST_AUTOSIZE) |
---|
757 | |
---|
758 | self.list.CheckItem(0) |
---|
759 | self.list.CheckItem(1) |
---|
760 | |
---|
761 | def SetNext(self, next): |
---|
762 | self.next = next |
---|
763 | |
---|
764 | def SetPrev(self, prev): |
---|
765 | self.prev = prev |
---|
766 | |
---|
767 | def GetNext(self): |
---|
768 | j = 0 |
---|
769 | check_sum = 0 |
---|
770 | next = self.next |
---|
771 | for j in range(0,18): |
---|
772 | check_sum = check_sum + self.list.IsChecked(j) |
---|
773 | if check_sum == 0: # if user didn't check any box, then return NULL. |
---|
774 | next = 0 |
---|
775 | if (self.list.IsChecked(17) or self.list.IsChecked(18)): |
---|
776 | next = self.next |
---|
777 | else: |
---|
778 | next = next.GetNext() |
---|
779 | next = next.GetNext() |
---|
780 | return next |
---|
781 | |
---|
782 | def GetPrev(self): |
---|
783 | return self.prev |
---|
784 | |
---|
785 | #---------------------------------------------------------------------- |
---|
786 | class ClonezillaStartRestorePage3(wiz.PyWizardPage): |
---|
787 | def __init__(self, parent, title): |
---|
788 | wiz.PyWizardPage.__init__(self, parent) |
---|
789 | self.next = self.prev = None |
---|
790 | self.sizer = makePageTitle(self, title) |
---|
791 | |
---|
792 | wx.StaticText(self,-1,_('msg_write_MS_WIN_is_necessary'),wx.DLG_PNT(self, 5, 20),wx.DLG_SZE(self, 210, 300),wx.TE_MULTILINE) |
---|
793 | |
---|
794 | def SetNext(self, next): |
---|
795 | self.next = next |
---|
796 | |
---|
797 | def SetPrev(self, prev): |
---|
798 | self.prev = prev |
---|
799 | |
---|
800 | def GetNext(self): |
---|
801 | return self.next |
---|
802 | |
---|
803 | def GetPrev(self): |
---|
804 | return self.prev |
---|
805 | |
---|
806 | #---------------------------------------------------------------------- |
---|
807 | class ClonezillaStartRestorePage4(wiz.PyWizardPage): |
---|
808 | def __init__(self, parent, title): |
---|
809 | wiz.PyWizardPage.__init__(self, parent) |
---|
810 | self.next = self.prev = None |
---|
811 | self.sizer = makePageTitle(self, title) |
---|
812 | |
---|
813 | wx.StaticText(self, -1, _('msg_What_the_win_hostname_prefix'), (5, 80)) |
---|
814 | self.text = wx.TextCtrl(self, -1, "PC", (5, 110), size=(200, -1)) |
---|
815 | |
---|
816 | def SetNext(self, next): |
---|
817 | self.next = next |
---|
818 | |
---|
819 | def SetPrev(self, prev): |
---|
820 | self.prev = prev |
---|
821 | |
---|
822 | def GetNext(self): |
---|
823 | if FinalArgs[20] == '-hn0' and FinalArgs[22] == '-hn1': |
---|
824 | FinalArgs[21] = FinalArgs[23] = self.text.GetValue() |
---|
825 | elif FinalArgs[20] == '-hn0'and FinalArgs[22] != '-hn1': |
---|
826 | FinalArgs[21] = self.text.GetValue() |
---|
827 | elif FinalArgs[22] == '-hn1' and FinalArgs[20] != '-hn0': |
---|
828 | FinalArgs[23] = self.text.GetValue() |
---|
829 | elif FinalArgs[20] != '-hn0' and FinalArgs[22] != '-hn1': |
---|
830 | FinalArgs[21] = FinalArgs[23] = '' |
---|
831 | return self.next |
---|
832 | |
---|
833 | def GetPrev(self): |
---|
834 | prev = self.prev |
---|
835 | return prev |
---|
836 | |
---|
837 | #---------------------------------------------------------------------- |
---|
838 | class ClonezillaStartRestorePage5(wiz.PyWizardPage): |
---|
839 | def __init__(self, parent, title): |
---|
840 | wiz.PyWizardPage.__init__(self, parent) |
---|
841 | self.next = self.prev = None |
---|
842 | self.sizer = makePageTitle(self, title) |
---|
843 | |
---|
844 | ModeList = [_('msg_ocs_param_y0'), _('msg_ocs_param_y1'), _('msg_ocs_param_y2'), _('msg_ocs_param_skip')] |
---|
845 | wx.StaticText(self,-1,_('msg_if_always_provide_clonezilla_srv'),wx.DLG_PNT(self, 5, 20),wx.DLG_SZE(self, 210, 300),wx.TE_MULTILINE) |
---|
846 | rb = wx.RadioBox(self, -1, '', (5,150), wx.DefaultSize, ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
847 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
848 | rb.SetSelection(3) |
---|
849 | |
---|
850 | def EvtRadioBox(self, event): |
---|
851 | if event.GetInt() == 0: |
---|
852 | FinalArgs[24] = '-y0' |
---|
853 | elif event.GetInt() == 1: |
---|
854 | FinalArgs[24] = '-y1' |
---|
855 | elif event.GetInt() == 2: |
---|
856 | FinalArgs[24] = '-y2' |
---|
857 | elif event.GetInt() == 3: |
---|
858 | FinalArgs[24] = '' |
---|
859 | |
---|
860 | def SetNext(self, next): |
---|
861 | self.next = next |
---|
862 | |
---|
863 | def SetPrev(self, prev): |
---|
864 | self.prev = prev |
---|
865 | |
---|
866 | def GetNext(self): |
---|
867 | return self.next |
---|
868 | |
---|
869 | def GetPrev(self): |
---|
870 | return self.prev |
---|
871 | |
---|
872 | #---------------------------------------------------------------------- |
---|
873 | class ClonezillaStartRestorePage6(wiz.PyWizardPage): |
---|
874 | def __init__(self, parent, title): |
---|
875 | wiz.PyWizardPage.__init__(self, parent) |
---|
876 | self.next = self.prev = None |
---|
877 | self.sizer = makePageTitle(self, title) |
---|
878 | |
---|
879 | ArgList = [_('msg_ocs_param_p_choose'), _('msg_ocs_param_p_true'), _('msg_ocs_param_p_poweroff'), _('msg_ocs_param_p_reboot')] |
---|
880 | rb = wx.RadioBox(self, -1, _('msg_choose_post_mode_after_clone'), (35,50), (290,150), ArgList, 1, wx.RA_SPECIFY_COLS) |
---|
881 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
882 | rb.SetSelection(3) |
---|
883 | FinalArgs[25] = '-p reboot' |
---|
884 | |
---|
885 | def EvtRadioBox(self, event): |
---|
886 | if event.GetSelection() == 0: |
---|
887 | FinalArgs[25] = '-p choose' |
---|
888 | if event.GetSelection() == 1: |
---|
889 | FinalArgs[25] = '-p true' |
---|
890 | if event.GetSelection() == 2: |
---|
891 | FinalArgs[25] = '-p poweroff' |
---|
892 | if event.GetSelection() == 3: |
---|
893 | FinalArgs[25] = '-p reboot' |
---|
894 | |
---|
895 | def SetNext(self, next): |
---|
896 | self.next = next |
---|
897 | |
---|
898 | def SetPrev(self, prev): |
---|
899 | self.prev = prev |
---|
900 | |
---|
901 | def GetNext(self): |
---|
902 | next = self.next |
---|
903 | if FinalArgs[32] == 'startpart' and FinalArgs[9] == '-u': |
---|
904 | next = next.GetNext() |
---|
905 | elif FinalArgs[9] == '-u': |
---|
906 | next = next.GetNext() |
---|
907 | next = next.GetNext() |
---|
908 | return next |
---|
909 | |
---|
910 | def GetPrev(self): |
---|
911 | return self.prev |
---|
912 | |
---|
913 | #---------------------------------------------------------------------- |
---|
914 | class ClonezillaStartRestorePage7(wiz.PyWizardPage): |
---|
915 | def __init__(self, parent, title): |
---|
916 | wiz.PyWizardPage.__init__(self, parent) |
---|
917 | self.next = self.prev = None |
---|
918 | self.sizer = makePageTitle(self, title) |
---|
919 | |
---|
920 | wx.StaticText(self, -1, _('msg_choose_the_image_to_restore'), (5,80)) |
---|
921 | self.fbb = filebrowse.FileBrowseButton(self, -1, pos=(50,150), size=(350, -1), buttonText='browse', toolTip='Type filename or click browse to choose file', fileMask='*.img', changeCallback = self.fbbCallback) |
---|
922 | |
---|
923 | def fbbCallback(self, evt): |
---|
924 | FinalArgs[34] = evt.GetString() |
---|
925 | |
---|
926 | def SetNext(self, next): |
---|
927 | self.next = next |
---|
928 | |
---|
929 | def SetPrev(self, prev): |
---|
930 | self.prev = prev |
---|
931 | |
---|
932 | def GetNext(self): |
---|
933 | next = self.next |
---|
934 | if FinalArgs[32] == 'startpart': |
---|
935 | next = next.GetNext() |
---|
936 | elif FinalArgs[32] == 'startdisk': |
---|
937 | next = self.next |
---|
938 | return next |
---|
939 | |
---|
940 | def GetPrev(self): |
---|
941 | return self.prev |
---|
942 | |
---|
943 | #---------------------------------------------------------------------- |
---|
944 | class ClonezillaStartRestorePage8a(wiz.PyWizardPage): |
---|
945 | def __init__(self, parent, title): |
---|
946 | wiz.PyWizardPage.__init__(self, parent) |
---|
947 | self.next = self.prev = None |
---|
948 | self.sizer = makePageTitle(self, title) |
---|
949 | |
---|
950 | wx.StaticText(self, -1, _('msg_choose_the_disks_to_restore'), (5,80)) |
---|
951 | self.text = wx.TextCtrl(self, -1, "hda", (5, 110), size=(200, -1)) |
---|
952 | |
---|
953 | def SetNext(self, next): |
---|
954 | self.next = next |
---|
955 | |
---|
956 | def SetPrev(self, prev): |
---|
957 | self.prev = prev |
---|
958 | |
---|
959 | def GetNext(self): |
---|
960 | next = self.next |
---|
961 | if FinalArgs[9] == '-u': |
---|
962 | FinalArgs[35] = '' |
---|
963 | next = next.GetNext() |
---|
964 | elif FinalArgs[9] == '' and FinalArgs[32] == 'startdisk': |
---|
965 | FinalArgs[35] = self.text.GetValue() |
---|
966 | next = next.GetNext() |
---|
967 | elif FinalArgs[9] == '' and FinalArgs[32] == 'startpart': |
---|
968 | next = self.next |
---|
969 | return next |
---|
970 | |
---|
971 | def GetPrev(self): |
---|
972 | return self.prev |
---|
973 | |
---|
974 | #---------------------------------------------------------------------- |
---|
975 | class ClonezillaStartRestorePage8b(wiz.PyWizardPage): |
---|
976 | def __init__(self, parent, title): |
---|
977 | wiz.PyWizardPage.__init__(self, parent) |
---|
978 | self.next = self.prev = None |
---|
979 | self.sizer = makePageTitle(self, title) |
---|
980 | |
---|
981 | wx.StaticText(self, -1, _('msg_choose_the_parts_to_restore'), (5,80)) |
---|
982 | self.text = wx.TextCtrl(self, -1, "hda", (5, 110), size=(200, -1)) |
---|
983 | |
---|
984 | def SetNext(self, next): |
---|
985 | self.next = next |
---|
986 | |
---|
987 | def SetPrev(self, prev): |
---|
988 | self.prev = prev |
---|
989 | |
---|
990 | def GetNext(self): |
---|
991 | next = self.next |
---|
992 | if FinalArgs[9] == '-u': |
---|
993 | FinalArgs[35] = '' |
---|
994 | next = next.GetNext() |
---|
995 | elif FinalArgs[9] == '' and FinalArgs[32] == 'startdisk': |
---|
996 | next = self.next |
---|
997 | elif FinalArgs[9] == '' and FinalArgs[32] == 'startpart': |
---|
998 | FinalArgs[35] = self.text.GetValue() |
---|
999 | next = next.GetNext() |
---|
1000 | return next |
---|
1001 | |
---|
1002 | def GetPrev(self): |
---|
1003 | return self.prev |
---|
1004 | |
---|
1005 | #---------------------------------------------------------------------- |
---|
1006 | class ClonezillaStartRestorePage9a(wiz.PyWizardPage): |
---|
1007 | def __init__(self, parent, title): |
---|
1008 | wiz.PyWizardPage.__init__(self, parent) |
---|
1009 | self.next = self.prev = None |
---|
1010 | self.sizer = makePageTitle(self, title) |
---|
1011 | |
---|
1012 | ModeList = [_('msg_multicast_restore'), _('msg_unicast_restore')] |
---|
1013 | rb = wx.RadioBox(self, -1, _('msg_choose_the_mode_to_restore_disk'), (35,50), (290,150), ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
1014 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
1015 | FinalArgs[33] = 'multicast_restore' |
---|
1016 | |
---|
1017 | def EvtRadioBox(self, event): |
---|
1018 | if event.GetInt() == 0: |
---|
1019 | FinalArgs[33] = 'multicast_restore' |
---|
1020 | if event.GetInt() == 1: |
---|
1021 | FinalArgs[33] = 'restore' |
---|
1022 | |
---|
1023 | def SetNext(self, next): |
---|
1024 | self.next = next |
---|
1025 | |
---|
1026 | def SetPrev(self, prev): |
---|
1027 | self.prev = prev |
---|
1028 | |
---|
1029 | def GetNext(self): |
---|
1030 | next = self.next |
---|
1031 | if FinalArgs[9] == '-u': |
---|
1032 | FinalArgs[33] = 'restore' |
---|
1033 | next = next.GetNext() |
---|
1034 | next = next.GetNext() |
---|
1035 | elif FinalArgs[9]=='' and FinalArgs[32] == 'startpart': |
---|
1036 | next = self.next |
---|
1037 | elif FinalArgs[9]=='' and FinalArgs[32] == 'startdisk' and FinalArgs[33] == 'restore': |
---|
1038 | next = next.GetNext() |
---|
1039 | next = next.GetNext() |
---|
1040 | next = next.GetNext() |
---|
1041 | elif FinalArgs[9]=='' and FinalArgs[32] == 'startdisk' and FinalArgs[33] == 'multicast_restore': |
---|
1042 | next = next.GetNext() |
---|
1043 | return next |
---|
1044 | |
---|
1045 | def GetPrev(self): |
---|
1046 | return self.prev |
---|
1047 | |
---|
1048 | #---------------------------------------------------------------------- |
---|
1049 | class ClonezillaStartRestorePage9b(wiz.PyWizardPage): |
---|
1050 | def __init__(self, parent, title): |
---|
1051 | wiz.PyWizardPage.__init__(self, parent) |
---|
1052 | self.next = self.prev = None |
---|
1053 | self.sizer = makePageTitle(self, title) |
---|
1054 | |
---|
1055 | ModeList = [_('msg_multicast_restore'), _('msg_unicast_restore')] |
---|
1056 | rb = wx.RadioBox(self, -1, _('msg_choose_the_mode_to_restore_parts'), (35,50), (290,150), ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
1057 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
1058 | FinalArgs[33] = 'multicast_restore' |
---|
1059 | |
---|
1060 | def EvtRadioBox(self, event): |
---|
1061 | if event.GetInt() == 0: |
---|
1062 | FinalArgs[33] = 'multicast_restore' |
---|
1063 | if event.GetInt() == 1: |
---|
1064 | FinalArgs[33] = 'restore' |
---|
1065 | |
---|
1066 | def SetNext(self, next): |
---|
1067 | self.next = next |
---|
1068 | |
---|
1069 | def SetPrev(self, prev): |
---|
1070 | self.prev = prev |
---|
1071 | |
---|
1072 | def GetNext(self): |
---|
1073 | next = self.next |
---|
1074 | if FinalArgs[9] == '-u': |
---|
1075 | FinalArgs[33] = 'restore' |
---|
1076 | next = next.GetNext() |
---|
1077 | #next = next.GetNext() |
---|
1078 | #next = next.GetNext() |
---|
1079 | elif FinalArgs[9] =='' and FinalArgs[32] == 'startdisk': |
---|
1080 | next = self.next |
---|
1081 | elif FinalArgs[9] =='' and FinalArgs[32] == 'startpart' and FinalArgs[33] == 'restore': |
---|
1082 | next = next.GetNext() |
---|
1083 | next = next.GetNext() |
---|
1084 | elif FinalArgs[9] =='' and FinalArgs[32] == 'startpart' and FinalArgs[33] == 'multicast_restore': |
---|
1085 | next = self.next |
---|
1086 | return next |
---|
1087 | |
---|
1088 | def GetPrev(self): |
---|
1089 | return self.prev |
---|
1090 | |
---|
1091 | #---------------------------------------------------------------------- |
---|
1092 | class ClonezillaStartRestorePage10(wiz.PyWizardPage): |
---|
1093 | def __init__(self, parent, title): |
---|
1094 | wiz.PyWizardPage.__init__(self, parent) |
---|
1095 | self.next = self.prev = None |
---|
1096 | self.sizer = makePageTitle(self, title) |
---|
1097 | |
---|
1098 | ModeList = [_('msg_clients_time_to_wait'), _('msg_time_to_wait'), _('msg_clients_to_wait')] |
---|
1099 | rb = wx.RadioBox(self, -1, _('msg_choose_mode'), (35,50), (350, 150), ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
1100 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
1101 | FinalArgs[26] = '--clients-to-wait' |
---|
1102 | FinalArgs[28] = '--max-time-to-wait' |
---|
1103 | |
---|
1104 | def EvtRadioBox(self, event): |
---|
1105 | if event.GetInt() == 0: |
---|
1106 | FinalArgs[26] = '--clients-to-wait' |
---|
1107 | FinalArgs[28] = '--max-time-to-wait' |
---|
1108 | elif event.GetInt() == 1: |
---|
1109 | FinalArgs[26] = '' |
---|
1110 | FinalArgs[28] = '--max-time-to-wait' |
---|
1111 | elif event.GetInt() == 2: |
---|
1112 | FinalArgs[26] = '--clients-to-wait' |
---|
1113 | FinalArgs[28] = '' |
---|
1114 | |
---|
1115 | def SetNext(self, next): |
---|
1116 | self.next = next |
---|
1117 | |
---|
1118 | def SetPrev(self, prev): |
---|
1119 | self.prev = prev |
---|
1120 | |
---|
1121 | def GetNext(self): |
---|
1122 | next = self.next |
---|
1123 | if FinalArgs[33] == 'restore': |
---|
1124 | FinalArgs[26] = '' |
---|
1125 | FinalArgs[28] = '' |
---|
1126 | next = self.next |
---|
1127 | if FinalArgs[26] == '' and FinalArgs[28] != '': |
---|
1128 | next = next.GetNext() |
---|
1129 | return next |
---|
1130 | |
---|
1131 | def GetPrev(self): |
---|
1132 | prev = self.prev |
---|
1133 | if FinalArgs[32] == 'startdisk': |
---|
1134 | prev = prev.GetPrev() |
---|
1135 | prev = prev.GetPrev() |
---|
1136 | elif FinalArgs[32] == 'startpart': |
---|
1137 | prev = self.prev |
---|
1138 | return prev |
---|
1139 | #---------------------------------------------------------------------- |
---|
1140 | class ClonezillaStartRestorePage11(wiz.PyWizardPage): |
---|
1141 | def __init__(self, parent, title): |
---|
1142 | wiz.PyWizardPage.__init__(self, parent) |
---|
1143 | self.next = self.prev = None |
---|
1144 | self.sizer = makePageTitle(self, title) |
---|
1145 | |
---|
1146 | wx.StaticText(self, -1, _('msg_how_many_clients_to_restore'), (20, 80)) |
---|
1147 | self.text = wx.TextCtrl(self, -1, '5', (20, 110), size=(200, -1)) |
---|
1148 | |
---|
1149 | def SetNext(self, next): |
---|
1150 | self.next = next |
---|
1151 | |
---|
1152 | def SetPrev(self, prev): |
---|
1153 | self.prev = prev |
---|
1154 | |
---|
1155 | def GetNext(self): |
---|
1156 | next = self.next |
---|
1157 | if FinalArgs[26] != '': |
---|
1158 | FinalArgs[27] = self.text.GetValue() |
---|
1159 | next = self.next |
---|
1160 | if FinalArgs[28] == '': |
---|
1161 | next = next.GetNext() |
---|
1162 | return next |
---|
1163 | |
---|
1164 | def GetPrev(self): |
---|
1165 | return self.prev |
---|
1166 | |
---|
1167 | #---------------------------------------------------------------------- |
---|
1168 | class ClonezillaStartRestorePage12(wiz.PyWizardPage): |
---|
1169 | def __init__(self, parent, title): |
---|
1170 | wiz.PyWizardPage.__init__(self, parent) |
---|
1171 | self.next = self.prev = None |
---|
1172 | self.sizer = makePageTitle(self, title) |
---|
1173 | |
---|
1174 | self.j = 0 |
---|
1175 | self.command = '' |
---|
1176 | wx.StaticText(self, -1, _('msg_max_time_to_wait_sec'), (20, 80)) |
---|
1177 | self.text = wx.TextCtrl(self, -1, "300", (20, 110), size=(200, -1)) |
---|
1178 | |
---|
1179 | def SetNext(self, next): |
---|
1180 | self.next = next |
---|
1181 | |
---|
1182 | def SetPrev(self, prev): |
---|
1183 | self.prev = prev |
---|
1184 | |
---|
1185 | def GetNext(self): |
---|
1186 | if FinalArgs[28] != '': |
---|
1187 | FinalArgs[29] = self.text.GetValue() |
---|
1188 | global command_log |
---|
1189 | self.j = self.j + 1 |
---|
1190 | if FinalArgs[1] == '-nl': |
---|
1191 | FinalArgs[1] = '' |
---|
1192 | if self.j == 2: |
---|
1193 | for i in range(0,36): |
---|
1194 | if FinalArgs[i] != '': |
---|
1195 | self.command = self.command + FinalArgs[i] + ' ' |
---|
1196 | file = open('tmp.log','w') |
---|
1197 | os.system('sudo %s > tmp.log' % self.command) |
---|
1198 | time.sleep(6) |
---|
1199 | file.close() |
---|
1200 | file = open('tmp.log') |
---|
1201 | while True: |
---|
1202 | line = file.readline() |
---|
1203 | if len(line) == 0: # Zero length indicates EOF |
---|
1204 | break |
---|
1205 | command_log = command_log + line |
---|
1206 | file.close() |
---|
1207 | os.remove('tmp.log') |
---|
1208 | return self.next |
---|
1209 | |
---|
1210 | def GetPrev(self): |
---|
1211 | return self.prev |
---|
1212 | |
---|
1213 | #---------------------------------------------------------------------- |
---|
1214 | #class ClonezillaStartRestorePage13(wiz.PyWizardPage): |
---|
1215 | #def __init__(self, parent, title): |
---|
1216 | #wiz.PyWizardPage.__init__(self, parent) |
---|
1217 | #self.next = self.prev = None |
---|
1218 | #self.sizer = makePageTitle(self, title) |
---|
1219 | |
---|
1220 | #def SetNext(self, next): |
---|
1221 | #self.next = next |
---|
1222 | |
---|
1223 | #def SetPrev(self, prev): |
---|
1224 | #self.prev = prev |
---|
1225 | |
---|
1226 | #def GetNext(self): |
---|
1227 | #return self.next |
---|
1228 | |
---|
1229 | #def GetPrev(self): |
---|
1230 | #return self.prev |
---|
1231 | |
---|
1232 | #---------------------------------------------------------------------- |
---|
1233 | class ClonezillaSelectPage1(wiz.PyWizardPage): |
---|
1234 | def __init__(self, parent, title): |
---|
1235 | wiz.PyWizardPage.__init__(self, parent) |
---|
1236 | self.next = self.prev = None |
---|
1237 | self.sizer = makePageTitle(self, title) |
---|
1238 | |
---|
1239 | ModeList = [_('msg_ocs_param_y0'), _('msg_ocs_param_y1'), _('msg_ocs_param_y2'), _('msg_ocs_param_skip')] |
---|
1240 | wx.StaticText(self,-1,_('msg_if_always_provide_clonezilla_srv'),wx.DLG_PNT(self, 5, 20),wx.DLG_SZE(self, 210, 300),wx.TE_MULTILINE) |
---|
1241 | rb = wx.RadioBox(self, -1, '', (5,100), wx.DefaultSize, ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
1242 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
1243 | rb.SetSelection(1) |
---|
1244 | FinalArgs[0] = '/opt/drbl/sbin/drbl-ocs -b' |
---|
1245 | FinalArgs[5] = '-y1' |
---|
1246 | |
---|
1247 | def EvtRadioBox(self, event): |
---|
1248 | if event.GetInt() == 0: |
---|
1249 | FinalArgs[5] = '-y0' |
---|
1250 | elif event.GetInt() == 1: |
---|
1251 | FinalArgs[5] = '-y1' |
---|
1252 | elif event.GetInt() == 2: |
---|
1253 | FinalArgs[5] = '-y2' |
---|
1254 | elif event.GetInt() == 3: |
---|
1255 | FinalArgs[5] = '' |
---|
1256 | |
---|
1257 | def SetNext(self, next): |
---|
1258 | self.next = next |
---|
1259 | |
---|
1260 | def SetPrev(self, prev): |
---|
1261 | self.prev = prev |
---|
1262 | |
---|
1263 | def GetNext(self): |
---|
1264 | return self.next |
---|
1265 | |
---|
1266 | def GetPrev(self): |
---|
1267 | return self.prev |
---|
1268 | |
---|
1269 | #---------------------------------------------------------------------- |
---|
1270 | class ClonezillaSelectPage2(wiz.PyWizardPage): |
---|
1271 | def __init__(self, parent, title): |
---|
1272 | wiz.PyWizardPage.__init__(self, parent) |
---|
1273 | self.next = self.prev = None |
---|
1274 | self.sizer = makePageTitle(self, title) |
---|
1275 | |
---|
1276 | ArgList = [_('msg_ocs_param_p_choose'), _('msg_ocs_param_p_true'), _('msg_ocs_param_p_poweroff'), _('msg_ocs_param_p_reboot')] |
---|
1277 | rb = wx.RadioBox(self, -1, _('msg_choose_post_mode_after_clone'), (35,50), (290,150), ArgList, 1, wx.RA_SPECIFY_COLS) |
---|
1278 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
1279 | rb.SetSelection(0) |
---|
1280 | self.j = 0 |
---|
1281 | self.command = '' |
---|
1282 | FinalArgs[6] = '-p choose' |
---|
1283 | |
---|
1284 | def EvtRadioBox(self, event): |
---|
1285 | if event.GetSelection() == 0: |
---|
1286 | FinalArgs[6] = '-p choose' |
---|
1287 | if event.GetSelection() == 1: |
---|
1288 | FinalArgs[6] = '-p true' |
---|
1289 | if event.GetSelection() == 2: |
---|
1290 | FinalArgs[6] = '-p poweroff' |
---|
1291 | if event.GetSelection() == 3: |
---|
1292 | FinalArgs[6] = '-p reboot' |
---|
1293 | |
---|
1294 | def SetNext(self, next): |
---|
1295 | self.next = next |
---|
1296 | |
---|
1297 | def SetPrev(self, prev): |
---|
1298 | self.prev = prev |
---|
1299 | |
---|
1300 | def GetNext(self): |
---|
1301 | FinalArgs[7] = 'select_in_client' |
---|
1302 | global command_log |
---|
1303 | self.j = self.j + 1 |
---|
1304 | for i in range(0,36): |
---|
1305 | if FinalArgs[i] != '' and self.j == 2: |
---|
1306 | self.command = self.command + FinalArgs[i] + ' ' |
---|
1307 | if self.j == 2: |
---|
1308 | command_log = os.popen('sudo %s' % self.command).read() |
---|
1309 | return self.next |
---|
1310 | |
---|
1311 | def GetPrev(self): |
---|
1312 | return self.prev |
---|
1313 | |
---|
1314 | #---------------------------------------------------------------------- |
---|
1315 | class ClonezillaStopPage(wiz.PyWizardPage): |
---|
1316 | def __init__(self, parent, title): |
---|
1317 | wiz.PyWizardPage.__init__(self, parent) |
---|
1318 | self.next = self.prev = None |
---|
1319 | self.sizer = makePageTitle(self, title) |
---|
1320 | |
---|
1321 | wx.StaticText(self, -1, _('msg_clonezilla_stop'),(50,100)) |
---|
1322 | self.j = 0 |
---|
1323 | self.command = '' |
---|
1324 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
1325 | FinalArgs[3] = 'clonezilla-stop' |
---|
1326 | |
---|
1327 | def SetNext(self, next): |
---|
1328 | self.next = next |
---|
1329 | |
---|
1330 | def SetPrev(self, prev): |
---|
1331 | self.prev = prev |
---|
1332 | |
---|
1333 | def GetNext(self): |
---|
1334 | global command_log |
---|
1335 | self.j = self.j + 1 |
---|
1336 | for i in range(0,36): |
---|
1337 | if FinalArgs[i] != '' and self.j == 2: |
---|
1338 | self.command = self.command + FinalArgs[i] + ' ' |
---|
1339 | if self.j == 2: |
---|
1340 | command_log = os.popen('sudo %s' % self.command).read() |
---|
1341 | return self.next |
---|
1342 | |
---|
1343 | def GetPrev(self): |
---|
1344 | return self.prev |
---|
1345 | |
---|
1346 | #---------------------------------------------------------------------- |
---|
1347 | class LocalPage(wiz.PyWizardPage): |
---|
1348 | def __init__(self, parent, title): |
---|
1349 | wiz.PyWizardPage.__init__(self, parent) |
---|
1350 | self.next = self.prev = None |
---|
1351 | self.sizer = makePageTitle(self, title) |
---|
1352 | |
---|
1353 | wx.StaticText(self, -1, _('msg_local'),(50,100)) |
---|
1354 | self.command = '' |
---|
1355 | self.j = 0 |
---|
1356 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
1357 | FinalArgs[3] = 'local' |
---|
1358 | |
---|
1359 | def SetNext(self, next): |
---|
1360 | self.next = next |
---|
1361 | |
---|
1362 | def SetPrev(self, prev): |
---|
1363 | self.prev = prev |
---|
1364 | |
---|
1365 | def GetNext(self): |
---|
1366 | global command_log |
---|
1367 | self.j = self.j + 1 |
---|
1368 | for i in range(0,36): |
---|
1369 | if FinalArgs[i] != '' and self.j == 2: |
---|
1370 | self.command = self.command + FinalArgs[i] + ' ' |
---|
1371 | if self.j == 2: |
---|
1372 | command_log = os.popen('sudo %s' % self.command).read() |
---|
1373 | return self.next |
---|
1374 | |
---|
1375 | def GetPrev(self): |
---|
1376 | return self.prev |
---|
1377 | |
---|
1378 | #---------------------------------------------------------------------- |
---|
1379 | class RebootPage(wiz.PyWizardPage): |
---|
1380 | def __init__(self, parent, title): |
---|
1381 | wiz.PyWizardPage.__init__(self, parent) |
---|
1382 | self.next = self.prev = None |
---|
1383 | self.sizer = makePageTitle(self, title) |
---|
1384 | |
---|
1385 | wx.StaticText(self, -1, _('msg_reboot'),(50,100)) |
---|
1386 | self.command = '' |
---|
1387 | self.j = 0 |
---|
1388 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
1389 | FinalArgs[3] = 'reboot' |
---|
1390 | |
---|
1391 | def SetNext(self, next): |
---|
1392 | self.next = next |
---|
1393 | |
---|
1394 | def SetPrev(self, prev): |
---|
1395 | self.prev = prev |
---|
1396 | |
---|
1397 | def GetNext(self): |
---|
1398 | global command_log |
---|
1399 | self.j = self.j + 1 |
---|
1400 | for i in range(0,36): |
---|
1401 | if FinalArgs[i] != '' and self.j == 2: |
---|
1402 | self.command = self.command + FinalArgs[i] + ' ' |
---|
1403 | if self.j == 2: |
---|
1404 | command_log = os.popen('sudo %s' % self.command).read() |
---|
1405 | return self.next |
---|
1406 | |
---|
1407 | def GetPrev(self): |
---|
1408 | return self.prev |
---|
1409 | |
---|
1410 | #---------------------------------------------------------------------- |
---|
1411 | class ShutdownPage(wiz.PyWizardPage): |
---|
1412 | def __init__(self, parent, title): |
---|
1413 | wiz.PyWizardPage.__init__(self, parent) |
---|
1414 | self.next = self.prev = None |
---|
1415 | self.sizer = makePageTitle(self, title) |
---|
1416 | |
---|
1417 | wx.StaticText(self, -1, _('msg_shutdown'),(50,100)) |
---|
1418 | self.command = '' |
---|
1419 | self.j = 0 |
---|
1420 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
1421 | FinalArgs[3] = 'shutdown' |
---|
1422 | |
---|
1423 | def SetNext(self, next): |
---|
1424 | self.next = next |
---|
1425 | |
---|
1426 | def SetPrev(self, prev): |
---|
1427 | self.prev = prev |
---|
1428 | |
---|
1429 | def GetNext(self): |
---|
1430 | global command_log |
---|
1431 | self.j = self.j + 1 |
---|
1432 | for i in range(0,36): |
---|
1433 | if FinalArgs[i] != '' and self.j == 2: |
---|
1434 | self.command = self.command + FinalArgs[i] + ' ' |
---|
1435 | if self.j == 2: |
---|
1436 | command_log = os.popen('sudo %s' % self.command).read() |
---|
1437 | return self.next |
---|
1438 | |
---|
1439 | def GetPrev(self): |
---|
1440 | return self.prev |
---|
1441 | |
---|
1442 | #---------------------------------------------------------------------- |
---|
1443 | class WakeOnLanPage(wiz.PyWizardPage): |
---|
1444 | def __init__(self, parent, title): |
---|
1445 | wiz.PyWizardPage.__init__(self, parent) |
---|
1446 | self.next = self.prev = None |
---|
1447 | self.sizer = makePageTitle(self, title) |
---|
1448 | |
---|
1449 | wx.StaticText(self, -1, _('msg_Wake_on_LAN'), (50,100)) |
---|
1450 | self.command = 0 |
---|
1451 | self.j = 0 |
---|
1452 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
1453 | FinalArgs[3] = 'Wake-on-LAN' |
---|
1454 | |
---|
1455 | def SetNext(self, next): |
---|
1456 | self.next = next |
---|
1457 | |
---|
1458 | def SetPrev(self, prev): |
---|
1459 | self.prev = prev |
---|
1460 | |
---|
1461 | def GetNext(self): |
---|
1462 | global command_log |
---|
1463 | self.j = self.j + 1 |
---|
1464 | for i in range(0,36): |
---|
1465 | if FinalArgs[i] != '' and self.j == 2: |
---|
1466 | self.command = self.command + FinalArgs[i] + ' ' |
---|
1467 | if self.j == 2: |
---|
1468 | command_log = os.popen('sudo %s' % self.command).read() |
---|
1469 | return self.next |
---|
1470 | |
---|
1471 | def GetPrev(self): |
---|
1472 | return self.prev |
---|
1473 | |
---|
1474 | #---------------------------------------------------------------------- |
---|
1475 | class SwitchPXEMenuPage1(wiz.PyWizardPage): |
---|
1476 | def __init__(self, parent, title): |
---|
1477 | wiz.PyWizardPage.__init__(self, parent) |
---|
1478 | self.next = self.prev = None |
---|
1479 | self.sizer = makePageTitle(self, title) |
---|
1480 | |
---|
1481 | ModeList = [_('msg_hide_pxe_menus'), _('msg_reveal_pxe_menus'), _('msg_setdefault_pxe_menu')] |
---|
1482 | rb = wx.RadioBox(self, -1, _('msg_choose_the_action'), (35, 50), (260,90), ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
1483 | |
---|
1484 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
1485 | self.command = '' |
---|
1486 | self.j = 0 |
---|
1487 | FinalArgs[0] = '/opt/drbl/bin/hide_reveal_pxe_img' |
---|
1488 | FinalArgs[3] = 'hide' |
---|
1489 | |
---|
1490 | def EvtRadioBox(self, event): |
---|
1491 | if event.GetInt() == 0: |
---|
1492 | FinalArgs[0] = '/opt/drbl/bin/hide_reveal_pxe_img' |
---|
1493 | FinalArgs[3] = 'hide' |
---|
1494 | elif event.GetInt() == 1: |
---|
1495 | FinalArgs[0] = '/opt/drbl/bin/hide_reveal_pxe_img' |
---|
1496 | FinalArgs[3] = 'reveal' |
---|
1497 | elif event.GetInt() == 2: |
---|
1498 | FinalArgs[0] = '/opt/drbl/sbin/set-default-pxe-img' |
---|
1499 | FinalArgs[3] = '-i' |
---|
1500 | |
---|
1501 | def SetNext(self, next): |
---|
1502 | self.next = next |
---|
1503 | |
---|
1504 | def SetPrev(self, prev): |
---|
1505 | self.prev = prev |
---|
1506 | |
---|
1507 | def GetNext(self): |
---|
1508 | global Labels |
---|
1509 | index = 0 |
---|
1510 | next = self.next |
---|
1511 | self.j = self.j + 1 |
---|
1512 | if self.j == 2: |
---|
1513 | if FinalArgs[3] == 'hide': |
---|
1514 | file = open('/tftpboot/nbi_img/pxelinux.cfg/default') |
---|
1515 | content = file.read() |
---|
1516 | for word in content.split(): |
---|
1517 | if word == 'label': |
---|
1518 | if content.split()[index + 4] != '#': |
---|
1519 | Labels.append(content.split()[index + 1]) |
---|
1520 | index = index + 1 |
---|
1521 | print Labels[:] |
---|
1522 | file.close() |
---|
1523 | elif FinalArgs[3] == 'reveal': |
---|
1524 | file = open('/tftpboot/nbi_img/pxelinux.cfg/default') |
---|
1525 | content = file.read() |
---|
1526 | for word in content.split(): |
---|
1527 | if word == 'label': |
---|
1528 | if content.split()[index + 4] == '#': |
---|
1529 | Labels.append(content.split()[index + 1]) |
---|
1530 | index = index + 1 |
---|
1531 | file.close() |
---|
1532 | elif FinalArgs[3] == '-i': |
---|
1533 | file = open('/tftpboot/nbi_img/pxelinux.cfg/default') |
---|
1534 | content = file.read() |
---|
1535 | for word in content.split(): |
---|
1536 | if word == 'label': |
---|
1537 | if content.split()[index + 2] == 'MENU' and content.split()[index + 3] == 'DEFAULT': |
---|
1538 | Labels.append(content.split()[index + 1]) |
---|
1539 | index = index + 1 |
---|
1540 | file.close() |
---|
1541 | next = next.GetNext() |
---|
1542 | return next |
---|
1543 | |
---|
1544 | def GetPrev(self): |
---|
1545 | return self.prev |
---|
1546 | |
---|
1547 | #---------------------------------------------------------------------- |
---|
1548 | class SwitchPXEMenuPage2(wiz.PyWizardPage): |
---|
1549 | def __init__(self, parent, title): |
---|
1550 | wiz.PyWizardPage.__init__(self, parent) |
---|
1551 | self.next = self.prev = None |
---|
1552 | self.sizer = makePageTitle(self, title) |
---|
1553 | self.j = 0 |
---|
1554 | |
---|
1555 | b = wx.Button(self, -1, "Choose The Labels You Want To Hide/Reveal (MultiChoices)", (50,50)) |
---|
1556 | self.Bind(wx.EVT_BUTTON, self.OnButton, b) |
---|
1557 | |
---|
1558 | def OnButton(self, evt): |
---|
1559 | global Labels |
---|
1560 | dlg = wx.MultiChoiceDialog(self, _('msg_hide_reveal'), 'Lables:', Labels) |
---|
1561 | |
---|
1562 | if (dlg.ShowModal() == wx.ID_OK): |
---|
1563 | selections = dlg.GetSelections() |
---|
1564 | self.selected_labels = [Labels[x] for x in selections] |
---|
1565 | #self.log.write("Selections: %s -> %s\n" % (selections, strings)) |
---|
1566 | dlg.Destroy() |
---|
1567 | |
---|
1568 | def SetNext(self, next): |
---|
1569 | self.next = next |
---|
1570 | |
---|
1571 | def SetPrev(self, prev): |
---|
1572 | self.prev = prev |
---|
1573 | |
---|
1574 | def GetNext(self): |
---|
1575 | global command_log |
---|
1576 | next = self.next |
---|
1577 | self.j = self.j + 1 |
---|
1578 | if self.j == 2: |
---|
1579 | if FinalArgs[1] == '' and FinalArgs[3] != '-i': |
---|
1580 | for i in range(0,len(self.selected_labels)): |
---|
1581 | os.system('/opt/drbl/sbin/hide_reveal_pxe_img %s %s /tftpboot/nbi_img/pxelinux.cfg/default' % (self.selected_labels, FinalArgs[3])) |
---|
1582 | command_log = '%s ' % FinalArgs[3] + '%s ' % self.selected_labels + 'in /tftpboot/nbi_img/pxelinux.cfg/default\n' |
---|
1583 | file = open('/tftpboot/nbi_img/pxelinux.cfg/clients_tmp').read() |
---|
1584 | if len(file.split()) != 0: |
---|
1585 | for i in (0,len(file.split())): |
---|
1586 | os.system('rm -f %s' % file.split()) |
---|
1587 | file.close() |
---|
1588 | command_log = 'clean all clients specific PXE config files\n' |
---|
1589 | next = next.GetNext() |
---|
1590 | if FinalArgs[1] == '-h' and FinalArgs != '-i': |
---|
1591 | for i in range(0,len(PXE_CFG_Files)): |
---|
1592 | os.system('cp /tftpboot/nbi_img/pxelinux.cfg/default /tftpboot/nbi_img/pxelinux.cfg/%s' % PXE_CFG_Files) |
---|
1593 | for i in range(0,len(self.selected_labels)): |
---|
1594 | os.system('/opt/drbl/sbin/hide_reveal_pxe_img %s %s /tftpboot/nbi_img/pxelinux.cfg/%s' % (self.selected_labels, FinalArgs[3], PXE_CFG_Files)) |
---|
1595 | command_log = '%s Label : %s in /tftpboot/nbi_img/pxelinux.cfg/%s\n' % (FinalArgs[3], self.selected_labels, PXE_CFG_Files) |
---|
1596 | file = open('/tftpboot/nbi_img/pxelinux.cfg/clients_tmp','w') |
---|
1597 | if PXE_CFG_Files not in client_temp.read().split(): |
---|
1598 | file.write('%s ' % PXE_CFG_Files) |
---|
1599 | file.close |
---|
1600 | next = next.GetNext() |
---|
1601 | #if FinalArgs[3] == '-i': |
---|
1602 | #for |
---|
1603 | #next = next.GetNext() |
---|
1604 | return next |
---|
1605 | |
---|
1606 | def GetPrev(self): |
---|
1607 | return self.prev |
---|
1608 | |
---|
1609 | #---------------------------------------------------------------------- |
---|
1610 | class SwitchPXEMenuPage3(wiz.PyWizardPage): |
---|
1611 | def __init__(self, parent, title): |
---|
1612 | wiz.PyWizardPage.__init__(self, parent) |
---|
1613 | self.next = self.prev = None |
---|
1614 | self.sizer = makePageTitle(self, title) |
---|
1615 | self.j = 0 |
---|
1616 | |
---|
1617 | b = wx.Button(self, -1, "Choose The Labels You Want To Set as Default (Single Choice)", (50,50)) |
---|
1618 | self.Bind(wx.EVT_BUTTON, self.OnButton, b) |
---|
1619 | |
---|
1620 | def OnButton(self, evt): |
---|
1621 | global Labels |
---|
1622 | dlg = wx.SingleChoiceDialog(self, _('msg_setdefault_title'), "Lables:", Labels, wx.CHOICEDLG_STYLE) |
---|
1623 | |
---|
1624 | if dlg.ShowModal() == wx.ID_OK: |
---|
1625 | self.selected_label = dlg.GetStringSelection() |
---|
1626 | #self.log.WriteText('You selected: %s\n' % dlg.GetStringSelection()) |
---|
1627 | dlg.Destroy() |
---|
1628 | |
---|
1629 | def SetNext(self, next): |
---|
1630 | self.next = next |
---|
1631 | |
---|
1632 | def SetPrev(self, prev): |
---|
1633 | self.prev = prev |
---|
1634 | |
---|
1635 | def GetNext(self): |
---|
1636 | global command_log |
---|
1637 | self.j = self.j + 1 |
---|
1638 | if self.j == 2: |
---|
1639 | if FinalArgs[1] == '' and FinalArgs[3] == '-i': |
---|
1640 | command = os.open('/opt/drbl/sbin/set-default-pxe-img -i %s' % self.selected_label).read() |
---|
1641 | command_log = command_log + command |
---|
1642 | if FinalArgs[1] == '-h' and FinalArgs[3] == '-i': |
---|
1643 | os.system('/opt/drbl/sbin/set-default-pxe-img -i %s' % self.selected_label) |
---|
1644 | for i in range(0,len(PXE_CFG_Files)): |
---|
1645 | os.system('cp /tftpboot/nbi_img/pxelinux.cfg/default /tftpboot/nbi_img/pxelinux.cfg/default/%s' % PXE_CFG_Files) |
---|
1646 | command_log = command_log + 'Copy /tftpboot/nbi_img/pxelinux.cfg/default /tftpboot/nbi_img/pxelinux.cfg/default/%s' % PXE_CFG_Files |
---|
1647 | return self.next |
---|
1648 | |
---|
1649 | def GetPrev(self): |
---|
1650 | return self.prev |
---|
1651 | |
---|
1652 | #---------------------------------------------------------------------- |
---|
1653 | class SwitchPXEMenuPage4(wiz.PyWizardPage): |
---|
1654 | def __init__(self, parent, title): |
---|
1655 | wiz.PyWizardPage.__init__(self, parent) |
---|
1656 | self.next = self.prev = None |
---|
1657 | self.sizer = makePageTitle(self, title) |
---|
1658 | self.tc = wx.TextCtrl(self, -1,'', pos=(35,50), size=(350, 250), style=wx.TE_MULTILINE|wx.TE_READONLY) |
---|
1659 | |
---|
1660 | global command_log |
---|
1661 | self.b1 = wx.Button(self, -1, 'detail', pos=(400,250)) |
---|
1662 | self.b2 = wx.Button(self, -1, 'command..', pos=(400,200)) |
---|
1663 | self.Bind(wx.EVT_BUTTON, self.OnButtonDetail, self.b1) |
---|
1664 | self.Bind(wx.EVT_BUTTON, self.OnButtonCommand, self.b2) |
---|
1665 | |
---|
1666 | def OnButtonDetail(self, evt): |
---|
1667 | self.tc.WriteText('%s' % command_log) |
---|
1668 | self.b1.Enable(False) |
---|
1669 | |
---|
1670 | def OnButtonCommand(self, evt): |
---|
1671 | final_command = '' |
---|
1672 | for i in range(0,36): |
---|
1673 | if FinalArgs[i] != '': |
---|
1674 | final_command = final_command + FinalArgs[i] + ' ' |
---|
1675 | self.tc.WriteText('%s' % final_command) |
---|
1676 | self.b2.Enable(False) |
---|
1677 | |
---|
1678 | def SetNext(self, next): |
---|
1679 | self.next = next |
---|
1680 | |
---|
1681 | def SetPrev(self, prev): |
---|
1682 | self.prev = prev |
---|
1683 | |
---|
1684 | #---------------------------------------------------------------------- |
---|
1685 | class DRBLModePage(wiz.PyWizardPage): |
---|
1686 | def __init__(self, parent, title): |
---|
1687 | wiz.PyWizardPage.__init__(self, parent) |
---|
1688 | self.next = self.prev = None |
---|
1689 | self.sizer = makePageTitle(self, title) |
---|
1690 | |
---|
1691 | ModeList = [_('msg_drbl_mode_0'), _('msg_drbl_mode_1'), _('msg_drbl_mode_2')] |
---|
1692 | wx.StaticText(self,-1,_('msg_drbl_mode_switch_long'),wx.DLG_PNT(self, 5, 20),wx.DLG_SZE(self, 210, 300),wx.TE_MULTILINE) |
---|
1693 | rb = wx.RadioBox(self, -1, '', (5,305), wx.DefaultSize, ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
1694 | |
---|
1695 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
1696 | FinalArgs[0] = '/opt/drbl/sbin/tune-clientdir-opt' |
---|
1697 | FinalArgs[1] = '-d' |
---|
1698 | FinalArgs[2] = '0' |
---|
1699 | |
---|
1700 | def EvtRadioBox(self, event): |
---|
1701 | if event.GetInt() == 0: |
---|
1702 | FinalArgs[2] = '0' |
---|
1703 | elif event.GetInt() == 1: |
---|
1704 | FinalArgs[2] = '1' |
---|
1705 | elif event.GetInt() == 2: |
---|
1706 | FinalArgs[2] = '2' |
---|
1707 | |
---|
1708 | def SetNext(self, next): |
---|
1709 | self.next = next |
---|
1710 | |
---|
1711 | def SetPrev(self, prev): |
---|
1712 | self.prev = prev |
---|
1713 | |
---|
1714 | def GetNext(self): |
---|
1715 | return self.next |
---|
1716 | |
---|
1717 | def GetPrev(self): |
---|
1718 | return self.prev |
---|
1719 | |
---|
1720 | #---------------------------------------------------------------------- |
---|
1721 | class ClonezillaModePage(wiz.PyWizardPage): |
---|
1722 | def __init__(self, parent, title): |
---|
1723 | wiz.PyWizardPage.__init__(self, parent) |
---|
1724 | self.next = self.prev = None |
---|
1725 | self.sizer = makePageTitle(self, title) |
---|
1726 | |
---|
1727 | ModeList = [_('msg_clonezilla_mode_0'), _('msg_clonezilla_mode_1'), _('msg_clonezilla_mode_2')] |
---|
1728 | wx.StaticText(self,-1,_('msg_clonezilla_mode_switch_long'),wx.DLG_PNT(self, 5, 20),wx.DLG_SZE(self, 210, 200),wx.TE_MULTILINE) |
---|
1729 | rb = wx.RadioBox(self, -1, '', (5,205), wx.DefaultSize, ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
1730 | |
---|
1731 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
1732 | FinalArgs[0] = '/opt/drbl/sbin/tune-clientdir-opt' |
---|
1733 | FinalArgs[1] = '-z' |
---|
1734 | FinalArgs[2] = '0' |
---|
1735 | |
---|
1736 | def EvtRadioBox(self, event): |
---|
1737 | if event.GetInt() == 0: |
---|
1738 | FinalArgs[2] = '0' |
---|
1739 | elif event.GetInt() == 1: |
---|
1740 | FinalArgs[2] = '1' |
---|
1741 | elif event.GetInt() == 2: |
---|
1742 | FinalArgs[2] = '2' |
---|
1743 | |
---|
1744 | def SetNext(self, next): |
---|
1745 | self.next = next |
---|
1746 | |
---|
1747 | def SetPrev(self, prev): |
---|
1748 | self.prev = prev |
---|
1749 | |
---|
1750 | def GetNext(self): |
---|
1751 | return self.next |
---|
1752 | |
---|
1753 | def GetPrev(self): |
---|
1754 | return self.prev |
---|
1755 | |
---|
1756 | #---------------------------------------------------------------------- |
---|
1757 | class GenTemplateFilePage(wiz.PyWizardPage): |
---|
1758 | def __init__(self, parent, title): |
---|
1759 | wiz.PyWizardPage.__init__(self, parent) |
---|
1760 | self.next = self.prev = None |
---|
1761 | self.sizer = makePageTitle(self, title) |
---|
1762 | |
---|
1763 | wx.StaticText(self, -1, _('msg_gen_template_files'),(50,100)) |
---|
1764 | FinalArgs[0] = '/opt/drbl/sbin/gen_ssi_files' |
---|
1765 | |
---|
1766 | def SetNext(self, next): |
---|
1767 | self.next = next |
---|
1768 | |
---|
1769 | def SetPrev(self, prev): |
---|
1770 | self.prev = prev |
---|
1771 | |
---|
1772 | def GetNext(self): |
---|
1773 | return self.next |
---|
1774 | |
---|
1775 | def GetPrev(self): |
---|
1776 | return self.prev |
---|
1777 | |
---|
1778 | #---------------------------------------------------------------------- |
---|
1779 | class LoginSwitchPage(wiz.PyWizardPage): |
---|
1780 | def __init__(self, parent, title): |
---|
1781 | wiz.PyWizardPage.__init__(self, parent) |
---|
1782 | self.next = self.prev = None |
---|
1783 | self.sizer = makePageTitle(self, title) |
---|
1784 | |
---|
1785 | ModeList = [_('msg_normal_login'), _('msg_auto_login'), _('msg_timed_login')] |
---|
1786 | wx.StaticText(self, -1, _('msg_login_switch'),(50,35)) |
---|
1787 | rb = wx.RadioBox(self, -1, _('msg_choose_action'), (35, 50), (250,200), ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
1788 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
1789 | FinalArgs[0] = '/opt/drbl/sbin/drbl-login-switch' |
---|
1790 | FinalArgs[3] = '-n' |
---|
1791 | |
---|
1792 | def EvtRadioBox(self, event): |
---|
1793 | if event.GetInt() == 0: |
---|
1794 | FinalArgs[3] = '-n' |
---|
1795 | FinalArgs[4] = '' |
---|
1796 | FinalArgs[5] = '' |
---|
1797 | elif event.GetInt() == 1: |
---|
1798 | FinalArgs[0] = '/opt/drbl/sbin/drbl-client-switch' |
---|
1799 | FinalArgs[3] = 'remote-linux-gra' |
---|
1800 | FinalArgs[4] = '\n/opt/drbl/sbin/drbl-login-switch' |
---|
1801 | FinalArgs[5] = '-a' |
---|
1802 | elif event.GetInt() == 2: |
---|
1803 | FinalArgs[0] = '/opt/drbl/sbin/drbl-client-switch' |
---|
1804 | FinalArgs[3] = 'remote-linux-gra' |
---|
1805 | FinalArgs[4] = '\n/opt/drbl/sbin/drbl-login-switch' |
---|
1806 | FinalArgs[5] = '-t' |
---|
1807 | |
---|
1808 | def SetNext(self, next): |
---|
1809 | self.next = next |
---|
1810 | |
---|
1811 | def SetPrev(self, prev): |
---|
1812 | self.prev = prev |
---|
1813 | |
---|
1814 | def GetNext(self): |
---|
1815 | next = self.next |
---|
1816 | if FinalArgs[3] == '-n': |
---|
1817 | next = next.GetNext() |
---|
1818 | return next |
---|
1819 | |
---|
1820 | #def GetPrev(self): |
---|
1821 | #prev = self.prev |
---|
1822 | #prev = prev.GetPrev() |
---|
1823 | #return prev |
---|
1824 | |
---|
1825 | #---------------------------------------------------------------------- |
---|
1826 | class ClientReAutoLoginPage(wiz.PyWizardPage): |
---|
1827 | def __init__(self, parent, title): |
---|
1828 | wiz.PyWizardPage.__init__(self, parent) |
---|
1829 | self.next = self.prev = None |
---|
1830 | self.sizer = makePageTitle(self, title) |
---|
1831 | |
---|
1832 | wx.StaticText(self, -1, _('msg_client_reautologin'),(50,100)) |
---|
1833 | FinalArgs[0] = '/opt/drbl/sbin/drbl-client-reautologin' |
---|
1834 | |
---|
1835 | def SetNext(self, next): |
---|
1836 | self.next = next |
---|
1837 | |
---|
1838 | def SetPrev(self, prev): |
---|
1839 | self.prev = prev |
---|
1840 | |
---|
1841 | def GetNext(self): |
---|
1842 | return self.next |
---|
1843 | |
---|
1844 | def GetPrev(self): |
---|
1845 | prev = self.prev |
---|
1846 | prev = prev.GetPrev() |
---|
1847 | return prev |
---|
1848 | |
---|
1849 | #---------------------------------------------------------------------- |
---|
1850 | class CleanAutoLoginAccountPage(wiz.PyWizardPage): |
---|
1851 | def __init__(self, parent, title): |
---|
1852 | wiz.PyWizardPage.__init__(self, parent) |
---|
1853 | self.next = self.prev = None |
---|
1854 | self.sizer = makePageTitle(self, title) |
---|
1855 | |
---|
1856 | wx.StaticText(self, -1, _('msg_clean_autologin_account'),(50,100)) |
---|
1857 | FinalArgs[0] = '/opt/drbl/sbin/drbl-clean-autologin-account' |
---|
1858 | |
---|
1859 | def SetNext(self, next): |
---|
1860 | self.next = next |
---|
1861 | |
---|
1862 | def SetPrev(self, prev): |
---|
1863 | self.prev = prev |
---|
1864 | |
---|
1865 | def GetNext(self): |
---|
1866 | return self.next |
---|
1867 | |
---|
1868 | def GetPrev(self): |
---|
1869 | prev = self.prev |
---|
1870 | prev = prev.GetPrev() |
---|
1871 | return prev |
---|
1872 | |
---|
1873 | |
---|
1874 | #---------------------------------------------------------------------- |
---|
1875 | class ResetAutoLoginAccountPage(wiz.PyWizardPage): |
---|
1876 | def __init__(self, parent, title): |
---|
1877 | wiz.PyWizardPage.__init__(self, parent) |
---|
1878 | self.next = self.prev = None |
---|
1879 | self.sizer = makePageTitle(self, title) |
---|
1880 | |
---|
1881 | wx.StaticText(self, -1, _('msg_reset_autologin_account')) |
---|
1882 | FinalArgs[0] = '/opt/drbl/sbin/drbl-user-env-reset' |
---|
1883 | FinalArgs[1] = '--auto-login' |
---|
1884 | |
---|
1885 | def SetNext(self, next): |
---|
1886 | self.next = next |
---|
1887 | |
---|
1888 | def SetPrev(self, prev): |
---|
1889 | self.prev = prev |
---|
1890 | |
---|
1891 | def GetNext(self): |
---|
1892 | return self.next |
---|
1893 | |
---|
1894 | |
---|
1895 | #---------------------------------------------------------------------- |
---|
1896 | class SwitchDRBLServPage(wiz.PyWizardPage): |
---|
1897 | def __init__(self, parent, title): |
---|
1898 | wiz.PyWizardPage.__init__(self, parent) |
---|
1899 | self.next = self.prev = None |
---|
1900 | self.sizer = makePageTitle(self, title) |
---|
1901 | |
---|
1902 | ModeList = [_('msg_start_drbl_all_services'), _('msg_stop_drbl_all_services'), _('msg_restart_drbl_all_services'), _('msg_add_drbl_all_services'), _('msg_del_drbl_all_services')] |
---|
1903 | wx.StaticText(self, -1, _('msg_switch_drbl_service'),(50,35)) |
---|
1904 | rb = wx.RadioBox(self, -1, _('msg_choose_action'), (35, 50), (250,200), ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
1905 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
1906 | FinalArgs[0] = '/opt/drbl/sbin/drbl-all-service' |
---|
1907 | FinalArgs[1] = 'start' |
---|
1908 | |
---|
1909 | def EvtRadioBox(self, event): |
---|
1910 | if event.GetInt() == 0: |
---|
1911 | FinalArgs[1] = 'start' |
---|
1912 | elif event.GetInt() == 1: |
---|
1913 | FinalArgs[1] = 'stop' |
---|
1914 | elif event.GetInt() == 2: |
---|
1915 | FinalArgs[1] = 'restart' |
---|
1916 | elif event.GetInt() == 3: |
---|
1917 | FinalArgs[1] = 'add' |
---|
1918 | elif event.GetInt() == 4: |
---|
1919 | FinalArgs[1] = 'del' |
---|
1920 | |
---|
1921 | def SetNext(self, next): |
---|
1922 | self.next = next |
---|
1923 | |
---|
1924 | def SetPrev(self, prev): |
---|
1925 | self.prev = prev |
---|
1926 | |
---|
1927 | def GetNext(self): |
---|
1928 | return self.next |
---|
1929 | |
---|
1930 | #---------------------------------------------------------------------- |
---|
1931 | class ReDeployPage(wiz.PyWizardPage): |
---|
1932 | def __init__(self, parent, title): |
---|
1933 | wiz.PyWizardPage.__init__(self, parent) |
---|
1934 | self.next = self.prev = None |
---|
1935 | self.sizer = makePageTitle(self, title) |
---|
1936 | |
---|
1937 | wx.StaticText(self, -1, _('msg_re_deploy'),(50,100)) |
---|
1938 | FinalArgs[0] = '/opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf' |
---|
1939 | |
---|
1940 | def SetNext(self, next): |
---|
1941 | self.next = next |
---|
1942 | |
---|
1943 | def SetPrev(self, prev): |
---|
1944 | self.prev = prev |
---|
1945 | |
---|
1946 | def GetNext(self): |
---|
1947 | return self.next |
---|
1948 | |
---|
1949 | def GetPrev(self): |
---|
1950 | return self.prev |
---|
1951 | |
---|
1952 | #---------------------------------------------------------------------- |
---|
1953 | class FinalPage(wiz.PyWizardPage): |
---|
1954 | def __init__(self, parent, title): |
---|
1955 | wiz.PyWizardPage.__init__(self, parent) |
---|
1956 | self.next = self.prev = None |
---|
1957 | self.sizer = makePageTitle(self, title) |
---|
1958 | self.tc = wx.TextCtrl(self, -1,'', pos=(35,50), size=(350, 250), style=wx.TE_MULTILINE|wx.TE_READONLY) |
---|
1959 | |
---|
1960 | self.b1 = wx.Button(self, -1, 'detail', pos=(400,250)) |
---|
1961 | self.b2 = wx.Button(self, -1, 'command..', pos=(400,200)) |
---|
1962 | self.Bind(wx.EVT_BUTTON, self.OnButtonDetail, self.b1) |
---|
1963 | self.Bind(wx.EVT_BUTTON, self.OnButtonCommand, self.b2) |
---|
1964 | |
---|
1965 | def OnButtonDetail(self, evt): |
---|
1966 | self.tc.WriteText('%s' % command_log) |
---|
1967 | self.b1.Enable(False) |
---|
1968 | |
---|
1969 | def OnButtonCommand(self, evt): |
---|
1970 | final_command = '' |
---|
1971 | for i in range(0,36): |
---|
1972 | if FinalArgs[i] != '': |
---|
1973 | final_command = final_command + FinalArgs[i] + ' ' |
---|
1974 | self.tc.WriteText('%s' % final_command) |
---|
1975 | self.b2.Enable(False) |
---|
1976 | |
---|
1977 | def SetNext(self, next): |
---|
1978 | self.next = next |
---|
1979 | |
---|
1980 | def GetNext(self): |
---|
1981 | return self.next |
---|
1982 | |
---|
1983 | |
---|
1984 | #---------------------------------------------------------------------- |
---|
1985 | class MainFrame(wx.Frame): |
---|
1986 | def __init__(self, parent, id): |
---|
1987 | wx.Frame.__init__(self, parent, id, 'DRBL Config Wizard', (250,100), (700,400), style=wx.CAPTION) |
---|
1988 | #wx.NO_FULL_REPAINT_ON_RESIZE |
---|
1989 | self.scroll = wx.ScrolledWindow(self, -1) |
---|
1990 | self.scroll.SetScrollbars(1, 1, 550, 400) |
---|
1991 | |
---|
1992 | FunctionList = [_('msg_remote_linux_graphic'), _('msg_remote_linux_text'), _('msg_thin_client') |
---|
1993 | , _('msg_remote_memtest'), _('msg_remote_fdos'), _('msg_clonezilla_start_save') |
---|
1994 | , _('msg_clonezilla_start_restore'), _('msg_clonezilla_selec_in_client'), _('msg_clonezilla_stop') |
---|
1995 | , _('msg_local'), _('msg_reboot'), _('msg_shutdown'), _('msg_Wake_on_LAN') |
---|
1996 | , _('msg_switch_pxe_menu'), _('msg_switch_pxe_bg_mode'), _('msg_drbl_mode_switch') |
---|
1997 | , _('msg_clonezilla_mode_switch'), _('msg_gen_template_files'), _('msg_login_switch') |
---|
1998 | , _('msg_client_reautologin'), _('msg_clean_autologin_account'), _('msg_reset_autologin_account') |
---|
1999 | , _('msg_switch_drbl_service'), _('msg_re_deploy'), _('msg_clean_dhcpd_lease') |
---|
2000 | , _('msg_regenerate_nfs_nis_nat_config')] |
---|
2001 | rb = wx.RadioBox(self.scroll, -1, '', (35,20), (0,0), FunctionList, 2, wx.RA_SPECIFY_COLS|wx.NO_BORDER) |
---|
2002 | self.scroll.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
2003 | rb.SetSelection(0) |
---|
2004 | self.b1 = wx.Button(self.scroll, wx.ID_OK, pos=(600, 360)) # not translated |
---|
2005 | self.b2 = wx.Button(self.scroll, wx.ID_EXIT, pos=(500, 360)) |
---|
2006 | self.scroll.Bind(wx.EVT_BUTTON, self.RemoteLinuxGraWizard, self.b1) |
---|
2007 | self.scroll.Bind(wx.EVT_BUTTON, self.OnCloseMe, self.b2) |
---|
2008 | self.scroll.Bind(wx.EVT_CLOSE, self.OnCloseWindow) |
---|
2009 | |
---|
2010 | def EvtRadioBox(self, event): |
---|
2011 | if event.GetSelection() == 0: |
---|
2012 | self.scroll.Bind(wx.EVT_BUTTON, self.RemoteLinuxGraWizard, self.b1) |
---|
2013 | if event.GetSelection() == 1: |
---|
2014 | self.scroll.Bind(wx.EVT_BUTTON, self.RemoteLinuxTxtWizard, self.b1) |
---|
2015 | if event.GetSelection() == 2: |
---|
2016 | self.scroll.Bind(wx.EVT_BUTTON, self.TerminalWizard, self.b1) |
---|
2017 | if event.GetSelection() == 3: |
---|
2018 | self.scroll.Bind(wx.EVT_BUTTON, self.RemoteMemTestWizard, self.b1) |
---|
2019 | if event.GetSelection() == 4: |
---|
2020 | self.scroll.Bind(wx.EVT_BUTTON, self.RemotefdosWizard, self.b1) |
---|
2021 | if event.GetSelection() == 5: |
---|
2022 | self.scroll.Bind(wx.EVT_BUTTON, self.ClonezillaStartSaveWizard, self.b1) |
---|
2023 | if event.GetSelection() == 6: |
---|
2024 | self.scroll.Bind(wx.EVT_BUTTON, self.ClonezillaStartRestoreWizard, self.b1) |
---|
2025 | if event.GetSelection() == 7: |
---|
2026 | self.scroll.Bind(wx.EVT_BUTTON, self.ClonezillaSelectWizard, self.b1) |
---|
2027 | if event.GetSelection() == 8: |
---|
2028 | self.scroll.Bind(wx.EVT_BUTTON, self.ClonezillaStopWizard, self.b1) |
---|
2029 | if event.GetSelection() == 9: |
---|
2030 | self.scroll.Bind(wx.EVT_BUTTON, self.LocalWizard, self.b1) |
---|
2031 | if event.GetSelection() == 10: |
---|
2032 | self.scroll.Bind(wx.EVT_BUTTON, self.RebootWizard, self.b1) |
---|
2033 | if event.GetSelection() == 11: |
---|
2034 | self.scroll.Bind(wx.EVT_BUTTON, self.ShutdownWizard, self.b1) |
---|
2035 | if event.GetSelection() == 12: |
---|
2036 | self.scroll.Bind(wx.EVT_BUTTON, self.WakeOnLanWizard, self.b1) |
---|
2037 | if event.GetSelection() == 13: |
---|
2038 | self.scroll.Bind(wx.EVT_BUTTON, self.SwitchPXEMenuWizard, self.b1) |
---|
2039 | if event.GetSelection() == 14: |
---|
2040 | self.scroll.Bind(wx.EVT_BUTTON, self.SwitchPXEModeWizard, self.b1) |
---|
2041 | if event.GetSelection() == 15: |
---|
2042 | self.scroll.Bind(wx.EVT_BUTTON, self.DRBLModeWizard, self.b1) |
---|
2043 | if event.GetSelection() == 16: |
---|
2044 | self.scroll.Bind(wx.EVT_BUTTON, self.ClonezillaModeWizard, self.b1) |
---|
2045 | if event.GetSelection() == 17: |
---|
2046 | self.scroll.Bind(wx.EVT_BUTTON, self.GenTemplateFileWizard, self.b1) |
---|
2047 | if event.GetSelection() == 18: |
---|
2048 | self.scroll.Bind(wx.EVT_BUTTON, self.LoginSwitchWizard, self.b1) |
---|
2049 | if event.GetSelection() == 19: |
---|
2050 | self.scroll.Bind(wx.EVT_BUTTON, self.ClientReAutoLoginWizard, self.b1) |
---|
2051 | if event.GetSelection() == 20: |
---|
2052 | self.scroll.Bind(wx.EVT_BUTTON, self.CleanAutoLoginAccountWizard, self.b1) |
---|
2053 | if event.GetSelection() == 21: |
---|
2054 | self.scroll.Bind(wx.EVT_BUTTON, self.ResetAutoLoginAccountWizard, self.b1) |
---|
2055 | if event.GetSelection() == 22: |
---|
2056 | self.scroll.Bind(wx.EVT_BUTTON, self.SwitchDRBLServWizard, self.b1) |
---|
2057 | if event.GetSelection() == 23: |
---|
2058 | self.scroll.Bind(wx.EVT_BUTTON, self.ReDeployWizard, self.b1) |
---|
2059 | if event.GetSelection() == 24: |
---|
2060 | self.scroll.Bind(wx.EVT_BUTTON, self.CleanDHCPLeaseWizard, self.b1) |
---|
2061 | if event.GetSelection() == 25: |
---|
2062 | self.scroll.Bind(wx.EVT_BUTTON, self.Regenerate3NWizard, self.b1) |
---|
2063 | |
---|
2064 | #---------------------------------------------------------------------- |
---|
2065 | def OnCloseWindow(self, event): |
---|
2066 | self.Destroy() |
---|
2067 | #---------------------------------------------------------------------- |
---|
2068 | def OnCloseMe(self, event): |
---|
2069 | self.Close(True) |
---|
2070 | |
---|
2071 | #------------------------------Wizard Modules-------------------------- |
---|
2072 | def RemoteLinuxGraWizard(self,evt): |
---|
2073 | wizard = wiz.Wizard(self, -1, 'RemoteLinuxGraWizard', pos = (350,200)) |
---|
2074 | |
---|
2075 | page1 = SetAllClientsPage(wizard, '') |
---|
2076 | page2 = SelectClientsPage(wizard, '') |
---|
2077 | page3 = RemoteLinuxGraPage(wizard, '') |
---|
2078 | page4 = FinalPage(wizard, '') |
---|
2079 | |
---|
2080 | self.page1 = page1 |
---|
2081 | wizard.SetPageSize((500,300)) |
---|
2082 | |
---|
2083 | page1.SetNext(page2) |
---|
2084 | page2.SetPrev(page1) |
---|
2085 | page2.SetNext(page3) |
---|
2086 | page3.SetPrev(page2) |
---|
2087 | page3.SetNext(page4) |
---|
2088 | |
---|
2089 | if wizard.RunWizard(page1): |
---|
2090 | #wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2091 | for i in range(0,36): |
---|
2092 | FinalArgs[i] = '' |
---|
2093 | else: |
---|
2094 | #wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2095 | for i in range(0,36): |
---|
2096 | FinalArgs[i] = '' |
---|
2097 | |
---|
2098 | #------------------------------Wizard Modules-------------------------- |
---|
2099 | def RemoteLinuxTxtWizard(self,evt): |
---|
2100 | wizard = wiz.Wizard(self, -1, 'RemoteLinuxTextWizard', pos = (350,200)) |
---|
2101 | |
---|
2102 | page1 = SetAllClientsPage(wizard, '') |
---|
2103 | page2 = SelectClientsPage(wizard, '') |
---|
2104 | page3 = RemoteLinuxTxtPage(wizard, '') |
---|
2105 | page4 = FinalPage(wizard, '') |
---|
2106 | |
---|
2107 | self.page1 = page1 |
---|
2108 | wizard.SetPageSize((500,300)) |
---|
2109 | |
---|
2110 | page1.SetNext(page2) |
---|
2111 | page2.SetPrev(page1) |
---|
2112 | page2.SetNext(page3) |
---|
2113 | page3.SetPrev(page2) |
---|
2114 | page3.SetNext(page4) |
---|
2115 | |
---|
2116 | if wizard.RunWizard(page1): |
---|
2117 | #wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2118 | for i in range(0,36): |
---|
2119 | FinalArgs[i] = '' |
---|
2120 | else: |
---|
2121 | #wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2122 | for i in range(0,36): |
---|
2123 | FinalArgs[i] = '' |
---|
2124 | |
---|
2125 | #------------------------------Wizard Modules-------------------------- |
---|
2126 | def TerminalWizard(self,evt): |
---|
2127 | wizard = wiz.Wizard(self, -1, 'TerminalWizard', pos = (350,200)) |
---|
2128 | |
---|
2129 | page1 = SetAllClientsPage(wizard, '') |
---|
2130 | page2 = SelectClientsPage(wizard, '') |
---|
2131 | page3 = TerminalPage(wizard, '') |
---|
2132 | page4 = FinalPage(wizard, '') |
---|
2133 | |
---|
2134 | self.page1 = page1 |
---|
2135 | wizard.SetPageSize((500,300)) |
---|
2136 | |
---|
2137 | page1.SetNext(page2) |
---|
2138 | page2.SetPrev(page1) |
---|
2139 | page2.SetNext(page3) |
---|
2140 | page3.SetPrev(page2) |
---|
2141 | page3.SetNext(page4) |
---|
2142 | |
---|
2143 | if wizard.RunWizard(page1): |
---|
2144 | #wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2145 | for i in range(0,36): |
---|
2146 | FinalArgs[i] = '' |
---|
2147 | else: |
---|
2148 | #wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2149 | for i in range(0,36): |
---|
2150 | FinalArgs[i] = '' |
---|
2151 | |
---|
2152 | #------------------------------Wizard Modules-------------------------- |
---|
2153 | def RemoteMemTestWizard(self,evt): |
---|
2154 | wizard = wiz.Wizard(self, -1, 'RemoteMemTestWizard', pos = (500,200)) |
---|
2155 | |
---|
2156 | page1 = SetAllClientsPage(wizard, '') |
---|
2157 | page2 = SelectClientsPage(wizard, '') |
---|
2158 | page3 = RemoteMemTestPage(wizard, '') |
---|
2159 | page4 = FinalPage(wizard, '') |
---|
2160 | |
---|
2161 | self.page1 = page1 |
---|
2162 | wizard.SetPageSize((500,300)) |
---|
2163 | |
---|
2164 | page1.SetNext(page2) |
---|
2165 | page2.SetPrev(page1) |
---|
2166 | page2.SetNext(page3) |
---|
2167 | page3.SetPrev(page2) |
---|
2168 | page3.SetNext(page4) |
---|
2169 | |
---|
2170 | if wizard.RunWizard(page1): |
---|
2171 | #wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2172 | for i in range(0,36): |
---|
2173 | FinalArgs[i] = '' |
---|
2174 | else: |
---|
2175 | #wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2176 | for i in range(0,36): |
---|
2177 | FinalArgs[i] = '' |
---|
2178 | |
---|
2179 | #------------------------------Wizard Modules-------------------------- |
---|
2180 | def RemotefdosWizard(self,evt): |
---|
2181 | wizard = wiz.Wizard(self, -1, 'RemotefdosWizard', pos = (500,200)) |
---|
2182 | |
---|
2183 | page1 = SetAllClientsPage(wizard, '') |
---|
2184 | page2 = SelectClientsPage(wizard, '') |
---|
2185 | page3 = RemotefdosPage(wizard,'') |
---|
2186 | page4 = FinalPage(wizard,'') |
---|
2187 | |
---|
2188 | self.page1 = page1 |
---|
2189 | wizard.SetPageSize((500,300)) |
---|
2190 | |
---|
2191 | page1.SetNext(page2) |
---|
2192 | page2.SetPrev(page1) |
---|
2193 | page2.SetNext(page3) |
---|
2194 | page3.SetPrev(page2) |
---|
2195 | page3.SetNext(page4) |
---|
2196 | |
---|
2197 | if wizard.RunWizard(page1): |
---|
2198 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2199 | for i in range(0,36): |
---|
2200 | FinalArgs[i] = '' |
---|
2201 | else: |
---|
2202 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2203 | for i in range(0,36): |
---|
2204 | FinalArgs[i] = '' |
---|
2205 | |
---|
2206 | #------------------------------Wizard Modules-------------------------- |
---|
2207 | def ClonezillaStartSaveWizard(self,evt): |
---|
2208 | wizard = wiz.Wizard(self, -1, 'ClonezillaStartSaveWizard', pos = (500,200)) |
---|
2209 | |
---|
2210 | page1 = SetAllClientsPage(wizard, '') |
---|
2211 | page2 = SelectClientsPage(wizard, '') |
---|
2212 | page3 = ClonezillaStartSavePage1(wizard, '') |
---|
2213 | page4 = ClonezillaStartSavePage2(wizard, '') |
---|
2214 | page5 = ClonezillaStartSavePage3(wizard, '') |
---|
2215 | page6 = ClonezillaStartSavePage4(wizard, '') |
---|
2216 | page7 = ClonezillaStartSavePage5(wizard, '') |
---|
2217 | page8 = ClonezillaStartSavePage6(wizard, '') |
---|
2218 | page9 = FinalPage(wizard,'') |
---|
2219 | |
---|
2220 | self.page1 = page1 |
---|
2221 | wizard.SetPageSize((500,300)) |
---|
2222 | |
---|
2223 | page1.SetNext(page2) |
---|
2224 | page2.SetPrev(page1) |
---|
2225 | page2.SetNext(page3) |
---|
2226 | page3.SetPrev(page2) |
---|
2227 | page3.SetNext(page4) |
---|
2228 | page4.SetPrev(page3) |
---|
2229 | page4.SetNext(page5) |
---|
2230 | page5.SetPrev(page4) |
---|
2231 | page5.SetNext(page6) |
---|
2232 | page6.SetPrev(page5) |
---|
2233 | page6.SetNext(page7) |
---|
2234 | page7.SetPrev(page6) |
---|
2235 | page7.SetNext(page8) |
---|
2236 | page8.SetPrev(page7) |
---|
2237 | page8.SetNext(page9) |
---|
2238 | |
---|
2239 | if wizard.RunWizard(page1): |
---|
2240 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2241 | for i in range(0,36): |
---|
2242 | FinalArgs[i] = '' |
---|
2243 | else: |
---|
2244 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2245 | for i in range(0,36): |
---|
2246 | FinalArgs[i] = '' |
---|
2247 | |
---|
2248 | #------------------------------Wizard Modules-------------------------- |
---|
2249 | def ClonezillaStartRestoreWizard(self,evt): |
---|
2250 | wizard = wiz.Wizard(self, -1, 'ClonezillaStartRestoreWizard', pos = (500,200)) |
---|
2251 | |
---|
2252 | page1 = SetAllClientsPage(wizard, '') |
---|
2253 | page2 = SelectClientsPage(wizard, '') |
---|
2254 | page3 = ClonezillaStartRestorePage1(wizard, 'ClonezillaStartRestorePage1') |
---|
2255 | page4 = ClonezillaStartRestorePage2(wizard, 'ClonezillaStartRestorePage2') |
---|
2256 | page5 = ClonezillaStartRestorePage3(wizard, 'ClonezillaStartRestorePage3') |
---|
2257 | page6 = ClonezillaStartRestorePage4(wizard, 'ClonezillaStartRestorePage4') |
---|
2258 | page7 = ClonezillaStartRestorePage5(wizard, 'ClonezillaStartRestorePage5') |
---|
2259 | page8 = ClonezillaStartRestorePage6(wizard, 'ClonezillaStartRestorePage6') |
---|
2260 | page9 = ClonezillaStartRestorePage7(wizard, 'ClonezillaStartRestorePage7') |
---|
2261 | page10 = ClonezillaStartRestorePage8a(wizard, 'ClonezillaStartRestorePage8a') |
---|
2262 | page11 = ClonezillaStartRestorePage8b(wizard, 'ClonezillaStartRestorePage8b') |
---|
2263 | page12 = ClonezillaStartRestorePage9a(wizard, 'ClonezillaStartRestorePage9a') |
---|
2264 | page13 = ClonezillaStartRestorePage9b(wizard, 'ClonezillaStartRestorePage9b') |
---|
2265 | page14 = ClonezillaStartRestorePage10(wizard, 'ClonezillaStartRestorePage10') |
---|
2266 | page15 = ClonezillaStartRestorePage11(wizard, 'ClonezillaStartRestorePage11') |
---|
2267 | page16 = ClonezillaStartRestorePage12(wizard, 'ClonezillaStartRestorePage12') |
---|
2268 | page17 = FinalPage(wizard,'FinalPage') |
---|
2269 | |
---|
2270 | self.page1 = page1 |
---|
2271 | wizard.SetPageSize((500,300)) |
---|
2272 | |
---|
2273 | page1.SetNext(page2) |
---|
2274 | page2.SetPrev(page1) |
---|
2275 | page2.SetNext(page3) |
---|
2276 | page3.SetPrev(page2) |
---|
2277 | page3.SetNext(page4) |
---|
2278 | page4.SetPrev(page3) |
---|
2279 | page4.SetNext(page5) |
---|
2280 | page5.SetPrev(page4) |
---|
2281 | page5.SetNext(page6) |
---|
2282 | page6.SetPrev(page4) |
---|
2283 | page6.SetNext(page7) |
---|
2284 | page7.SetPrev(page4) |
---|
2285 | page7.SetNext(page8) |
---|
2286 | page8.SetPrev(page7) |
---|
2287 | page8.SetNext(page9) |
---|
2288 | page9.SetPrev(page8) |
---|
2289 | page9.SetNext(page10) |
---|
2290 | page10.SetPrev(page9) |
---|
2291 | page10.SetNext(page11) |
---|
2292 | page11.SetPrev(page9) |
---|
2293 | page11.SetNext(page12) |
---|
2294 | page12.SetPrev(page10) |
---|
2295 | page12.SetNext(page13) |
---|
2296 | page13.SetPrev(page11) |
---|
2297 | page13.SetNext(page14) |
---|
2298 | page14.SetPrev(page13) |
---|
2299 | page14.SetNext(page15) |
---|
2300 | page15.SetPrev(page14) |
---|
2301 | page15.SetNext(page16) |
---|
2302 | page16.SetPrev(page14) |
---|
2303 | page16.SetNext(page17) |
---|
2304 | #page17.SetPrev(page16) |
---|
2305 | #page17.SetNext(page18) |
---|
2306 | |
---|
2307 | if wizard.RunWizard(page1): |
---|
2308 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2309 | for i in range(0,36): |
---|
2310 | FinalArgs[i] = '' |
---|
2311 | else: |
---|
2312 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2313 | for i in range(0,36): |
---|
2314 | FinalArgs[i] = '' |
---|
2315 | |
---|
2316 | #------------------------------Wizard Modules-------------------------- |
---|
2317 | def ClonezillaSelectWizard(self,evt): |
---|
2318 | wizard = wiz.Wizard(self, -1, 'ClonezillaSelectWizard', pos = (500,200)) |
---|
2319 | |
---|
2320 | page1 = SetAllClientsPage(wizard, '') |
---|
2321 | page2 = SelectClientsPage(wizard, '') |
---|
2322 | page3 = ClonezillaSelectPage1(wizard, '') |
---|
2323 | page4 = ClonezillaSelectPage2(wizard, '') |
---|
2324 | page5 = FinalPage(wizard, '') |
---|
2325 | |
---|
2326 | self.page1 = page1 |
---|
2327 | wizard.SetPageSize((500,300)) |
---|
2328 | |
---|
2329 | page1.SetNext(page2) |
---|
2330 | page2.SetPrev(page1) |
---|
2331 | page2.SetNext(page3) |
---|
2332 | page3.SetPrev(page2) |
---|
2333 | page3.SetNext(page4) |
---|
2334 | page4.SetPrev(page3) |
---|
2335 | page4.SetNext(page5) |
---|
2336 | |
---|
2337 | if wizard.RunWizard(page1): |
---|
2338 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2339 | for i in range(0,36): |
---|
2340 | FinalArgs[i] = '' |
---|
2341 | else: |
---|
2342 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2343 | for i in range(0,36): |
---|
2344 | FinalArgs[i] = '' |
---|
2345 | |
---|
2346 | #------------------------------Wizard Modules-------------------------- |
---|
2347 | def ClonezillaStopWizard(self,evt): |
---|
2348 | wizard = wiz.Wizard(self, -1, 'ClonezillaStopWizard', pos = (500,200)) |
---|
2349 | |
---|
2350 | page1 = SetAllClientsPage(wizard, '') |
---|
2351 | page2 = SelectClientsPage(wizard, '') |
---|
2352 | page3 = ClonezillaStopPage(wizard, '') |
---|
2353 | page4 = FinalPage(wizard, '') |
---|
2354 | |
---|
2355 | self.page1 = page1 |
---|
2356 | wizard.SetPageSize((500,300)) |
---|
2357 | |
---|
2358 | page1.SetNext(page2) |
---|
2359 | page2.SetPrev(page1) |
---|
2360 | page2.SetNext(page3) |
---|
2361 | page3.SetPrev(page2) |
---|
2362 | page3.SetNext(page4) |
---|
2363 | |
---|
2364 | if wizard.RunWizard(page1): |
---|
2365 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2366 | for i in range(0,36): |
---|
2367 | FinalArgs[i] = '' |
---|
2368 | else: |
---|
2369 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2370 | for i in range(0,36): |
---|
2371 | FinalArgs[i] = '' |
---|
2372 | |
---|
2373 | #------------------------------Wizard Modules-------------------------- |
---|
2374 | def LocalWizard(self,evt): |
---|
2375 | wizard = wiz.Wizard(self, -1, 'LocalWizard', pos = (500,200)) |
---|
2376 | |
---|
2377 | page1 = SetAllClientsPage(wizard, '') |
---|
2378 | page2 = SelectClientsPage(wizard, '') |
---|
2379 | page3 = LocalPage(wizard, '') |
---|
2380 | page4 = FinalPage(wizard, '') |
---|
2381 | |
---|
2382 | self.page1 = page1 |
---|
2383 | wizard.SetPageSize((500,300)) |
---|
2384 | |
---|
2385 | page1.SetNext(page2) |
---|
2386 | page2.SetPrev(page1) |
---|
2387 | page2.SetNext(page3) |
---|
2388 | page3.SetPrev(page2) |
---|
2389 | page3.SetNext(page4) |
---|
2390 | |
---|
2391 | if wizard.RunWizard(page1): |
---|
2392 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2393 | for i in range(0,36): |
---|
2394 | FinalArgs[i] = '' |
---|
2395 | else: |
---|
2396 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2397 | for i in range(0,36): |
---|
2398 | FinalArgs[i] = '' |
---|
2399 | |
---|
2400 | #------------------------------Wizard Modules-------------------------- |
---|
2401 | def RebootWizard(self,evt): |
---|
2402 | wizard = wiz.Wizard(self, -1, 'RebootWizard', pos = (500,200)) |
---|
2403 | |
---|
2404 | page1 = SetAllClientsPage(wizard, '') |
---|
2405 | page2 = SelectClientsPage(wizard, '') |
---|
2406 | page3 = RebootPage(wizard, '') |
---|
2407 | page4 = FinalPage(wizard, '') |
---|
2408 | |
---|
2409 | self.page1 = page1 |
---|
2410 | wizard.SetPageSize((500,300)) |
---|
2411 | |
---|
2412 | page1.SetNext(page2) |
---|
2413 | page2.SetPrev(page1) |
---|
2414 | page2.SetNext(page3) |
---|
2415 | page3.SetPrev(page2) |
---|
2416 | page3.SetNext(page4) |
---|
2417 | |
---|
2418 | if wizard.RunWizard(page1): |
---|
2419 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2420 | for i in range(0,36): |
---|
2421 | FinalArgs[i] = '' |
---|
2422 | else: |
---|
2423 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2424 | for i in range(0,36): |
---|
2425 | FinalArgs[i] = '' |
---|
2426 | |
---|
2427 | #------------------------------Wizard Modules-------------------------- |
---|
2428 | def ShutdownWizard(self,evt): |
---|
2429 | wizard = wiz.Wizard(self, -1, 'ShutdownWizard', pos = (500,200)) |
---|
2430 | |
---|
2431 | page1 = SetAllClientsPage(wizard, '') |
---|
2432 | page2 = SelectClientsPage(wizard, '') |
---|
2433 | page3 = ShutdownPage(wizard, '') |
---|
2434 | page4 = FinalPage(wizard, '') |
---|
2435 | |
---|
2436 | self.page1 = page1 |
---|
2437 | wizard.SetPageSize((500,300)) |
---|
2438 | |
---|
2439 | page1.SetNext(page2) |
---|
2440 | page2.SetPrev(page1) |
---|
2441 | page2.SetNext(page3) |
---|
2442 | page3.SetPrev(page2) |
---|
2443 | page3.SetNext(page4) |
---|
2444 | |
---|
2445 | if wizard.RunWizard(page1): |
---|
2446 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2447 | for i in range(0,36): |
---|
2448 | FinalArgs[i] = '' |
---|
2449 | else: |
---|
2450 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2451 | for i in range(0,36): |
---|
2452 | FinalArgs[i] = '' |
---|
2453 | |
---|
2454 | #------------------------------Wizard Modules----------------------------- |
---|
2455 | def WakeOnLanWizard(self,evt): |
---|
2456 | wizard = wiz.Wizard(self, -1, 'WakeOnLanWizard', pos = (500,200)) |
---|
2457 | |
---|
2458 | page1 = SetAllClientsPage(wizard, '') |
---|
2459 | page2 = SelectClientsPage(wizard, '') |
---|
2460 | page3 = WakeOnLanPage(wizard, '') |
---|
2461 | page4 = FinalPage(wizard, '') |
---|
2462 | |
---|
2463 | self.page1 = page1 |
---|
2464 | wizard.SetPageSize((500,300)) |
---|
2465 | |
---|
2466 | page1.SetNext(page2) |
---|
2467 | page2.SetPrev(page1) |
---|
2468 | page2.SetNext(page3) |
---|
2469 | page3.SetPrev(page2) |
---|
2470 | page3.SetNext(page4) |
---|
2471 | |
---|
2472 | if wizard.RunWizard(page1): |
---|
2473 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2474 | for i in range(0,36): |
---|
2475 | FinalArgs[i] = '' |
---|
2476 | else: |
---|
2477 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2478 | for i in range(0,36): |
---|
2479 | FinalArgs[i] = '' |
---|
2480 | |
---|
2481 | #------------------------------Wizard Modules----------------------------- |
---|
2482 | def SwitchPXEMenuWizard(self,evt): |
---|
2483 | wizard = wiz.Wizard(self, -1, 'SwitchPXEMenuWizard', pos = (500,200)) |
---|
2484 | |
---|
2485 | page1 = SetAllClientsPage(wizard, '') |
---|
2486 | page2 = SelectClientsPage(wizard, '') |
---|
2487 | page3 = SwitchPXEMenuPage1(wizard, '') |
---|
2488 | page4 = SwitchPXEMenuPage2(wizard, '') |
---|
2489 | page5 = SwitchPXEMenuPage3(wizard, '') |
---|
2490 | page6 = SwitchPXEMenuPage4(wizard, '') |
---|
2491 | |
---|
2492 | self.page1 = page1 |
---|
2493 | wizard.SetPageSize((500,300)) |
---|
2494 | |
---|
2495 | page1.SetNext(page2) |
---|
2496 | page2.SetPrev(page1) |
---|
2497 | page2.SetNext(page3) |
---|
2498 | page3.SetPrev(page2) |
---|
2499 | page3.SetNext(page4) |
---|
2500 | page4.SetPrev(page3) |
---|
2501 | page4.SetNext(page5) |
---|
2502 | page5.SetPrev(page4) |
---|
2503 | page5.SetNext(page6) |
---|
2504 | |
---|
2505 | if wizard.RunWizard(page1): |
---|
2506 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2507 | for i in range(0,36): |
---|
2508 | FinalArgs[i] = '' |
---|
2509 | else: |
---|
2510 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2511 | for i in range(0,36): |
---|
2512 | FinalArgs[i] = '' |
---|
2513 | |
---|
2514 | #------------------------------Wizard Modules----------------------------- |
---|
2515 | def SwitchPXEModeWizard(self,evt): |
---|
2516 | wizard = wiz.Wizard(self, -1, 'SwitchPXEModeWizard', pos = (500,200)) |
---|
2517 | |
---|
2518 | page1 = SetAllClientsPage(wizard, '') |
---|
2519 | page2 = SelectOnePage(wizard, '') |
---|
2520 | page3 = SwitchPXEModePage(wizard, '') |
---|
2521 | page4 = FinalPage(wizard, '') |
---|
2522 | |
---|
2523 | self.page1 = page1 |
---|
2524 | wizard.SetPageSize((500,300)) |
---|
2525 | |
---|
2526 | page1.SetNext(page2) |
---|
2527 | page2.SetPrev(page1) |
---|
2528 | page2.SetNext(page3) |
---|
2529 | page3.SetPrev(page2) |
---|
2530 | page3.SetNext(page4) |
---|
2531 | |
---|
2532 | if wizard.RunWizard(page1): |
---|
2533 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2534 | for i in range(0,36): |
---|
2535 | FinalArgs[i] = '' |
---|
2536 | else: |
---|
2537 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2538 | for i in range(0,36): |
---|
2539 | FinalArgs[i] = '' |
---|
2540 | |
---|
2541 | #------------------------------Wizard Modules----------------------------- |
---|
2542 | def DRBLModeWizard(self,evt): |
---|
2543 | wizard = wiz.Wizard(self, -1, 'DRBLModeWizard', pos = (500,200)) |
---|
2544 | |
---|
2545 | page1 = DRBLModePage(wizard, '') |
---|
2546 | page2 = FinalPage(wizard, '') |
---|
2547 | |
---|
2548 | self.page1 = page1 |
---|
2549 | wizard.SetPageSize((500,400)) |
---|
2550 | |
---|
2551 | page1.SetNext(page2) |
---|
2552 | page2.SetPrev(page1) |
---|
2553 | |
---|
2554 | if wizard.RunWizard(page1): |
---|
2555 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2556 | for i in range(0,36): |
---|
2557 | FinalArgs[i] = '' |
---|
2558 | else: |
---|
2559 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2560 | for i in range(0,36): |
---|
2561 | FinalArgs[i] = '' |
---|
2562 | |
---|
2563 | #------------------------------Wizard Modules----------------------------- |
---|
2564 | def ClonezillaModeWizard(self,evt): |
---|
2565 | wizard = wiz.Wizard(self, -1, 'ClonezillaModeWizard', pos = (500,200)) |
---|
2566 | |
---|
2567 | page1 = ClonezillaModePage(wizard, '') |
---|
2568 | page2 = FinalPage(wizard, '') |
---|
2569 | |
---|
2570 | self.page1 = page1 |
---|
2571 | wizard.SetPageSize((500,300)) |
---|
2572 | |
---|
2573 | page1.SetNext(page2) |
---|
2574 | page2.SetPrev(page1) |
---|
2575 | |
---|
2576 | if wizard.RunWizard(page1): |
---|
2577 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2578 | for i in range(0,36): |
---|
2579 | FinalArgs[i] = '' |
---|
2580 | else: |
---|
2581 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2582 | for i in range(0,36): |
---|
2583 | FinalArgs[i] = '' |
---|
2584 | |
---|
2585 | #------------------------------Wizard Modules----------------------------- |
---|
2586 | def GenTemplateFileWizard(self,evt): |
---|
2587 | wizard = wiz.Wizard(self, -1, 'GenTemplateFileWizard', pos = (500,200)) |
---|
2588 | |
---|
2589 | page1 = GenTemplateFilePage(wizard, '') |
---|
2590 | page2 = FinalPage(wizard, '') |
---|
2591 | |
---|
2592 | self.page1 = page1 |
---|
2593 | wizard.SetPageSize((500,300)) |
---|
2594 | |
---|
2595 | page1.SetNext(page2) |
---|
2596 | page2.SetPrev(page1) |
---|
2597 | |
---|
2598 | if wizard.RunWizard(page1): |
---|
2599 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2600 | for i in range(0,36): |
---|
2601 | FinalArgs[i] = '' |
---|
2602 | else: |
---|
2603 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2604 | for i in range(0,36): |
---|
2605 | FinalArgs[i] = '' |
---|
2606 | |
---|
2607 | #------------------------------Wizard Modules----------------------------- |
---|
2608 | def LoginSwitchWizard(self,evt): |
---|
2609 | wizard = wiz.Wizard(self, -1, 'LoginSwitchWizard', pos = (500,200)) |
---|
2610 | |
---|
2611 | page1 = LoginSwitchPage(wizard, '') |
---|
2612 | page2 = SetAllClientsPage(wizard, '') |
---|
2613 | page3 = SelectClientsPage(wizard, '') |
---|
2614 | page4 = FinalPage(wizard, '') |
---|
2615 | |
---|
2616 | self.page1 = page1 |
---|
2617 | wizard.SetPageSize((500,300)) |
---|
2618 | |
---|
2619 | page1.SetNext(page2) |
---|
2620 | page2.SetPrev(page1) |
---|
2621 | page2.SetNext(page3) |
---|
2622 | page3.SetPrev(page2) |
---|
2623 | page3.SetNext(page4) |
---|
2624 | |
---|
2625 | if wizard.RunWizard(page1): |
---|
2626 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2627 | for i in range(0,36): |
---|
2628 | FinalArgs[i] = '' |
---|
2629 | else: |
---|
2630 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2631 | for i in range(0,36): |
---|
2632 | FinalArgs[i] = '' |
---|
2633 | |
---|
2634 | #------------------------------Wizard Modules----------------------------- |
---|
2635 | def ClientReAutoLoginWizard(self,evt): |
---|
2636 | wizard = wiz.Wizard(self, -1, ' ClientReAutoLogin', pos = (500,200)) |
---|
2637 | |
---|
2638 | page1 = SetAllClientsPage(wizard, '') |
---|
2639 | page2 = SelectClientsPage(wizard, '') |
---|
2640 | page3 = ClientReAutoLoginPage(wizard, '') |
---|
2641 | page4 = FinalPage(wizard, '') |
---|
2642 | |
---|
2643 | self.page1 = page1 |
---|
2644 | wizard.SetPageSize((500,300)) |
---|
2645 | |
---|
2646 | page1.SetNext(page2) |
---|
2647 | page2.SetPrev(page1) |
---|
2648 | page2.SetNext(page3) |
---|
2649 | page3.SetPrev(page2) |
---|
2650 | page3.SetNext(page4) |
---|
2651 | |
---|
2652 | if wizard.RunWizard(page1): |
---|
2653 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2654 | for i in range(0,36): |
---|
2655 | FinalArgs[i] = '' |
---|
2656 | else: |
---|
2657 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2658 | for i in range(0,36): |
---|
2659 | FinalArgs[i] = '' |
---|
2660 | |
---|
2661 | #------------------------------Wizard Modules----------------------------- |
---|
2662 | def CleanAutoLoginAccountWizard(self,evt): |
---|
2663 | wizard = wiz.Wizard(self, -1, 'CleanAutoLoginAccount', pos = (500,200)) |
---|
2664 | |
---|
2665 | page1 = SetAllClientsPage(wizard, '') |
---|
2666 | page2 = SelectOneClientPage(wizard, '') |
---|
2667 | page3 = CleanAutoLoginAccountPage(wizard, '') |
---|
2668 | page4 = FinalPage(wizard, '') |
---|
2669 | |
---|
2670 | self.page1 = page1 |
---|
2671 | wizard.SetPageSize((500,300)) |
---|
2672 | |
---|
2673 | page1.SetNext(page2) |
---|
2674 | page2.SetPrev(page1) |
---|
2675 | page2.SetNext(page3) |
---|
2676 | page3.SetPrev(page2) |
---|
2677 | page3.SetNext(page4) |
---|
2678 | |
---|
2679 | if wizard.RunWizard(page1): |
---|
2680 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2681 | for i in range(0,36): |
---|
2682 | FinalArgs[i] = '' |
---|
2683 | else: |
---|
2684 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2685 | for i in range(0,36): |
---|
2686 | FinalArgs[i] = '' |
---|
2687 | |
---|
2688 | #------------------------------Wizard Modules----------------------------- |
---|
2689 | def ResetAutoLoginAccountWizard(self,evt): |
---|
2690 | wizard = wiz.Wizard(self, -1, 'ResetAutoLoginAccount', pos = (500,200)) |
---|
2691 | |
---|
2692 | #page1 = SetAllClientsPage(wizard, '') |
---|
2693 | #page2 = SelectOneClientPage(wizard, '') |
---|
2694 | page1 = ResetAutoLoginAccountPage(wizard, '') |
---|
2695 | page2 = FinalPage(wizard, '') |
---|
2696 | |
---|
2697 | self.page1 = page1 |
---|
2698 | wizard.SetPageSize((500,300)) |
---|
2699 | |
---|
2700 | page1.SetNext(page2) |
---|
2701 | #page2.SetPrev(page1) |
---|
2702 | #page2.SetNext(page3) |
---|
2703 | #page3.SetPrev(page2) |
---|
2704 | #page3.SetNext(page4) |
---|
2705 | |
---|
2706 | if wizard.RunWizard(page1): |
---|
2707 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2708 | for i in range(0,36): |
---|
2709 | FinalArgs[i] = '' |
---|
2710 | else: |
---|
2711 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2712 | for i in range(0,36): |
---|
2713 | FinalArgs[i] = '' |
---|
2714 | |
---|
2715 | #------------------------------Wizard Modules----------------------------- |
---|
2716 | def SwitchDRBLServWizard(self,evt): |
---|
2717 | wizard = wiz.Wizard(self, -1, 'SwitchDRBLServWizard', pos = (500,200)) |
---|
2718 | |
---|
2719 | page1 = SwitchDRBLServPage(wizard, '') |
---|
2720 | page2 = FinalPage(wizard, '') |
---|
2721 | |
---|
2722 | self.page1 = page1 |
---|
2723 | wizard.SetPageSize((500,300)) |
---|
2724 | |
---|
2725 | page1.SetNext(page2) |
---|
2726 | |
---|
2727 | if wizard.RunWizard(page1): |
---|
2728 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2729 | for i in range(0,36): |
---|
2730 | FinalArgs[i] = '' |
---|
2731 | else: |
---|
2732 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2733 | for i in range(0,36): |
---|
2734 | FinalArgs[i] = '' |
---|
2735 | |
---|
2736 | #------------------------------Wizard Modules----------------------------- |
---|
2737 | def ReDeployWizard(self,evt): |
---|
2738 | wizard = wiz.Wizard(self, -1, 'ReDeployWizard', pos = (500,200)) |
---|
2739 | |
---|
2740 | page1 = SetAllClientsPage(wizard, '') |
---|
2741 | page2 = SelectClientsPage(wizard, '') |
---|
2742 | page3 = ReDeployPage(wizard, '') |
---|
2743 | page4 = FinalPage(wizard, '') |
---|
2744 | |
---|
2745 | self.page1 = page1 |
---|
2746 | wizard.SetPageSize((500,300)) |
---|
2747 | |
---|
2748 | page1.SetNext(page2) |
---|
2749 | page2.SetPrev(page1) |
---|
2750 | page2.SetNext(page3) |
---|
2751 | page3.SetPrev(page2) |
---|
2752 | page3.SetNext(page4) |
---|
2753 | |
---|
2754 | if wizard.RunWizard(page1): |
---|
2755 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2756 | for i in range(0,36): |
---|
2757 | FinalArgs[i] = '' |
---|
2758 | else: |
---|
2759 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2760 | for i in range(0,36): |
---|
2761 | FinalArgs[i] = '' |
---|
2762 | |
---|
2763 | #------------------------------Wizard Modules----------------------------- |
---|
2764 | def CleanDHCPLeaseWizard(self,evt): |
---|
2765 | wizard = wiz.Wizard(self, -1, 'CleanDHCPLeaseWizard', pos = (500,200)) |
---|
2766 | |
---|
2767 | page1 = SetAllClientsPage(wizard, '') |
---|
2768 | page2 = SelectClientsPage(wizard, '') |
---|
2769 | page3 = CleanDHCPLeasePage(wizard, '') |
---|
2770 | page4 = FinalPage(wizard, '') |
---|
2771 | |
---|
2772 | self.page1 = page1 |
---|
2773 | wizard.SetPageSize((500,300)) |
---|
2774 | |
---|
2775 | page1.SetNext(page2) |
---|
2776 | page2.SetPrev(page1) |
---|
2777 | page2.SetNext(page3) |
---|
2778 | page3.SetPrev(page2) |
---|
2779 | page3.SetNext(page4) |
---|
2780 | |
---|
2781 | if wizard.RunWizard(page1): |
---|
2782 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2783 | for i in range(0,36): |
---|
2784 | FinalArgs[i] = '' |
---|
2785 | else: |
---|
2786 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2787 | for i in range(0,36): |
---|
2788 | FinalArgs[i] = '' |
---|
2789 | |
---|
2790 | #------------------------------Wizard Modules----------------------------- |
---|
2791 | def Regenerate3NWizard(self,evt): |
---|
2792 | wizard = wiz.Wizard(self, -1, 'Regenerate3NWizard', pos = (500,200)) |
---|
2793 | |
---|
2794 | page1 = SetAllClientsPage(wizard, '') |
---|
2795 | page2 = SelectClientsPage(wizard, '') |
---|
2796 | page3 = Regenerate3NPage(wizard, '') |
---|
2797 | page4 = FinalPage(wizard, '') |
---|
2798 | |
---|
2799 | self.page1 = page1 |
---|
2800 | wizard.SetPageSize((500,300)) |
---|
2801 | |
---|
2802 | page1.SetNext(page2) |
---|
2803 | page2.SetPrev(page1) |
---|
2804 | page2.SetNext(page3) |
---|
2805 | page3.SetPrev(page2) |
---|
2806 | page3.SetNext(page4) |
---|
2807 | |
---|
2808 | if wizard.RunWizard(page1): |
---|
2809 | wx.MessageBox(_('success'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2810 | for i in range(0,36): |
---|
2811 | FinalArgs[i] = '' |
---|
2812 | else: |
---|
2813 | wx.MessageBox(_('cancel'), "That's all folks!", wx.CENTRE | wx.NO_DEFAULT, self) |
---|
2814 | for i in range(0,36): |
---|
2815 | FinalArgs[i] = '' |
---|
2816 | |
---|
2817 | #------------------------------------------------------------------------ |
---|
2818 | if __name__ == '__main__': |
---|
2819 | app = wx.PySimpleApp() |
---|
2820 | frame = MainFrame(parent=None, id=-1) |
---|
2821 | frame.Show() |
---|
2822 | app.MainLoop() |
---|
2823 | |
---|