remove mount_list quit function
modify network_init, add a default process in network configuration method
This commit is contained in:
@@ -60,17 +60,6 @@ def mount_list_init():
|
||||
l.append(s)
|
||||
display.var_dict['mount.list'].set(value=tuple([str(i) for i in l]))
|
||||
|
||||
def mount_list_quit():
|
||||
''' mount list quit function, write mount information into xml file '''
|
||||
s = display.var_dict['mount.list'].get()
|
||||
if not s: return
|
||||
tpl = eval(s)
|
||||
for i in range(len(tpl)):
|
||||
dev, dir, fs, fm, sz= tpl[i].split()
|
||||
ri_data.MountPoint.list[i].directory = dir
|
||||
ri_data.MountPoint.list[i].filesystem = fs
|
||||
ri_data.MountPoint.list[i].format = fm
|
||||
|
||||
def mount_list_modify(*args):
|
||||
''' modify an item in mount list '''
|
||||
tw = ri_widget.TopWindow.dict['mount_list_modify']
|
||||
@@ -82,11 +71,14 @@ def mp_top_init():
|
||||
idxs = ml_win.curselection()
|
||||
if len(idxs) == 1:
|
||||
idx = int(idxs[0])
|
||||
s = display.var_dict['mount.list'].get()
|
||||
if not s: return
|
||||
tpl = eval(s)
|
||||
dev, dir, fs, fm, sz = tpl[idx].split()
|
||||
mp = ri_data.MountPoint.list[idx]
|
||||
dev = mp.device
|
||||
dir = mp.directory
|
||||
fs = mp.filesystem
|
||||
fm = mp.format
|
||||
sz = mp.size
|
||||
display.var_dict['mp_top_dev'].set(value=dev)
|
||||
display.var_dict['mp_top_size'].set(value=sz)
|
||||
display.var_dict['mp_top_dir'].set(value=dir)
|
||||
if fm == 'yes':
|
||||
ri_widget.Widget.dict['mp_top_format'].tk_widget.select()
|
||||
@@ -102,17 +94,23 @@ def mp_top_ok():
|
||||
''' mount dir top window OK '''
|
||||
l = []
|
||||
for itm in eval(display.var_dict['mount.list'].get()):
|
||||
dev, dir, fs, fm, sz = itm.split()
|
||||
dev = itm.split()[0]
|
||||
dev2 = display.var_dict['mp_top_dev'].get()
|
||||
if dev == dev2:
|
||||
sz = display.var_dict['mp_top_size'].get()
|
||||
dir = display.var_dict['mp_top_dir'].get()
|
||||
fm = display.var_dict['mp_top_format'].get()
|
||||
idxs2 = ri_widget.Widget.dict['mp_top_fs'].tk_widget.curselection()
|
||||
idx2 = int(idxs2[0])
|
||||
fs = eval(display.var_dict['mp_top_fs'].get())[idx2]
|
||||
if len(idxs2):
|
||||
idx2 = int(idxs2[0])
|
||||
fs = eval(display.var_dict['mp_top_fs'].get())[idx2]
|
||||
else:
|
||||
fs = ''
|
||||
|
||||
s2 = dev.ljust(10) + dir.ljust(10) + fs.ljust(10) + fm.ljust(4) + sz.ljust(6)
|
||||
l.append(s2)
|
||||
# make change in internal data structure
|
||||
ri_data.MountPoint.change(dev2, dir, fs, fm)
|
||||
else:
|
||||
l.append(itm)
|
||||
|
||||
@@ -127,7 +125,7 @@ def mp_top_cancel():
|
||||
def network_init():
|
||||
''' network initialize '''
|
||||
display.var_dict['network_host_name']. set(value=ri_data.Network.hostname)
|
||||
ri_widget.Widget.dict['network_config_%s' %(ri_data.Network.configuration,)].tk_widget.invoke()
|
||||
ri_widget.Widget.dict['network_config_%s' %(ri_data.Network.configuration and ri_data.Network.configuration or 'static')].tk_widget.invoke()
|
||||
display.var_dict['network_domain_name']. set(value=ri_data.Network.domain)
|
||||
display.var_dict['network_ip']. set(value=ri_data.Network.ip)
|
||||
display.var_dict['network_subnet_mask']. set(value=ri_data.Network.mask)
|
||||
|
||||
@@ -211,8 +211,17 @@ class MountPoint:
|
||||
self.directory = dir
|
||||
self.filesystem = fs
|
||||
self.format = fm
|
||||
self.size = Partition.get_size(dev)
|
||||
MountPoint.list.append(self)
|
||||
|
||||
@staticmethod
|
||||
def change(dev, dir, fs, fm):
|
||||
for i in range(len(MountPoint.list)):
|
||||
if MountPoint.list[i].device == dev:
|
||||
MountPoint.list[i].directory = dir
|
||||
MountPoint.list[i].filesystem = fs
|
||||
MountPoint.list[i].format = fm
|
||||
|
||||
@staticmethod
|
||||
def init_from_internal():
|
||||
''' init MountPoint from internal class Partition and class Raid '''
|
||||
|
||||
@@ -35,8 +35,8 @@ else:
|
||||
|
||||
xmldoc = minidom.parse(itf_xml)
|
||||
ri_data.install_xml = ins_xml
|
||||
#ri_data.init_from_xml()
|
||||
ri_data.init()
|
||||
ri_data.init_from_xml()
|
||||
#ri_data.init()
|
||||
|
||||
ri_widget.construct(xmldoc.firstChild)
|
||||
ri_seq.construct(xmldoc.firstChild)
|
||||
|
||||
@@ -13,21 +13,21 @@
|
||||
<partition device='sdb4' start='0' id='0' size='0'/>
|
||||
</partitions>
|
||||
<raids>
|
||||
<raid raid-type='raid1' raid-device='md0'>
|
||||
<raid raid-type='raid1' raid-size='-1' raid-device='md0'>
|
||||
<raw-device>sda1</raw-device>
|
||||
<raw-device>sdb1</raw-device>
|
||||
</raid>
|
||||
</raids>
|
||||
<mount-points>
|
||||
<mount-point device='sda2' directory='' file-system='' format='no'/>
|
||||
<mount-point device='sda3' directory='' file-system='' format='no'/>
|
||||
<mount-point device='sda4' directory='' file-system='' format='no'/>
|
||||
<mount-point device='sda3' directory='' file-system='ext3' format='no'/>
|
||||
<mount-point device='sda4' directory='/' file-system='ext2' format='no'/>
|
||||
<mount-point device='sdb2' directory='' file-system='' format='no'/>
|
||||
<mount-point device='sdb3' directory='' file-system='' format='no'/>
|
||||
<mount-point device='sdb4' directory='' file-system='' format='no'/>
|
||||
<mount-point device='md0' directory='' file-system='' format='no'/>
|
||||
<mount-point device='md0' directory='/opt' file-system='reiserfs' format='yes'/>
|
||||
</mount-points>
|
||||
<network domain='' secondary_dns='' ip='' hostname='' mask='' primary_dns='' configuration='' gateway=''/>
|
||||
<network domain='' secondary_dns='' ip='' hostname='lizhi' mask='' primary_dns='' configuration='dynamic' gateway=''/>
|
||||
<groups>
|
||||
<group name='development' install='no'>
|
||||
<description>
|
||||
|
||||
@@ -22,7 +22,7 @@ row 4 | quit previous next |
|
||||
|
||||
<variable name='main.step_name' type='StringVar' />
|
||||
<widget type='Label'>
|
||||
<widget_attribute image='/home/zhi/git/install/graphicalinstall/images/linxlogo.gif'/>
|
||||
<widget_attribute image='/home/zhi/work/linx/install/graphicalinstall/images/linxlogo.gif'/>
|
||||
<grid_location row='0' column='0' sticky='W' padx='5' pady='5'/>
|
||||
</widget>
|
||||
<widget type='Label'>
|
||||
@@ -255,7 +255,7 @@ row 4 | |
|
||||
<widget_attribute width='40' height='15' listvariable='mount.list'/>
|
||||
<grid_location row='0' column='0'/>
|
||||
<variable name='mount.list' type='StringVar'/>
|
||||
<action init='mount_list_init' quit='mount_list_quit'/>
|
||||
<action init='mount_list_init'/>
|
||||
<binding sequence='ListboxSelect' function='mount_list_modify' wrap='double'/>
|
||||
</widget>
|
||||
|
||||
@@ -433,17 +433,18 @@ row 4 | |
|
||||
column 0 column 1
|
||||
________________________________________________
|
||||
row 0 | Device /dev/xxx |
|
||||
row 1 | Size xxx |
|
||||
| _____________ |
|
||||
row 1 | Directory |_____________| |
|
||||
row 2 | Directory |_____________| |
|
||||
| _ _ |
|
||||
row 2 | |_| Format |_| Not-Format |
|
||||
row 3 | |_| Format |_| Not-Format |
|
||||
| ___________________ |
|
||||
row 3 | | | |
|
||||
row 4 | | | |
|
||||
| filesystem | | |
|
||||
| | | |
|
||||
| |___________________| |
|
||||
| |
|
||||
row 4 | OK Cancel |
|
||||
row 5 | OK Cancel |
|
||||
|________________________________________________|
|
||||
-->
|
||||
<top_window name='mount_list_modify'>
|
||||
@@ -456,6 +457,7 @@ row 4 | |
|
||||
<grid_location row='0' column='0'/>
|
||||
<variable name='mp_top_format' type='StringVar'/>
|
||||
<action init='mp_top_init'/>
|
||||
|
||||
<widget type='Label'>
|
||||
<widget_attribute text='Device'/>
|
||||
<grid_location row='0' column='0' padx='10' sticky='W'/>
|
||||
@@ -465,39 +467,53 @@ row 4 | |
|
||||
<grid_location row='0' column='1' sticky='W'/>
|
||||
<variable name='mp_top_dev' type='StringVar'/>
|
||||
</widget>
|
||||
|
||||
<widget type='Label'>
|
||||
<widget_attribute text='Size'/>
|
||||
<grid_location row='1' column='0' padx='10' sticky='W'/>
|
||||
</widget>
|
||||
<widget type='Label'>
|
||||
<widget_attribute textvariable='mp_top_size'/>
|
||||
<grid_location row='1' column='1' sticky='W'/>
|
||||
<variable name='mp_top_size' type='StringVar'/>
|
||||
</widget>
|
||||
|
||||
<widget type='Label'>
|
||||
<widget_attribute text='Directory'/>
|
||||
<grid_location row='1' column='0' padx='10' sticky='W'/>
|
||||
<grid_location row='2' column='0' padx='10' sticky='W'/>
|
||||
</widget>
|
||||
<widget type='Entry'>
|
||||
<widget_attribute width='10' textvariable='mp_top_dir'/>
|
||||
<grid_location row='1' column='1' sticky='W'/>
|
||||
<grid_location row='2' column='1' sticky='W'/>
|
||||
<variable name='mp_top_dir' type='StringVar'/>
|
||||
</widget>
|
||||
|
||||
<widget type='Radiobutton' name='mp_top_format'>
|
||||
<widget_attribute text='Format' variable='mp_top_format' value='yes'/>
|
||||
<grid_location row='2' column='0'/>
|
||||
<grid_location row='3' column='0'/>
|
||||
</widget>
|
||||
<widget type='Radiobutton' name='mp_top_not_format'>
|
||||
<widget_attribute text='Not-Format' variable='mp_top_format' value='no'/>
|
||||
<grid_location row='2' column='1'/>
|
||||
<grid_location row='3' column='1'/>
|
||||
</widget>
|
||||
|
||||
<widget type='Label'>
|
||||
<widget_attribute text='Filesystem'/>
|
||||
<grid_location row='3' column='0' sticky='W'/>
|
||||
<grid_location row='4' column='0' sticky='W'/>
|
||||
</widget>
|
||||
<widget type='Listbox' name='mp_top_fs'>
|
||||
<widget_attribute listvariable='mp_top_fs'/>
|
||||
<grid_location row='3' column='1' sticky='W'/>
|
||||
<grid_location row='4' column='1' sticky='W'/>
|
||||
<variable name='mp_top_fs' type='StringVar' value='ext2 ext3 reiserfs xfs jfs'/>
|
||||
</widget>
|
||||
|
||||
<widget type='Button'>
|
||||
<widget_attribute text='OK' command='mp_top_ok'/>
|
||||
<grid_location row='4' column='0'/>
|
||||
<grid_location row='5' column='0'/>
|
||||
</widget>
|
||||
<widget type='Button'>
|
||||
<widget_attribute text='Cancel' command='mp_top_cancel'/>
|
||||
<grid_location row='4' column='1'/>
|
||||
<grid_location row='5' column='1'/>
|
||||
</widget>
|
||||
</widget>
|
||||
</top_window>
|
||||
|
||||
Reference in New Issue
Block a user