Fix two function in case of None element
parent
0d1f1fdcc0
commit
c1d410267b
5
feeds.py
5
feeds.py
|
@ -90,7 +90,7 @@ class FeedBase(object):
|
||||||
""" Returns the .text of the 1st match """
|
""" Returns the .text of the 1st match """
|
||||||
match = self.xget(path)
|
match = self.xget(path)
|
||||||
if match is not None:
|
if match is not None:
|
||||||
return match.text
|
return match.text or ""
|
||||||
else:
|
else:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
@ -199,6 +199,9 @@ class FeedList(object):
|
||||||
self.parent.root.append(new.xml)
|
self.parent.root.append(new.xml)
|
||||||
self._children[id(new.xml)] = new
|
self._children[id(new.xml)] = new
|
||||||
|
|
||||||
|
if cousin is None:
|
||||||
|
return new
|
||||||
|
|
||||||
for key in self.childClass.__dict__:
|
for key in self.childClass.__dict__:
|
||||||
if key[:3] == 'set':
|
if key[:3] == 'set':
|
||||||
attr = key[3:].lower()
|
attr = key[3:].lower()
|
||||||
|
|
Loading…
Reference in New Issue