From: Oleg Broytman Date: Wed, 30 Apr 2014 18:07:20 +0000 (+0400) Subject: Split parse_html/__init__.py into __main__.py X-Git-Tag: v4.6.0~41 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=a8d53ec6ab657ced2a8778ad8616ed9fc0e6a332;p=bookmarks_db.git Split parse_html/__init__.py into __main__.py --- diff --git a/doc/ANNOUNCE b/doc/ANNOUNCE index 55e7351..60e3eac 100644 --- a/doc/ANNOUNCE +++ b/doc/ANNOUNCE @@ -10,6 +10,8 @@ WHAT'S NEW in version 4.5.7 Change parse_html to parse strings, not files. + Split parse_html/__init__.py into __main__.py. + Add ChangeLog. diff --git a/parse_html/__init__.py b/parse_html/__init__.py index d9dfffc..b3d5624 100644 --- a/parse_html/__init__.py +++ b/parse_html/__init__.py @@ -12,22 +12,3 @@ __all__ = ['parse_html', 'parse_filename', 'main'] from .bkmk_parse_html import parse_html, parse_filename - - -def main(): - import sys - from .bkmk_parse_html import universal_charset - - l = len(sys.argv) - if l == 3: - filename = sys.argv[1] - charset = sys.argv[2] - elif l == 2: - filename = sys.argv[1] - charset = universal_charset - else: - sys.exit("Usage: main filename [charset]") - - parser = parse_filename(filename, charset, log=lambda s: sys.stdout.write(s + '\n')) - print " refresh:", parser.refresh - print " icon :", parser.icon diff --git a/parse_html/__main__.py b/parse_html/__main__.py new file mode 100644 index 0000000..e5428e5 --- /dev/null +++ b/parse_html/__main__.py @@ -0,0 +1,34 @@ +"""HTML Parsers + +This file is a part of Bookmarks database and Internet robot. + +""" + +__author__ = "Oleg Broytman " +__copyright__ = "Copyright (C) 2014 PhiloSoft Design" +__license__ = "GNU GPL" + + +from .bkmk_parse_html import parse_filename + + +def main(): + import sys + from .bkmk_parse_html import universal_charset + + l = len(sys.argv) + if l == 3: + filename = sys.argv[1] + charset = sys.argv[2] + elif l == 2: + filename = sys.argv[1] + charset = universal_charset + else: + sys.exit("Usage: main filename [charset]") + + parser = parse_filename(filename, charset, log=lambda s: sys.stdout.write(s + '\n')) + print " refresh:", parser.refresh + print " icon :", parser.icon + +if __name__ == '__main__': + main()