feeds & morss: clean up comments/empty lines
parent
912c323c40
commit
dd2651061f
|
@ -372,10 +372,6 @@ class ParserXML(ParserBase):
|
||||||
match.getparent().append(element)
|
match.getparent().append(element)
|
||||||
return element
|
return element
|
||||||
|
|
||||||
# try duplicating from template
|
|
||||||
# FIXME
|
|
||||||
# >>> self.xml.getroottree().getpath(ff.find('a'))
|
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def rule_remove(self, rule):
|
def rule_remove(self, rule):
|
||||||
|
@ -471,8 +467,6 @@ class ParserHTML(ParserXML):
|
||||||
element = deepcopy(match)
|
element = deepcopy(match)
|
||||||
match.getparent().append(element)
|
match.getparent().append(element)
|
||||||
|
|
||||||
# TODO def rule_set for the html part
|
|
||||||
|
|
||||||
|
|
||||||
def parse_time(value):
|
def parse_time(value):
|
||||||
if isinstance(value, basestring):
|
if isinstance(value, basestring):
|
||||||
|
@ -487,6 +481,7 @@ def parse_time(value):
|
||||||
|
|
||||||
elif isinstance(value, datetime):
|
elif isinstance(value, datetime):
|
||||||
return value
|
return value
|
||||||
|
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -435,8 +435,10 @@ def FeedFormat(rss, options):
|
||||||
if options.callback:
|
if options.callback:
|
||||||
if re.match(r'^[a-zA-Z0-9\.]+$', options.callback) is not None:
|
if re.match(r'^[a-zA-Z0-9\.]+$', options.callback) is not None:
|
||||||
return '%s(%s)' % (options.callback, rss.tojson())
|
return '%s(%s)' % (options.callback, rss.tojson())
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise MorssException('Invalid callback var name')
|
raise MorssException('Invalid callback var name')
|
||||||
|
|
||||||
elif options.json:
|
elif options.json:
|
||||||
if options.indent:
|
if options.indent:
|
||||||
return rss.tojson(encoding='UTF-8', indent=4)
|
return rss.tojson(encoding='UTF-8', indent=4)
|
||||||
|
|
Loading…
Reference in New Issue