From 258f9dc69f86dc2804a670f52c5849df6131494a Mon Sep 17 00:00:00 2001 From: fling Date: Mon, 15 Nov 2010 12:18:06 +0800 Subject: [PATCH] modified: interface/ri_data.py modified: interface/ri_func_dep.py modified: interface/ri_inst_cli.py modified: interface/ri_inst_tk.py modified: interface/ri_oper.py modified: xml/interface.xml make tab equal 4 spaces --- interface/ri_data.py | 4 +- interface/ri_func_dep.py | 124 ++++--- interface/ri_inst_cli.py | 13 +- interface/ri_inst_tk.py | 8 +- interface/ri_oper.py | 14 +- xml/interface.xml | 675 ++++++++++++++++++++------------------- 6 files changed, 432 insertions(+), 406 deletions(-) diff --git a/interface/ri_data.py b/interface/ri_data.py index f8933bd..ac7e88c 100644 --- a/interface/ri_data.py +++ b/interface/ri_data.py @@ -296,7 +296,7 @@ p_node - xml node (parent node) ''' raids.appendChild(rd) p_node.appendChild(raids) - #ri_tk_cmd.py use + #ri_tk_cmd.py use @staticmethod def get_size(dev): ''' calculate raid device size ''' @@ -341,7 +341,7 @@ class MountPoint: mp.directory = dir mp.filesystem = fs mp.format = fm - + @staticmethod def init_from_internal(): ''' init MountPoint from internal class Partition and class Raid ''' diff --git a/interface/ri_func_dep.py b/interface/ri_func_dep.py index e2dd76c..d578df0 100644 --- a/interface/ri_func_dep.py +++ b/interface/ri_func_dep.py @@ -3,91 +3,89 @@ import ri_data class Pkg(): - list = [] + list = [] - @staticmethod - def set_list (): - list = ri_data.Group.get_install_pkgs() + @staticmethod + def set_list (): + list = ri_data.Group.get_install_pkgs() class FsType(): - list = [] + list = [] - @staticmethod - def set_list (): - for fs in ri_data.MountPoint.dict.values(): - FsType.list.append(fs.filesystem) + @staticmethod + def set_list (): + for fs in ri_data.MountPoint.dict.values(): + FsType.list.append(fs.filesystem) class FunctionDepending(): - list = [] - def __init__(self, pkg): - self.package = pkg - FunctionDepending.list.append(self) - - def check(self): - return False + list = [] + def __init__(self, pkg): + self.package = pkg + FunctionDepending.list.append(self) - def error(self): - return {} + def check(self): + return False + def error(self): + return {} class FileSystem(FunctionDepending): - list = [] - def __init__(self, fs_type, fs_pkg): - self.filesystem_type = fs_type - FunctionDepending.__init__(self, fs_pkg) + list = [] + def __init__(self, fs_type, fs_pkg): + self.filesystem_type = fs_type + FunctionDepending.__init__(self, fs_pkg) - def check(self): - if self.filesystem_type in FsType.list and self.package not in Pkg.list: - return False - return True - - def error(self): - mesg="format filesystem " + self.filesystem_type - return {mesg:self.package} + def check(self): + if self.filesystem_type in FsType.list and self.package not in Pkg.list: + return False + return True + +def error(self): + mesg="format filesystem " + self.filesystem_type + return {mesg:self.package} class DHCP(FunctionDepending): - def __init__(self): - FunctionDepending.__init__(self, 'dhcpcd') + def __init__(self): + FunctionDepending.__init__(self, 'dhcpcd') - def check(self): - if ri_data.Network.configuration == 'dynamic' and 'dhcpcd' not in Pkg.list: - return False - return True + def check(self): + if ri_data.Network.configuration == 'dynamic' and 'dhcpcd' not in Pkg.list: + return False + return True - def error(self): - return {"dynamic configure network":"dhcpcd"} + def error(self): + return {"dynamic configure network":"dhcpcd"} class RAID(FunctionDepending): - def __init__(self): - FunctionDepending.__init__(self, 'mdadm') - - def check(self): - if 'mdadm' not in Pkg.list: - for i in ri_data.Raid.dict.values(): - if i.from_os == 'no': - return False - return True + def __init__(self): + FunctionDepending.__init__(self, 'mdadm') + + def check(self): + if 'mdadm' not in Pkg.list: + for i in ri_data.Raid.dict.values(): + if i.from_os == 'no': + return False + return True - def error(self): - return {"make raid":"mdadm"} + def error(self): + return {"make raid":"mdadm"} def check_function_depending(): + Pkg.set_list() + FsType.set_list() + func_dep_dict = {} - Pkg.set_list() - FsType.set_list() - func_dep_dict = {} + FileSystem("xfs", "xfsprogs") + FileSystem("jfs", "jfsutils") - FileSystem("xfs", "xfsprogs") - FileSystem("jfs", "jfsutils") + DHCP() + RAID() - DHCP() - RAID() - - for i in FunctionDepending.list: - # if function depending package not in package list - if not i.check(): - tmp = i.error() - func_dep_dict.update(tmp) - return func_dep_dict + for i in FunctionDepending.list: + # if function depending package not in package list + if not i.check(): + tmp = i.error() + func_dep_dict.update(tmp) + return func_dep_dict diff --git a/interface/ri_inst_cli.py b/interface/ri_inst_cli.py index 54ee079..b47a71d 100644 --- a/interface/ri_inst_cli.py +++ b/interface/ri_inst_cli.py @@ -27,17 +27,16 @@ def set_task_scale(): print "%.2f" %float(Rate.value) def set_task_over(): - string = raw_input("Rocky system installation successfully, are your restart?[Y]") - if string.lower() == "y": - return True - return False + string = raw_input("Rocky system installation successfully, are your restart?[Y]") + if string.lower() == "y": + return True + return False def root_destroy(): - pass + pass def error(oper, ret): - print "%s:\n Error number: %d\n %s"%(oper.english_name, ret, oper.return_value[ret][0]) - + print "%s:\n Error number: %d\n %s"%(oper.english_name, ret, oper.return_value[ret][0]) def start(func): func() diff --git a/interface/ri_inst_tk.py b/interface/ri_inst_tk.py index e436704..652bd00 100644 --- a/interface/ri_inst_tk.py +++ b/interface/ri_inst_tk.py @@ -1,6 +1,6 @@ #!/usr/bin/python #coding: utf-8 -# DESCRIPTION: display module for install (tk) +# DESCRIPTION: display module for install (tk) # # SCRIPT NAME: ri_inst_tk.py # @@ -63,8 +63,8 @@ stringvar_bar=StringVar() #label lab_task=Label(root,text='%s:'%(language=="chinese" and u"任务" or "Task")) -lab_progress_bar=Label(root,text='%s:'%(language=="chinese" and u"进度" \ - or 'Progress bar')) +lab_progress_bar=Label(root,text='%s:'%(language=="chinese" and u"进度"\ + or 'Progress bar')) lab_operation=Label(root,text="") lab_linx=Label(root,text="Linx") @@ -79,7 +79,7 @@ lab_linx.grid (row=4, column=1) #logo photo_bm = PhotoImage(file="%s/../data/linxlogo.gif"\ - %os.path.split(os.path.realpath(__file__))[0]) + %os.path.split(os.path.realpath(__file__))[0]) logo_label=Label(root,image=photo_bm) logo_label.grid(row=0,column=0,padx=50, pady=50, sticky='NW') diff --git a/interface/ri_oper.py b/interface/ri_oper.py index f3b8a02..ab6b460 100644 --- a/interface/ri_oper.py +++ b/interface/ri_oper.py @@ -160,7 +160,7 @@ class Mount(Operation): # dict saved only device and mount point dict={} def __init__(self,scr): - Operation.__init__(self, 'Mount partition', u'挂载分区', 'mount_partition.sh',scr) + Operation.__init__(self,'Mount partition', u'挂载分区', 'mount_partition.sh',scr) def get_stdin(self): mount='' @@ -215,12 +215,12 @@ class GenerateIssue(Operation): def __init__(self,scr): Operation.__init__(self,'Generate /etc/issue',u'生成/etc/issue文件','generate_issue.sh',scr) - def get_arguments(self): + def get_arguments(self): args=[] # FIXME if tag file format is error? if os.path.isfile("/tag"): - fd=open("/tag","r") - string = fd.read() + fd=open("/tag","r") + string = fd.read() list = string.split('\n')[0].split('-') args = ['-v']+[list[0][5:]]+["-a"]+[list[1]]+["-r"]+[list[2]]+['-d']+['-'.join(list[3:])] fd.close() @@ -256,11 +256,11 @@ class ConfigureNetwork(Operation): network+="-s %s "%data.secondary_dns else: network+="-t dynamic " - if data.hostname is not '': + if data.hostname: network+="-h %s "%data.hostname return [network] -class MakeServiceAutoBoot(Operation): +class MakeServiceAutoBoot(Operation): """class for make service autoboot""" def __init__(self,scr): Operation.__init__(self,"Make service autoboot",u"启动服务器","mk_serv_autoboot.sh",scr) @@ -319,7 +319,7 @@ class ConfigureBootloader(Operation): string = fd.read() list = string.split('-') fd.close() - + bootloader=['-t',tp,'-o',list[0][5:].split('.')[0]+'.'+list[0][5:].split('.')[1],'-k','vga=791 linx_serial=%s' %ri_data.SerialNumber.value.strip()] for k in Mount.dict.keys(): diff --git a/xml/interface.xml b/xml/interface.xml index 1d4a001..83e384f 100644 --- a/xml/interface.xml +++ b/xml/interface.xml @@ -28,10 +28,12 @@ row 4 | quit previous next | + + @@ -42,7 +44,7 @@ row 4 | quit previous next | - + @@ -56,15 +58,16 @@ row 4 | quit previous next | + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -642,18 +669,19 @@ row 4 | | + - - - + + + - - + + @@ -759,63 +787,64 @@ row 4 | | - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + + - + @@ -857,22 +886,21 @@ row 4 | | - - The mount point couldn't be mounted on because it has been used or it's particular. Plase read help infomation! - 挂载点已经被使用或者这个是一个特殊的挂载点, 不能这样挂载, 请看帮助文档 - + + The mount point couldn't be mounted on because it has been used or it's particular. Plase read help infomation! + 挂载点已经被使用或者这个是一个特殊的挂载点, 不能这样挂载, 请看帮助文档 + - - Copyright 2001-2010 Linx Technology Co., Ltd. - 北京凝思科技有限公司 版权所有 - + + Copyright 2001-2010 Linx Technology Co., Ltd. + 北京凝思科技有限公司 版权所有 + There are two kinds of dependent relationships. Dependent Functions and Dependent Packages. Dependent Functions :To provide systems function of packages. the left column is the systematic functions, the right column provides function of packages. Dependent Packages : Current selection of the dependent packages on the missing package. The software package in the left column is depended by the software packages in the right column. - 依赖关系分为两部分:功能依赖和软件包依赖。 @@ -917,7 +945,7 @@ row 4 | | - + Hostname is used to identify computers. It could identify a specific computer system in various forms of electronic transmissions. The installation program offers two ways to set an IP address of the host. One is automatically configuration (DHCP) and the other is manually configuration. @@ -934,7 +962,7 @@ row 4 | | 域名:表示一个单位、机构或个人在Internet上有一个确定的名称或位置。 IP地址、子网掩码、网关、首选DNS、备用DNS:输入四个0~255的数字,用点隔开,如192.168.1.1 - + Network Configuration Management: @@ -947,13 +975,13 @@ row 4 | | - Making a raid0 or raid1 needs two or more partitions. - 当制作raid0或raid1时,硬盘分区必须两个或两个以上。 + Making a raid0 or raid1 needs two or more partitions. + 当制作raid0或raid1时,硬盘分区必须两个或两个以上。 - Making a raid5 needs three or more partitions - 当制作raid5的时,硬盘分区必须三个或三个以上。 + Making a raid5 needs three or more partitions + 当制作raid5的时,硬盘分区必须三个或三个以上。 @@ -966,9 +994,9 @@ row 4 | | An existing raid, which wasn't made during this installation process, can't be deleted. 对于一个早已存在的raid设备(不是由安装程序创建的),你不能把它删除。 - + - + RAID is a technology that provides increased storage reliability through redundancy, combining multiple low-cost, less-reliable disk drives components into a logical unit where all drives in the array are interdependent. If you don't want to make a RAID, you could click "next" to skip this step. The installation will go on normally. @@ -980,9 +1008,9 @@ row 4 | | 如果用户不懂该技术可以直接点击下一步,系统将不制作RAID,并不影响系统的安装及运行。 原始框中是满足制作RAID的硬盘分区,如sda1、sdb2等。设备框中是原本系统已经制作好的RAID,如md0、md1等。系装安装时将保留原有的RAID设备。若要制作新RAID,请在原始框中选中硬盘分区后通过点击"->",硬盘分区会进入使用框或备用框中。要制作RAID,使用框中必须要有硬盘分区,可以有一个或多个。备用框中硬盘分区是可选的,可以有一个或多个,也可以没有。完成上步操作后在级别框中选择raid的级别,最后点击"->"在设备框中产生新的mdX设备。 - + - + Serial number is the permission to run secure functions of Linx Rocky Secure OS. Please Input the correct serial number in the frame, so that secure functions could run. @@ -994,9 +1022,9 @@ row 4 | | 如何获取安装序列号请联系北京凝思科技有限公司。 网站:www.linx-info.com - + - + The color of the servers listed in the frame suggests whether they are self-starting since system startup. Gary means no, and the probable reason is packages providing the servers haven't been selected to install. @@ -1005,8 +1033,9 @@ row 4 | | 显示框中表示系统启动过程中自动启动的服务。 灰色选项说明不技持该服务,可能是因为没有选上该服务所对应的软件包。 - - + + + There are two kinds of packages and package groups, one is mandatory, the other is optional. The mandatory packages of a group will be installed by default if you select the group. You could first click a group, and then select optional packages want to install in the pop-up dialog box. @@ -1028,7 +1057,7 @@ row 4 | | 多媒体类软件包组(multi-media)包括各种媒体库。多媒体类软件包都是可选软件包,可以自由选择安装。 其它软件包组(kde、vm、network_tools)都是可选软件包,可以自由选择安装。 - + Welcome to use Linx Rocky Secure Operating System v4.2