Files
new_install/text/ri_main.py
Peng Zhihui 99c32ef85c Correct the funciton to calculate raid size
Correct the funciton to del raid

       modified:   interface/ri_data.py
       modified:   new_partition/interface_partition.py
       modified:   text/ri_main.py
       modified:   text/ri_newt.py
2014-02-13 13:14:24 +08:00

70 lines
1.6 KiB
Python

import os
import sys
sys.path.append('../interface/')
sys.path.append('../new_partition/')
import ri_data
import partition_data
import interface_partition
import ri_newt
list=['welcome','partition','raid','mountpoint','serialnumber','network','group','service','information']
init_partition_from_os_flag = True
init_flag = True
init_raid_from_os = True
count=0
while True :
if count == 1:
if init_raid_from_os:
ri_data.Raid.init_from_os()
init_raid_from_os = False
if init_partition_from_os_flag:
partition_data.Partition.init_from_os(unit='s')
init_partition_from_os_flag = False
s = interface_partition.main()
if init_flag:
ri_data.init()
init_flag = False
if len(ri_newt.Raid.init_from_internal()) < 2 and len(ri_data.Raid.dict) == 0:
if list[2] == 'raid':
del list[2]
else:
#if init_raid_from_os:
# ri_data.Raid.init_from_os()
# init_raid_from_os = False
if list[2] != 'raid':
list.insert(2, 'raid')
else:
if list[count] == 'welcome':
ri_newt.Welcome()
elif list[count] == 'raid':
ri_newt.Raid()
elif list[count] == 'mountpoint':
ri_newt.MountPoint()
elif list[count] == 'serialnumber':
ri_newt.SerialNumber()
elif list[count] == 'network':
ri_newt.Network()
elif list[count] == 'group':
ri_newt.Group()
elif list[count] == 'service':
ri_newt.Service()
elif list[count] == 'information':
ri_newt.Prepar_installation()
s = ri_newt.Screen.dict[list[count]].set_data()
if int(s) == 0:
count = count + 1
else:
count = count - 1
if count < 0 or count > len(list) - 1:
ri_newt.Screen.screen.finish()
break
if s == 0:
os.system("python ../interface/ri_install.py")