From 5855beb32a5a2a792d67a59ad85e9e44ff6ce431 Mon Sep 17 00:00:00 2001 From: Yuri Baburov Date: Mon, 22 Sep 2014 15:29:49 +0700 Subject: [PATCH] WIP; Backported features from stable branch --- readability/readability.py | 4 ++++ setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/readability/readability.py b/readability/readability.py index 72c98fd..f7c64bf 100755 --- a/readability/readability.py +++ b/readability/readability.py @@ -435,6 +435,7 @@ class Document: for kind in ['p', 'img', 'li', 'a', 'embed', 'input']: counts[kind] = len(el.findall('.//%s' % kind)) counts["li"] -= 100 + counts["input"] -= len(el.findall('.//input[@type="hidden"]')) # Count the text length excluding any surrounding whitespace content_length = text_length(el) @@ -590,6 +591,9 @@ def main(): parser.add_option('-b', '--browser', default=None, action='store_true', help="open in browser") parser.add_option('-l', '--log', default=None, help="use filename for logs (appended)") parser.add_option('-u', '--url', default=None, help="use URL instead of a local file") + parser.add_option('-s', '--show-xpath', default=None, help="show xpath") + parser.add_option('-x', '--xpath', default=None, help="use xpath") + parser.add_option('-t', '--support-text', default=None, help="use this support text") parser.add_option('-p', '--positive-keywords', default=None, help="positive keywords (separated with comma)", action='store') parser.add_option('-n', '--negative-keywords', default=None, help="negative keywords (separated with comma)", action='store') (options, args) = parser.parse_args() diff --git a/setup.py b/setup.py index e160142..3ee0cca 100755 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ if sys.platform == 'darwin': setup( name="readability-lxml", - version="0.4.0.b1", + version="0.5.0.2", author="Yuri Baburov", author_email="burchik@gmail.com", description="fast python port of arc90's readability tool",