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