diff --git a/dialog/di_dialog.py b/dialog/di_dialog.py index 4632913..1d35dfc 100644 --- a/dialog/di_dialog.py +++ b/dialog/di_dialog.py @@ -234,18 +234,16 @@ class MountPoint(Dialog): return n def set_data(self): - ret = ri_data.Partition.check_partitions() - if ret != 0: - Dialog.message("Sorry, your hard disk has no partitions, \ - \nplease partition you hard disk first!") - sys.exit(1) - ri_data.MountPoint.init_from_internal() while True: list=[] keys=ri_data.MountPoint.dict.keys() keys.sort() + if len(list) == 0: + Dialog.message("Sorry, your hard disk has no partitions,Please partition your disk first!!") + sys.exit(1) + for d in keys: list.append((ri_data.MountPoint.dict[d].device, ri_data.MountPoint.dict[d].directory.ljust(10)+ diff --git a/interface/ri_data.py b/interface/ri_data.py index e8c0117..6e3a292 100644 --- a/interface/ri_data.py +++ b/interface/ri_data.py @@ -54,7 +54,7 @@ class Partition: @staticmethod def check_partitions(): - cmd = "grep d[a-z][0-9] /proc/partitions>/dev/null" + cmd = "grep [a-zA-Z][0-9] /proc/partitions>/dev/null" ret = os.system(cmd) return ret diff --git a/interface/ri_tk_cmd.py b/interface/ri_tk_cmd.py index e3cbdce..552a519 100644 --- a/interface/ri_tk_cmd.py +++ b/interface/ri_tk_cmd.py @@ -1,14 +1,11 @@ #!/usr/bin/python -# -*- coding: utf-8 -*- ''' handle gui commands ''' import ri_tk as display -import tkMessageBox import ri_widget import ri_data import ri_dep import ri_func_dep import ri_oper -from ri_oper import language import re import copy import sys @@ -35,10 +32,7 @@ def mount_list_init(): display.var_dict['mount.list'].set(value=tuple([str(i) for i in l])) ''' if disk has no partition, do this ''' ret = ri_data.Partition.check_partitions() - if ret != 0: - tkMessageBox.showerror(title='Linx', message="%s"%( language == 'chinese' and u"对不起,\ - 您的硬盘还没有分区,请先对硬盘分区后再进行安装操作!" or \ - "Sorry, You have not patition your hard disk, please partition at first!")) + if ret != 0 and not ri_widget.MessageBox.dict["check_partitions"].show(): sys.exit(1) def mount_quit(): diff --git a/xml/interface.xml b/xml/interface.xml index 421b156..2436ac5 100644 --- a/xml/interface.xml +++ b/xml/interface.xml @@ -796,6 +796,7 @@ row 4 | | + @@ -889,6 +890,10 @@ row 4 | | + + Sorry, Your hard disk have no partition, \nYou may not perform the following operations!\nContinue or not? + 对不起,您的硬盘还没有分区,可能无法进行下面的操作!继续(Y)/返回(N)? + Special platform to set a special mount point, please refer to the left of the help documentation