Skip to content

Commit

Permalink
Fixed indentation, encoding issue and README bug. Thanks to Greg Jast…
Browse files Browse the repository at this point in the history
…rab. Bump version to 0.2.3
  • Loading branch information
buriy committed Jul 26, 2011
1 parent 6bf4948 commit 11c4d95
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Based on:

Installation::

easy_install readability-xml
easy_install readability-lxml
or
pip install readability-xml
pip install readability-lxml

Usage::

Expand Down
1 change: 0 additions & 1 deletion readability/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ def describe(node, depth=2):
if depth and node.getparent() is not None:
return name+' - '+describe(node.getparent(), depth-1)
return name

1 change: 0 additions & 1 deletion readability/encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ def get_encoding(page):
if enc == 'MacCyrillic':
enc = 'cp1251'
return enc

8 changes: 4 additions & 4 deletions readability/readability.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def summary(self):
else:
logging.debug("Ruthless and lenient parsing did not work. Returning raw html")
article = self.html.find('body')
if article is None:
article = self.html
if article is None:
article = self.html

cleaned_article = self.sanitize(article, candidates)
of_acceptable_length = len(cleaned_article or '') >= (self.options['retry_length'] or self.RETRY_LENGTH)
Expand Down Expand Up @@ -497,8 +497,8 @@ def main():
import urllib
file = urllib.urlopen(options.url)
else:
file = open(args[0])
enc = sys.stdout.encoding or 'utf-8'
file = open(args[0], 'rt')
enc = sys.__stdout__.encoding or 'utf-8'
try:
print Document(file.read(), debug=options.verbose).summary().encode(enc, 'replace')
finally:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name="readability-lxml",
version="0.2.2",
version="0.2.3",
author="Yuri Baburov",
author_email="[email protected]",
description="fast python port of arc90's readability tool",
Expand Down

0 comments on commit 11c4d95

Please sign in to comment.