modified: ri_cmd.py

modified:   ri_data.py
	modified:   ../xml/interface.xml
    add check network hostname ip netmask DNS.
This commit is contained in:
fling
2010-12-07 14:44:36 +08:00
parent 1c05b41ccc
commit e332f9de9c
3 changed files with 32 additions and 2 deletions

View File

@@ -4,6 +4,8 @@
import ri_widget
import os
import ri_tk
from ri_data import Network
from ri_tk_cmd import network_quit as network_update
def quit():
''' correspond to quit button '''
@@ -28,6 +30,10 @@ def previous():
def next():
''' correspond to next button '''
q, t = ri_widget.Sequence.current()
if not check_date(t):
return
wid_name = ri_widget.Sequence.next()
if wid_name is not None:
ri_widget.Widget.dict[t].hide()
@@ -37,6 +43,17 @@ def next():
code = ri_widget.MessageBox.dict["next"].show()
if code == True:
os.execl('/usr/bin/python','python','ri_install.py', "-d","tk","-l",ri_tk.language)
from ri_tk_cmd import *
def check_date(operate):
'''check date '''
if operate == "network" :
network_update()
if not Network.hostname:
ri_widget.MessageBox.dict['check_ip_hostname'].show()
return False
if Network.configuration == "static" and not Network.check_ip() :
ri_widget.MessageBox.dict['check_ip_hostname'].show()
return False
return True
from ri_tk_cmd import *

View File

@@ -450,6 +450,13 @@ p_node - xml node (parent node)'''
to_xml_attr(doc, ntwk, Network, nm)
p_node.appendChild(ntwk)
@staticmethod
def check_ip() :
"""check network ip"""
if Network.ip and Network.mask and Network.gateway and Network.primary_dns:
return True
return False
class Group:
''' software package group '''
dict = {}

View File

@@ -796,6 +796,7 @@ row 4 | |
<message_box name='raid_add_active_numbers' type='showwarning' title='Linx' message='#raid-add-active-numbers'/>
<message_box name='raid_add_active_numbers_2' type='showwarning' title='Linx' message='#raid-add-active-numbers-2'/>
<message_box name='check_mount_point' type='showwarning' title='Linx' message='#check-mount-point'/>
<message_box name='check_ip_hostname' type='showwarning' title='Linx' message='#check-ip-hostname'/>
<!--
column 0 column 1
________________________________________________
@@ -891,6 +892,11 @@ row 4 | |
<Chinese>挂载点已经被使用或者这个是一个特殊的挂载点, 不能这样挂载, 请看帮助文档</Chinese>
</text>
<text key='#check-ip-hostname'>
<English>Hostname must be configured. If you choose a static way to set an IP address,the ip address, netmask, gateway, DNS server must be configured.</English>
<Chinese>主机名不能为空.如果是静态IP方式,ip地址,子网掩码,网关,DNS地址都不能为空,请按正确方式填写,详细内容请看帮助文档.</Chinese>
</text>
<text key='#Copyright'>
<English>Copyright 2001-2010 Linx Technology Co., Ltd.</English>
<Chinese>北京凝思科技有限公司 版权所有</Chinese>