mdel: set element text after create it (#62631)
This commit is contained in:
parent
dc3f8a60b1
commit
b1b80e5fa3
|
@ -35,13 +35,15 @@ def parse_date(date):
|
|||
|
||||
class ElementFactory(etree.Element):
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.text = kwargs.pop('text', None)
|
||||
text = kwargs.pop('text', None)
|
||||
namespace = kwargs.pop('namespace', None)
|
||||
if namespace:
|
||||
super(ElementFactory, self).__init__(etree.QName(namespace, args[0]), **kwargs)
|
||||
self.namespace = namespace
|
||||
else:
|
||||
super(ElementFactory, self).__init__(*args, **kwargs)
|
||||
if text:
|
||||
self.text = text
|
||||
|
||||
def append(self, element, allow_new=True):
|
||||
|
||||
|
|
Loading…
Reference in New Issue