feeds: clean up .append()
parent
f10727f94a
commit
6d5aa8c222
|
@ -440,13 +440,17 @@ class Feed(object):
|
||||||
if new is None:
|
if new is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
for attr in globals()[self.itemsClass].dic:
|
for attr in self.dic:
|
||||||
if hasattr(new, attr):
|
try:
|
||||||
setattr(item, attr, getattr(new, attr))
|
setattr(item, attr, getattr(new, attr))
|
||||||
|
|
||||||
elif attr in new:
|
except AttributeError:
|
||||||
|
try:
|
||||||
setattr(item, attr, new[attr])
|
setattr(item, attr, new[attr])
|
||||||
|
|
||||||
|
except (IndexError, TypeError):
|
||||||
|
pass
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
return self.wrap_items(self.get_raw('items'))[key]
|
return self.wrap_items(self.get_raw('items'))[key]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue