feeds: handle several errors
parent
a32f5a8536
commit
3c7f512583
|
@ -269,8 +269,15 @@ class ParserBase(object):
|
||||||
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# does not exist, have to create it
|
# does not exist, have to create it
|
||||||
self.rule_create(self.rules[rule_name])
|
try:
|
||||||
self.rule_set(self.rules[rule_name], value)
|
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):
|
def rmv(self, rule_name):
|
||||||
# easy deleter
|
# easy deleter
|
||||||
|
@ -469,6 +476,9 @@ class ParserHTML(ParserXML):
|
||||||
element = deepcopy(match)
|
element = deepcopy(match)
|
||||||
match.getparent().append(element)
|
match.getparent().append(element)
|
||||||
|
|
||||||
|
else:
|
||||||
|
raise AttributeError('no way to create item')
|
||||||
|
|
||||||
|
|
||||||
def parse_time(value):
|
def parse_time(value):
|
||||||
if value is None or value == 0:
|
if value is None or value == 0:
|
||||||
|
|
Loading…
Reference in New Issue