8000 Fixed indentation, encoding issue and README bug. Thanks to Greg Jast… · linuxlewis/python-readability@11c4d95 · GitHub
[go: up one dir, main page]

Skip to content

Commit 11c4d95

Browse files
committed
Fixed indentation, encoding issue and README bug. Thanks to Greg Jastrab. Bump version to 0.2.3
1 parent 6bf4948 commit 11c4d95

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Based on:
1818

1919
Installation::
2020

21-
easy_install readability-xml
21+
easy_install readability-lxml
2222
or
23-
pip install readability-xml
23+
pip install readability-lxml
2424

2525
Usage::
2626

readability/debug.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ def describe(node, depth=2):
2323
if depth and node.getparent() is not None:
2424
return name+' - '+describe(node.getparent(), depth-1)
2525
return name
26-

readability/encoding.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ def get_encoding(page):
1919
if enc == 'MacCyrillic':
2020
enc = 'cp1251'
2121
return enc
22-

readability/readability.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ def summary(self):
121121
else:
122122
logging.debug("Ruthless and lenient parsing did not work. Returning raw html")
123123
article = self.html.find('body')
124-
if article is None:
125-
article = self.html
124+
if article is None:
125+
article = self.html
126126

127127
cleaned_article = self.sanitize(article, candidates)
128128
of_acceptable_length = len(cleaned_article or '') >= (self.options['retry_length'] or self.RETRY_LENGTH)
@@ -497,8 +497,8 @@ def main():
497497
import urllib
498498
file = urllib.urlopen(options.url)
499499
else:
500-
file = open(args[0])
501-
enc = sys.stdout.encoding or 'utf-8'
500+
file = open(args[0], 'rt')
501+
enc = sys.__stdout__.encoding or 'utf-8'
502502
try:
503503
print Document(file.read(), debug=options.verbose).summary().encode(enc, 'replace')
504504
finally:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="readability-lxml",
6-
version="0.2.2",
6+
version="0.2.3",
77
author="Yuri Baburov",
88
author_email="burchik@gmail.com",
99
description="fast python port of arc90's readability tool",

0 commit comments

Comments
 (0)
0