From: Oleg Broytman Date: Sun, 24 Feb 2008 12:27:21 +0000 (+0000) Subject: Emulate log. X-Git-Tag: v4.5.3~195 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=3a4e6b782c229014a6cc49f1e68681696c1ed1f3;p=bookmarks_db.git Emulate log. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@181 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- diff --git a/Robots/parse_html.py b/Robots/parse_html.py index c05e66c..0d7b20b 100755 --- a/Robots/parse_html.py +++ b/Robots/parse_html.py @@ -114,9 +114,7 @@ if __name__ == '__main__': from m_lib.defenc import default_encoding current_charset = default_encoding.replace("windows-", "cp") - parser = parse_html(sys.argv[1], universal_charset) - print parser.charset - print parser.title - print parser.title.decode(universal_charset).encode(current_charset, "replace") - print parser.refresh - print parser.icon + parser = parse_html(sys.argv[1], universal_charset, + log=lambda s: sys.stdout.write(s + '\n')) + print " refresh:", parser.refresh + print " icon :", parser.icon