X-Git-Url: https://git.phdru.name/?p=bookmarks_db.git;a=blobdiff_plain;f=bkmk2db.py;h=34fca60d21fa8ced2434430a1c0de314440d4f33;hp=e2436f6a4ec06130b46cbae357ebed86d185c4a8;hb=53d4a2383cfef1310871eefcc14e6e1950b96853;hpb=fb5c3b2b91aeeb615d6d6d890491af3fdff69556 diff --git a/bkmk2db.py b/bkmk2db.py index e2436f6..34fca60 100755 --- a/bkmk2db.py +++ b/bkmk2db.py @@ -1,10 +1,12 @@ -#! /usr/local/bin/python -O -""" - Convert Netscape Navigator's or Mozilla's bookmarks.html to a database +#! /usr/bin/env python +"""Convert Netscape Navigator's or Mozilla's bookmarks.html to a database - Written by BroytMann, Jun 1997 - Aug 2002. Copyright (C) 1997-2002 PhiloSoft Design +This file is a part of Bookmarks database and Internet robot. """ +__author__ = "Oleg Broytman " +__copyright__ = "Copyright (C) 1997-2012 PhiloSoft Design" +__license__ = "GNU GPL" import sys, os from getopt import getopt @@ -14,7 +16,7 @@ from bkmk_parser import BkmkParser def run(): optlist, args = getopt(sys.argv[1:], "is") - show_pbar = not __debug__ + show_pbar = True report_stats = 1 for _opt, _arg in optlist: @@ -55,7 +57,7 @@ def run(): if show_pbar: try: - size = os.stat(filename).st_size + size = os.path.getsize(filename) except: print filename, ": no such file" sys.exit(1) @@ -84,7 +86,7 @@ def run(): lng = lng + len(line) + dos_add pbar.display(lng) - line = line.strip() + #line = line.strip() line_no = line_no + 1 try: