modified: ri_inst_cli.py modified: ri_install.py new file: ri_progress.py Signed-off-by: gdzhang <gdzhang@linx-info.com>
58 lines
1.4 KiB
Python
58 lines
1.4 KiB
Python
#!/usr/bin/python
|
|
# DESCRIPTION: display module for install (cli)
|
|
#
|
|
# SCRIPT NAME: ri_inst_cli.py
|
|
#
|
|
# MENTOR: Li Zhi
|
|
#
|
|
# AUTHOR: Ling Fen
|
|
#
|
|
# EMAIL: fling@linx-info.com
|
|
#
|
|
# DATE: 2010-09-20
|
|
#
|
|
# HISTORY:
|
|
# REVISOR DATE MODIFICATION
|
|
# Ling Fen 2010-09-04 create
|
|
#
|
|
|
|
import time
|
|
import ri_progress
|
|
from ri_oper import language, Rate
|
|
import dialog
|
|
def set_task(task_name):
|
|
ri_progress.i_operation = task_name
|
|
|
|
def set_sub_task(sub_task):
|
|
ri_progress.i_operation = sub_task
|
|
|
|
def set_task_scale():
|
|
ri_progress.i_percent = int(Rate.value)
|
|
|
|
def set_task_over():
|
|
f = open('/proc/cmdline', 'r')
|
|
cmdline = f.readline()
|
|
f.close()
|
|
instmode = cmdline.split(' ')[0].split('=')[1]
|
|
if instmode == 'Auto' or instmode == 'StateGrid':
|
|
print 'The system will reboot in 10 seconds ......'
|
|
time.sleep(10)
|
|
return True
|
|
else:
|
|
ifreboot=dialog.Dialog()
|
|
ret=ifreboot.yesno("Rocky system installation successfully, do you want to reboot?")
|
|
if ret == 0:
|
|
return True
|
|
else:
|
|
return False
|
|
return False
|
|
|
|
def root_destroy():
|
|
pass
|
|
|
|
def error(oper, ret):
|
|
print "%s:\n Error number: %d\n %s"%(oper.english_name, ret, oper.return_value[ret][0])
|
|
|
|
def start(func):
|
|
func()
|