service is ok

modified:   di_dialog.py
This commit is contained in:
fling
2011-08-30 18:39:35 +08:00
parent c45e27866e
commit 74462ef012

View File

@@ -218,7 +218,6 @@ class Group(Dialog):
if s == 0 and check_list:
if check_list[0] == 'check all':
check_list = ri_data.Group.dict.keys()
count=0
while True:
if self.choise_optional(check_list[count]) == 0 :
@@ -230,6 +229,47 @@ class Group(Dialog):
print count
break
return s
class Service(Dialog):
def __init__(self,height=10,width=50,text='service'):
Dialog.__init__(self,name='service')
self.height=height
self.width=width
self.text=text
def set_service(self):
list=[('check all','','off')]
for s in ri_data.Service.list:
list.append((s.name,'','off'))
# print '++++'
# print 'name',s.name
# print 'number',s.number
# print 'script',s.script
# print 'start',s.start
# print 'package',s.package
# print '++++++'
s,check_list=Dialog.dialog.checklist(text='running service',height=self.height,width=self.width,list_height=self.height/5*4,default_item='check all',choices=list,title='choices gourp')
if s == 0 and check_list:
if check_list[0] == 'check all':
for s in ri_data.Service.list:
s.start='yes'
else:
for s in ri_data.Service.list:
for n in check_list:
if s.name == n :
s.start='yes'
for s in ri_data.Service.list:
print 'name',s.name
print 'number',s.number
print 'script',s.script
print 'start',s.start
print 'package',s.package
return s
# check_list.append('vm')
# for g in check_list:
@@ -251,17 +291,19 @@ ri_data.init()
#Welcome(15,50)
#Dialog.dict['welcome'].get_welcome()
##
###
#MountPoint(20,75)
#Dialog.dict['mountpoint'].set_data()
##
###
#SerialNumber(10,50)
#Dialog.dict['serialnumber'].set_number()
#
Network(10,50)
Dialog.dict['network'].set_data()
#
##
#Network(10,50)
#Dialog.dict['network'].set_data()
##
#Group(20,50)
#Dialog.dict['group'].set_pkg()
Service(15,50)
Dialog.dict['service'].set_service()
ri_data.to_xml()