comparison src/memory/params.py @ 1744:9a48e09044eb

plugin extra_pep, params: fixed insecure building of jids_list
author Goffi <goffi@goffi.org>
date Tue, 15 Dec 2015 16:25:19 +0100
parents 681fe91abcc0
children 5ca3caefcf98
comparison
equal deleted inserted replaced
1743:4c48468ead4c 1744:9a48e09044eb
25 from xml.dom import minidom, NotFoundErr 25 from xml.dom import minidom, NotFoundErr
26 from sat.core.log import getLogger 26 from sat.core.log import getLogger
27 log = getLogger(__name__) 27 log = getLogger(__name__)
28 from twisted.internet import defer 28 from twisted.internet import defer
29 from twisted.python.failure import Failure 29 from twisted.python.failure import Failure
30 from twisted.words.xish import domish
30 from twisted.words.protocols.jabber import jid 31 from twisted.words.protocols.jabber import jid
31 from sat.tools.xml_tools import paramsXML2XMLUI, getText 32 from sat.tools.xml_tools import paramsXML2XMLUI, getText
32 33
33 # TODO: params should be rewritten using Twisted directly instead of minidom 34 # TODO: params should be rewritten using Twisted directly instead of minidom
34 # general params should be linked to sat.conf and kept synchronised 35 # general params should be linked to sat.conf and kept synchronised
35 # this need an overall simplification to make maintenance easier 36 # this need an overall simplification to make maintenance easier
37
38
39 def createJidElts(jids):
40 """Generator which return <jid/> elements from jids
41
42 @param jids(iterable[id.jID]): jids to use
43 @return (generator[domish.Element]): <jid/> elements
44 """
45 for jid_ in jids:
46 jid_elt = domish.Element((None, 'jid'))
47 jid_elt.addContent(jid_.full())
48 yield jid_elt
36 49
37 50
38 class Params(object): 51 class Params(object):
39 """This class manage parameters with xml""" 52 """This class manage parameters with xml"""
40 ### TODO: add desciption in params 53 ### TODO: add desciption in params