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