text mode usage pythondialog show install progress
modified: ri_inst_cli.py modified: ri_install.py new file: ri_progress.py Signed-off-by: gdzhang <gdzhang@linx-info.com>
This commit is contained in:
@@ -17,15 +17,17 @@
|
||||
#
|
||||
|
||||
import time
|
||||
import ri_progress
|
||||
from ri_oper import language, Rate
|
||||
import dialog
|
||||
def set_task(task_name):
|
||||
print task_name
|
||||
ri_progress.i_operation = task_name
|
||||
|
||||
def set_sub_task(sub_task):
|
||||
print sub_task
|
||||
ri_progress.i_operation = sub_task
|
||||
|
||||
def set_task_scale():
|
||||
print "%.2f" %float(Rate.value)
|
||||
ri_progress.i_percent = int(Rate.value)
|
||||
|
||||
def set_task_over():
|
||||
f = open('/proc/cmdline', 'r')
|
||||
@@ -37,9 +39,12 @@ def set_task_over():
|
||||
time.sleep(10)
|
||||
return True
|
||||
else:
|
||||
string = raw_input("Rocky system installation successfully, do you want to reboot?[Y/n]")
|
||||
if string.lower() == "y" or string == "":
|
||||
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():
|
||||
|
||||
Reference in New Issue
Block a user