X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=bkmk2db.py;h=e3971a6b3177c53368b93d04674515b7eda12e5c;hb=8a33ee42d7f8edff076734eba8c1718da8127b22;hp=5cf29aed53d4abfe607fb48b56aacdf4329b75cd;hpb=c88cb7a75e7caf1d67466cfa107981d95115fa0c;p=bookmarks_db.git diff --git a/bkmk2db.py b/bkmk2db.py index 5cf29ae..e3971a6 100755 --- a/bkmk2db.py +++ b/bkmk2db.py @@ -5,13 +5,15 @@ This file is a part of Bookmarks database and Internet robot. """ from __future__ import print_function -import sys, os from getopt import getopt +import os +import sys + from bkmk_parser import BkmkParser __author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 1997-2017 PhiloSoft Design" +__copyright__ = "Copyright (C) 1997-2023 PhiloSoft Design" __license__ = "GNU GPL" @@ -40,8 +42,8 @@ def run(): filename = args[0] else: - filename = 'bookmarks.html' # good name both for DOS (bookmark.htm) and UNIX - + # good name both for DOS (bookmark.htm) and UNIX + filename = 'bookmarks.html' if report_stats: from storage import storage_name @@ -64,17 +66,15 @@ def run(): print(filename, ": no such file") sys.exit(1) - if show_pbar: pbar = ttyProgressBar(0, size) lng = 0 # This is for DOS - it counts CRLF, which len() counts as 1 char! - if os.name == 'dos' or os.name == 'nt' : + if os.name == 'dos' or os.name == 'nt': dos_add = 1 else: - dos_add = 0 # UNIX' and Mac's len() counts CR or LF correct - + dos_add = 0 # UNIX' and Mac's len() counts CR or LF correct infile = open(filename, 'r') parser = BkmkParser() @@ -88,7 +88,7 @@ def run(): lng = lng + len(line) + dos_add pbar.display(lng) - #line = line.strip() + # line = line.strip() line_no = line_no + 1 try: