modified: di_dialog.py

This commit is contained in:
fling
2011-09-22 13:39:46 +08:00
parent 64e1c7660b
commit 7bb9f730c6

View File

@@ -37,7 +37,7 @@ class Welcome(Dialog):
return s
class SerialNumber(Dialog):
def __init__(self,height=10, width=30,text='plase input a serial number'):
def __init__(self,height=10, width=30,text='please input a serial number'):
Dialog.__init__(self,name='serialnumber')
self.text=text
self.height=height
@@ -80,7 +80,7 @@ class Raid(Dialog):
if not list:
return 0
s,actives=Dialog.dialog.checklist(text='Plase select the active fd',height=self.height,width=self.width,choices=list,title='choices active fd',clear=1)
s,actives=Dialog.dialog.checklist(text='Please select the active fd',height=self.height,width=self.width,choices=list,title='choices active fd',clear=1)
if s == 0 :
if int(level) < 2 and len(actives) < 2 :
Dialog.message('Making a raid0 or raid1 needs two or more partitions.')
@@ -104,7 +104,7 @@ class Raid(Dialog):
list=self.raid_raw_map()
if not list:
return 0
s,spares=Dialog.dialog.checklist(text='Plase select the spare fd',height=self.height,width=self.width,choices=list,title='choices spare fd',clear=1)
s,spares=Dialog.dialog.checklist(text='Please select the spare fd',height=self.height,width=self.width,choices=list,title='choices spare fd',clear=1)
if s == 0 :
#(dev, from_os, level, a_devs, s_devs=[]):
if dname not in ri_data.Raid.dict.keys():
@@ -126,7 +126,7 @@ class Raid(Dialog):
# fd
fd_devices_text='fd: '+','.join(fd_devices)
exit_info,raid=Dialog.dialog.menu(text='Plase select make raidX\n%s\n%s'%(raid_text,fd_devices_text),
exit_info,raid=Dialog.dialog.menu(text='Please select make raidX\n%s\n%s'%(raid_text,fd_devices_text),
height=self.height,width=self.width,menu_height=3,choices=[('Raid0',''),('Raid1',''),('Raid5','')],
title='Make a raid',ok_label='edit',help_button=1,help_label='Next',clear=1)
@@ -146,7 +146,7 @@ class Raid(Dialog):
raid_text+='%s (%s):\n active %s; spare %s\n'%(R.device,R.from_os,R.active_components,R.spare_components)
raid_choices.append((R.device,''))
exit_info,device=Dialog.dialog.menu(text='Plase select make raidX\n%s'%raid_text,
exit_info,device=Dialog.dialog.menu(text='Please select make raidX\n%s'%raid_text,
height=self.height,width=self.width,menu_height=2,choices=raid_choices,title='Configure raid',clear=1)
if exit_info == 0:
@@ -178,7 +178,7 @@ class Raid(Dialog):
for R in ri_data.Raid.dict.values():
raid_text+='%s (%s):\n active %s; spare %s\n'%(R.device,R.from_os,R.active_components,R.spare_components)
exit_info,string=Dialog.dialog.menu(text='Plase select make raidX\n%s\n%s'%(raid_text,fd_devices_text),
exit_info,string=Dialog.dialog.menu(text='Please select make raidX\n%s\n%s'%(raid_text,fd_devices_text),
height=self.height,width=self.width,menu_height=2,choices=list,title='Configure raid',
help_button=1,help_label='Next',clear=1)
@@ -193,7 +193,7 @@ class Raid(Dialog):
class MountPoint(Dialog):
fs=''
dict={}
def __init__(self,height=15,width=30,text='Please input the mounting point of your partition:'):
def __init__(self,height=15,width=30,text='Please select file system type'):
Dialog.__init__(self,name='mountpoint')
self.text=text
self.height=height
@@ -216,7 +216,7 @@ class MountPoint(Dialog):
return exit_info
def set_mountpoint(self,device):
code,string=Dialog.dialog.inputbox(text='Plase input mount point',height=10,width=30,init=ri_data.MountPoint.dict[device].directory,title='Mount point',clear=1)
code,string=Dialog.dialog.inputbox(text='Please input mount point',height=10,width=30,init=ri_data.MountPoint.dict[device].directory,title='Mount point',clear=1)
if code == 0:
ri_data.MountPoint.dict[device].directory=string
else:
@@ -225,7 +225,7 @@ class MountPoint(Dialog):
return code
def set_format(self,device):
n = Dialog.dialog.yesno(text='Format the devices',title='Format',clear=1)
n = Dialog.dialog.yesno(text='You want to fromat this partition?',title='Format',clear=1)
if n == 0 :
ri_data.MountPoint.dict[device].format='yes'
@@ -250,7 +250,7 @@ class MountPoint(Dialog):
ri_data.MountPoint.get_size(d)+
ri_data.Partition.unit))
exit_info,string=Dialog.dialog.menu(text="There are five columns in the mount point display frame.\n Device Directory Filesystem Format Size",
exit_info,string=Dialog.dialog.menu(text="There are five columns in the mount point display frame.\n Device Mountpoint Filesystem Format Size",
height=self.height,width=self.width,menu_height=(len(list) > self.height and self.helght - 2 or len(list) ),
choices=list,title='Mount',ok_label='edit',help_button=1,help_label='Next',clear=1)
if exit_info == 0 :
@@ -277,14 +277,14 @@ class Network(Dialog):
self.width=width
def set_network(self,string):
code,s=Dialog.dialog.inputbox(text='Plase input %s'%string,height=self.height,width=self.width,init=getattr(ri_data.Network,string),title=string,clear=1)
code,s=Dialog.dialog.inputbox(text='Please input %s'%string,height=self.height,width=self.width,init=getattr(ri_data.Network,string),title=string,clear=1)
if code == 0:
setattr(ri_data.Network,string,s)
return code
def set_data(self):
s,ri_data.Network.configuration=Dialog.dialog.menu(text='choice a network',height=self.height,width=self.width,
menu_height=3,choices=[('static','static ip address'),('dynamic','Dynamic IP address')],clear=1)
s,ri_data.Network.configuration=Dialog.dialog.menu(text='Select a network type',height=self.height,width=self.width,
menu_height=3,choices=[('static','static ip address'),('dynamic','Dynamic IP address')],title='Network',clear=1)
if s == 0 and ri_data.Network.configuration == 'static':
count=0
@@ -316,7 +316,7 @@ class Group(Dialog):
for l in ri_data.Group.dict[g].optional:
list.append((l[0],'',l[1] == 'yes' and 'on' or 'off'))
s,check_list=Dialog.dialog.checklist(text='Plase select the installation package',height=self.height,
s,check_list=Dialog.dialog.checklist(text='Please select the installation package',height=self.height,
width=self.width,choices=list,title='choices %s optional'%g,clear=1)
if s == 0 and check_list :
@@ -334,7 +334,7 @@ class Group(Dialog):
for g in ri_data.Group.dict.keys():
list.append((g,'',((ri_data.Group.dict[g].install == 'yes' or ri_data.Group.dict[g].install == 'mandatory') and 'on' or 'off')))
s,check_list=Dialog.dialog.checklist(text='Plase select the installation Group',height=self.height,width=self.width,
s,check_list=Dialog.dialog.checklist(text='Please select the installation Group',height=self.height,width=self.width,
list_height=(len(list) > self.height) and self.height - 2 or len(list),choices=list,default_item='check all',title='Package group',clear=1)
if s == 0 and check_list:
if check_list[0] == 'check all':
@@ -376,7 +376,7 @@ class Service(Dialog):
if s.start != 'disable':
list.append((s.name,'',s.start == 'yes' and 'on' or 'off'))
code,check_list=Dialog.dialog.checklist(text='Plase select start service',height=self.height,width=self.width,
code,check_list=Dialog.dialog.checklist(text='Please select start service',height=self.height,width=self.width,
list_height=len(list),default_item='check all',choices=list,title='Start service',clear=1)
if code == 0 and check_list:
if check_list[0] == 'check all':