feeds & morss: clean up comments/empty lines

master
pictuga 2020-03-20 12:25:48 +01:00
parent 912c323c40
commit dd2651061f
2 changed files with 3 additions and 6 deletions

View File

@ -372,10 +372,6 @@ class ParserXML(ParserBase):
match.getparent().append(element)
return element
# try duplicating from template
# FIXME
# >>> self.xml.getroottree().getpath(ff.find('a'))
return None
def rule_remove(self, rule):
@ -471,8 +467,6 @@ class ParserHTML(ParserXML):
element = deepcopy(match)
match.getparent().append(element)
# TODO def rule_set for the html part
def parse_time(value):
if isinstance(value, basestring):
@ -487,6 +481,7 @@ def parse_time(value):
elif isinstance(value, datetime):
return value
else:
return False

View File

@ -435,8 +435,10 @@ def FeedFormat(rss, options):
if options.callback:
if re.match(r'^[a-zA-Z0-9\.]+$', options.callback) is not None:
return '%s(%s)' % (options.callback, rss.tojson())
else:
raise MorssException('Invalid callback var name')
elif options.json:
if options.indent:
return rss.tojson(encoding='UTF-8', indent=4)