]> git.phdru.name Git - bookmarks_db.git/blobdiff - check_dups.py
Feat(Python3): Use print() function
[bookmarks_db.git] / check_dups.py
index 5da790281bf445febd2bf6b4eb980423d43901d5..f635c23ad9c48011c619a5ec0fcfaa4dcef3c818 100755 (executable)
@@ -1,23 +1,27 @@
 #! /usr/bin/env python
-"""
-   Check duplicate URLs in the bookmarks database
+"""Check duplicate URLs in the bookmarks database
 
-   Written by BroytMann, Jun 2000 - Aug 2002. Copyright (C) 2000-2002 PhiloSoft Design
+This file is a part of Bookmarks database and Internet robot.
 """
 
-
+from __future__ import print_function
 import sys
 
 
+__author__ = "Oleg Broytman <phd@phdru.name>"
+__copyright__ = "Copyright (C) 2000-2017 PhiloSoft Design"
+__license__ = "GNU GPL"
+
+
 log_file = None
 
 def report_dup(href, object_no):
    s = "Duplicate URL: %s (first at rec. %d)" % (href, object_no)
-   print s
 
    if log_file:
       log_file.write("%s\n" % s)
-
+   else:
+      print(s)
 
 
 def run():
@@ -39,7 +43,7 @@ def run():
       pass
 
    if report_stats:
-      print "BroytMann check_dups, Copyright (C) 2000 PhiloSoft Design"
+      print("Broytman check_dups, Copyright (C) 2000-2017 PhiloSoft Design")
 
    if args:
       sys.stderr.write("check_urls: too many arguments\n")
@@ -62,7 +66,7 @@ def run():
    objects = len(root_folder.linear)
 
    if report_stats:
-      print "Ok"
+      print("Ok")
 
 
    dup_dict = {}
@@ -82,8 +86,8 @@ def run():
       log_file.close()
 
    if report_stats:
-      print "Ok"
-      print objects, "objects passed"
+      print("Ok")
+      print(objects, "objects passed")
 
 
 if __name__ == '__main__':