modified: ri_tk_cmd.py

modified:   ../xml/interface.xml
    add message box for specal mount point
This commit is contained in:
fling
2010-11-08 16:00:15 +08:00
parent 63684486ad
commit a4458f76c3
2 changed files with 28 additions and 1 deletions

View File

@@ -66,6 +66,7 @@ def mp_top_ok():
''' mount dir top window OK '''
l = []
isdir_in_mp = False
isspecial_dir = False
for itm in eval(display.var_dict['mount.list'].get()):
dev = itm.split()[0]
dev2 = display.var_dict['mp_top_dev'].get()
@@ -84,10 +85,22 @@ 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
elif dr == '/' and dev[:2] == 'md' and not ri_data.MountPoint.dict.has_key('/boot'):
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
@@ -99,6 +112,8 @@ def mp_top_ok():
ri_widget.TopWindow.dict['mount_list_modify'].hide()
if isdir_in_mp:
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 '''

View File

@@ -729,6 +729,7 @@ 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
________________________________________________
@@ -861,7 +862,12 @@ row 4 | |
<English>The mount point has been used</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>
@@ -904,10 +910,16 @@ row 4 | |
<English>
There are five columns in the mount point display frame. The first column lists the hard disk partitions, such as sdaX, mdx. The second lists the mount points. The third lists the file system type of the partitions. The fourth lists the choices whether to format the partitions, "yes" means do , "no" means don't . The fifth lists the sizes of the partitions or the raid devices.
Click one row to change configurations of the hard disk partition, including the mount point, whether to format the partition, the file system type, etc.
Note: 1、some of mount point is not hanging out, E.g: /etc、/bin、/sbin、/lib.
2、some of mount point is not mounting on reiserfs and xfs filesystem, E.g: /, /boot
3、when "/" hanging on Raid device, "/boot" must be hang out.
</English>
<Chinese>
设置挂载点显示框中分为五列第一列是硬盘分区如sdaX、mdX。第二列是挂载点是挂载硬盘分区时所在的目录。第三列是硬盘分区的文件系统类型。第四列是指是否要格式化该硬盘分区no表示不格式化,yes表示要格式化。第五列是各硬盘分区或raid设备的大小。
点击该行可以改变该行的属性配置,包括:挂载点目录、是否格式化硬盘分区、文件系统类型。
注意1、有些挂载点不能单挂出去例如/etc,/bin,/sbin,/lib。
2、有些挂载点不能挂在reiserfs、xfs文件系统例如/,/boot。
3、当"/"挂载在raid设备时"/boot"挂载点必须单挂出来。
</Chinese>
</text>