From dd2651061f0b33e37f78aaea297a934fb795ea7b Mon Sep 17 00:00:00 2001 From: pictuga Date: Fri, 20 Mar 2020 12:25:48 +0100 Subject: [PATCH] feeds & morss: clean up comments/empty lines --- morss/feeds.py | 7 +------ morss/morss.py | 2 ++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/morss/feeds.py b/morss/feeds.py index 75678bf..d951fce 100644 --- a/morss/feeds.py +++ b/morss/feeds.py @@ -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 diff --git a/morss/morss.py b/morss/morss.py index af4507f..1d27b92 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -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)