feeds: handle several errors

master
pictuga 2020-04-09 19:09:10 +02:00
parent a32f5a8536
commit 3c7f512583
1 changed files with 12 additions and 2 deletions

View File

@ -269,7 +269,14 @@ class ParserBase(object):
except AttributeError:
# does not exist, have to create it
try:
self.rule_create(self.rules[rule_name])
except AttributeError:
# no way to create it, give up
pass
else:
self.rule_set(self.rules[rule_name], value)
def rmv(self, rule_name):
@ -469,6 +476,9 @@ class ParserHTML(ParserXML):
element = deepcopy(match)
match.getparent().append(element)
else:
raise AttributeError('no way to create item')
def parse_time(value):
if value is None or value == 0: