From 74462ef012ccab6ae38aa3a3b0188efd4e49c33b Mon Sep 17 00:00:00 2001 From: fling Date: Tue, 30 Aug 2011 18:39:35 +0800 Subject: [PATCH] service is ok modified: di_dialog.py --- dialog/di_dialog.py | 56 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/dialog/di_dialog.py b/dialog/di_dialog.py index aafe38d..51a5208 100644 --- a/dialog/di_dialog.py +++ b/dialog/di_dialog.py @@ -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()