]> git.phdru.name Git - bookmarks_db.git/commitdiff
current_charset is only needed in main.
authorOleg Broytman <phd@phdru.name>
Tue, 12 Feb 2008 21:44:10 +0000 (21:44 +0000)
committerOleg Broytman <phd@phdru.name>
Tue, 12 Feb 2008 21:44:10 +0000 (21:44 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@175 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

Robots/parse_html.py

index 888e27c9f79a2f7d6310dd3129454d8b6b360d67..bc507679b034f20f06124171dba3b1e8ec5e2945 100755 (executable)
@@ -7,9 +7,6 @@
 
 import codecs
 
-from m_lib.defenc import default_encoding
-current_charset = default_encoding.replace("windows-", "cp")
-
 universal_charset = "utf-8"
 DEFAULT_CHARSET = "cp1251" # Stupid default for Russian Cyrillic
 
@@ -109,6 +106,9 @@ def parse_html(filename, charset=None, log=None):
 
 if __name__ == '__main__':
    import sys
+   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