File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,9 +18,9 @@ Based on:
1818
1919Installation::
2020
21- easy_install readability-xml
21+ easy_install readability-lxml
2222 or
23- pip install readability-xml
23+ pip install readability-lxml
2424
2525Usage::
2626
Original file line number Diff line number Diff 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-
Original file line number Diff line number Diff line change @@ -19,4 +19,3 @@ def get_encoding(page):
1919 if enc == 'MacCyrillic' :
2020 enc = 'cp1251'
2121 return enc
22-
Original file line number Diff line number Diff 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 :
Original file line number Diff line number Diff line change 33
44setup (
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" ,
You can’t perform that action at this time.
0 commit comments