From 3a4e6b782c229014a6cc49f1e68681696c1ed1f3 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 24 Feb 2008 12:27:21 +0000 Subject: [PATCH] Emulate log. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@181 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- Robots/parse_html.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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 -- 2.39.5