Merge commit 'origin/hugang4' into tmp

Conflicts:
	interface/ri_tk_cmd.py
This commit is contained in:
lizhi-rocky
2010-10-18 15:39:23 +08:00
7 changed files with 81 additions and 57 deletions

View File

@@ -9,7 +9,7 @@ import sys
import subprocess
import getopt
ins_xml = './install.xml'
ins_xml = '/var/install/install.xml'
lang = 'english'
message = {}
message['english'] = 'The system detects the presence of the last\n \
@@ -21,10 +21,10 @@ def print_usages():
print 'language [english|chinese]'
print 'default language is english'
def ok():
def yes():
root.destroy()
def cancel():
def no():
''' remove system left install.xml file'''
cmd='rm -rf ' + ins_xml
subprocess.Popen(cmd,shell=True)
@@ -34,15 +34,13 @@ def init(language):
''' implement Widget'''
global root
root = Tkinter.Tk()
root.geometry("%sx%s+%d+%d" % (root.winfo_screenwidth()/2,\
root.winfo_screenheight()/2,\
root.winfo_screenwidth()/4,
root.winfo_screenheight()/4))
root.geometry("%sx%s+0+0" % (root.winfo_screenwidth(),
root.winfo_screenheight()))
txt = message[language]
lab = Tkinter.Label(root,text=txt)
lab.grid(row=1,column=1)
btn1 = Tkinter.Button(root,text='OK',command=sys.modules[__name__].ok)
btn2 = Tkinter.Button(root,text='Cancle',command=sys.modules[__name__].cancel)
btn1 = Tkinter.Button(root,text='Yes',command=sys.modules[__name__].yes)
btn2 = Tkinter.Button(root,text='No',command=sys.modules[__name__].no)
btn1.grid(row=2,column=0,padx=40,pady=100,ipadx=20)
btn2.grid(row=2,column=2,padx=20,pady=100,ipadx=15)
root.rowconfigure(1,weight=2)
@@ -51,18 +49,21 @@ def init(language):
root.mainloop()
try:
opts,args = getopt.getopt(sys.argv[1:],"l:",["language="])
opts,args = getopt.getopt(sys.argv[1:],"l:",["language="])
except getopt.GetoptError:
print_usages()
sys.exit(1)
print_usages()
sys.exit(1)
for opt,arg in opts:
if opt in ('-l','--language'):
lang = arg
if opt in ('-h','--help'):
print_usages()
sys.exit(0)
if lang in ('english','chinese'):
init(lang)
init(lang)
else:
print_usages()
sys.exit(1)
print_usages()
sys.exit(1)

View File

@@ -630,7 +630,8 @@ p_node - xml node (parent node)'''
srvs.appendChild(srv)
p_node.appendChild(srvs)
def install_information():
def prepar_installation():
'''create file called 'intall.xml',which contains the information about the installation'''
to_xml()
xmldoc = minidom.parse(install_xml)
root = xmldoc.firstChild

View File

@@ -384,10 +384,10 @@ def raid_device_list_detail(*args):
display.var_dict['raid_detail_spare'].set(value='spare: %s' %(str(r.spare_components)))
display.var_dict['raid_detail_level'].set(value='level: %s' %(str(r.level)))
def install_information_init():
def prepar_installation_init():
'''install information initialize'''
ins_info = ri_data.install_information()
t= ri_widget.Widget.dict['install_information.list'].tk_widget
ins_info = ri_data.prepar_installation()
t= ri_widget.Widget.dict['prepar_installation.text'].tk_widget
t.insert(1.0,ins_info)
raid_raw_initialized = False

View File

@@ -27,10 +27,10 @@ for opt, arg in opts:
if len(args) == 0:
itf_xml = "../xml/interface.xml"
ins_xml = "../xml/install.xml"
ins_xml = "/var/install/install.xml"
elif len(args) == 1:
itf_xml = args[0]
ins_xml = "../xml/install.xml"
ins_xml = "/var/install/install.xml"
else:
itf_xml = args[0]
ins_xml = args[1]