modified: ri_data.py
modified: ri_tk_cmd.py
modified: ../xml/interface.xml
updata add message box for specal mount point
This commit is contained in:
@@ -407,6 +407,21 @@ p_node - xml node (parent node)'''
|
||||
return Partition.get_size(dev)
|
||||
elif dev in Raid.dict.keys():
|
||||
return Raid.get_size(dev)
|
||||
|
||||
@staticmethod
|
||||
def is_check_data(dev,dr,fs):
|
||||
'''check mount point is feasible. dr is mount point, dev is device'''
|
||||
# check mount point is existent or not
|
||||
if dr and dr in [ m.directory for m in MountPoint.dict.values() if m.device !=dev ]:
|
||||
return False
|
||||
|
||||
# check mount point is special or not
|
||||
if dr in ['/etc','/bin','/sbin','/lib']:
|
||||
return False
|
||||
elif dr in ['/','/boot'] and fs in ['reiserfs','xfs']:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
class Network:
|
||||
''' network '''
|
||||
|
||||
@@ -62,11 +62,11 @@ def mp_top_init():
|
||||
if fs == fs_values[i]:
|
||||
ri_widget.Widget.dict['mp_top_fs'].tk_widget.selection_set(i)
|
||||
|
||||
|
||||
def mp_top_ok():
|
||||
''' mount dir top window OK '''
|
||||
l = []
|
||||
isdir_in_mp = False
|
||||
isspecial_dir = False
|
||||
isdir_feasible = True
|
||||
for itm in eval(display.var_dict['mount.list'].get()):
|
||||
dev = itm.split()[0]
|
||||
dev2 = display.var_dict['mp_top_dev'].get()
|
||||
@@ -85,37 +85,25 @@ def mp_top_ok():
|
||||
else:
|
||||
fs = ' '
|
||||
|
||||
# check mount point is existent or not
|
||||
if dr and dr in [ m.directory for m in ri_data.MountPoint.dict.values() if m.device != dev ]:
|
||||
isdir_in_mp = True
|
||||
dr = ri_data.MountPoint.dict[dev].directory
|
||||
|
||||
# check mount point is special or not
|
||||
if dr in ['/etc','/bin','/sbin','/lib']:
|
||||
isspecial_dir = True
|
||||
dr = ri_data.MountPoint.dict[dev].directory
|
||||
elif dr in ['/','/boot'] and fs in ['reiserfs','xfs']:
|
||||
isspecial_dir = True
|
||||
dr = ri_data.MountPoint.dict[dev].directory
|
||||
|
||||
s2 = dev.ljust(10) + dr.ljust(10) + fs.ljust(10) + fm.ljust(4) + sz.ljust(6) + ri_data.Partition.unit
|
||||
l.append(s2)
|
||||
# make change in internal data structure
|
||||
ri_data.MountPoint.change(dev, dr, fs, fm)
|
||||
# check mount point is feasible
|
||||
if ri_data.MountPoint.is_check_data(dev,dr,fs):
|
||||
s2 = dev.ljust(10) + dr.ljust(10) + fs.ljust(10) + fm.ljust(4) + sz.ljust(6) + ri_data.Partition.unit
|
||||
ri_data.MountPoint.change(dev, dr, fs, fm)
|
||||
l.append(s2)
|
||||
else:
|
||||
isdir_feasible=False
|
||||
l.append(itm)
|
||||
else:
|
||||
l.append(itm)
|
||||
|
||||
display.var_dict['mount.list'].set(value=tuple(l))
|
||||
ri_widget.TopWindow.dict['mount_list_modify'].hide()
|
||||
if isdir_in_mp:
|
||||
if not isdir_feasible:
|
||||
ri_widget.MessageBox.dict['check_mount_point'].show()
|
||||
if isspecial_dir:
|
||||
ri_widget.MessageBox.dict['check_special_mount_point'].show()
|
||||
|
||||
def mp_top_cancel():
|
||||
''' mount dir top window cancel '''
|
||||
ri_widget.TopWindow.dict['mount_list_modify'].hide()
|
||||
pass
|
||||
|
||||
def network_init():
|
||||
''' network initialize '''
|
||||
|
||||
@@ -729,7 +729,6 @@ row 4 | |
|
||||
<message_box name='raid_add_active_numbers' type='showwarning' title='number' message='#raid-add-active-numbers'/>
|
||||
<message_box name='raid_add_active_numbers_2' type='showwarning' title='number' message='#raid-add-active-numbers-2'/>
|
||||
<message_box name='check_mount_point' type='showwarning' title='checking' message='#check-mount-point'/>
|
||||
<message_box name='check_special_mount_point' type='showwarning' title='special' message='#check-special-mount-point'/>
|
||||
<!--
|
||||
column 0 column 1
|
||||
________________________________________________
|
||||
@@ -859,15 +858,10 @@ row 4 | |
|
||||
</widget>
|
||||
|
||||
<text key='#check-mount-point'>
|
||||
<English>The mount point has been used</English>
|
||||
<Chinese>挂载点已经被使用</Chinese>
|
||||
<English>The mount point has been used or the mount point is special, dosen't mount it, plase look help information!</English>
|
||||
<Chinese>挂载点已经被使用或者这个是一个特殊的挂载点, 不能这样挂载, 请看帮助文档</Chinese>
|
||||
</text>
|
||||
|
||||
<text key='#check-special-mount-point'>
|
||||
<English>The mount point is special, dosen't mount it, plase look help information</English>
|
||||
<Chinese>这是一个特殊的挂载点,不能这样挂载,请看帮肋文档</Chinese>
|
||||
</text>
|
||||
|
||||
<text key='#Copyright'>
|
||||
<English>Copyright 2001-2010 Linx Technology Co., Ltd.</English>
|
||||
<Chinese>北京凝思科技有限公司 版权所有</Chinese>
|
||||
|
||||
Reference in New Issue
Block a user