modified: operation/finish_install/66install_lib_32.sh modified: operation/finish_install/95state_grid_custom.py
75 lines
2.0 KiB
Python
75 lines
2.0 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 ri_progress,re
|
|
from ri_oper import language, Rate
|
|
from snack import *
|
|
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().strip()
|
|
f.close()
|
|
#instmode = cmdline.split(' ')[0].split('=')[1]
|
|
for i in cmdline.split(' '):
|
|
if re.match('instmode=',i):
|
|
instmode = i.split('=')[1]
|
|
break
|
|
screen = SnackScreen()
|
|
screen.drawRootText(0, 0, 'Rocky Security OS Install')
|
|
screen.pushHelpLine(' ')
|
|
g = GridForm(screen, 'Rocky Install', 1, 3)
|
|
txt1 = Label('Automated Install Rocky OS successfully, and the OS will reboot in 10 seconds ......')
|
|
txt2 = Label('Install Rocky OS successfully, do you want to reboot ?')
|
|
elabel = Label('')
|
|
bb = ButtonBar(screen, (('Ok','ok'),('Cancel','cancel')))
|
|
g.add(elabel, 0, 1)
|
|
if instmode == 'Auto' or instmode == 'StateGrid':
|
|
g.add(txt1, 0, 1)
|
|
g.setTimer(10000)
|
|
g.runOnce()
|
|
screen.finish()
|
|
return True
|
|
else:
|
|
g.add(txt2, 0, 0)
|
|
g.add(bb, 0, 2)
|
|
res = g.run()
|
|
screen.refresh()
|
|
if bb.buttonPressed(res) == 'ok':
|
|
screen.finish()
|
|
return True
|
|
else:
|
|
screen.finish()
|
|
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()
|