]> git.phdru.name Git - bookmarks_db.git/commitdiff
Emulate log.
authorOleg Broytman <phd@phdru.name>
Sun, 24 Feb 2008 12:27:21 +0000 (12:27 +0000)
committerOleg Broytman <phd@phdru.name>
Sun, 24 Feb 2008 12:27:21 +0000 (12:27 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@181 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

Robots/parse_html.py

index c05e66cce3a2ad394807b057e4071625f5390fcb..0d7b20b5ce82b88d596b1cb25aac90084a997735 100755 (executable)
@@ -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