Logo Search packages:      
Sourcecode: jabber-irc version File versions  Download package

def jep0133::Edit_Admin_List_Command::cmdSecondStage (   self,
  conn,
  request 
)

Apply and save the config

Definition at line 107 of file jep0133.py.

00107                                            :
            """Apply and save the config"""
            form = DataForm(node=result.getTag(name='command').getTag(namespace=NS_DATA))
            if sessions.has_key(request.getTagAttr('command','sessionid')):
                  if sessions[request.getTagAttr('command','sessionid')]['jid'] == request.getFrom():
                        self.administrators = form.getField('adminjids').getValues()
                        adminstr = ''
                        for each in self.administrators:
                           adminstr = adminstr+each+','
                        self.configfile.set('transport','Administrators',adminstr)
                        f = open(self.configfilename,'w')
                        self.configfile.write(f)
                        f.close()
                        reply = requst.buildReply('result')
                        reply.addChild(name='command',attrs={'xmlns':NS_COMMAND,'node':request.getTagAttr('command','node'),'sessionid':session,'status':'completed'})
                        self.jabber.send(reply)
                  else:
                        self.jabber.send(Error(ERR_BAD_REQUEST,request))
            else:
                  self.jabber.send(Error(ERR_BAD_REQUEST,request))   
                  self.jabber.send(Error(ERR_BAD_REQUEST,request))   


Generated by  Doxygen 1.6.0   Back to index