]> git.phdru.name Git - bookmarks_db.git/blobdiff - check_dups.py
Fix(Robot): Stop splitting and un-splitting URLs
[bookmarks_db.git] / check_dups.py
index 94ae3f0a51731ad42c771db98bbaf137b69f9e61..df79df86cbe1aecea85ef89601b097c06b8c4225 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 """Check duplicate URLs in the bookmarks database
 
 This file is a part of Bookmarks database and Internet robot.
@@ -52,7 +52,7 @@ def run():
         sys.exit(1)
 
     if log_filename:
-        log_file = open(log_filename, 'w')
+        log_file = open(log_filename, 'wt')
 
     from storage import storage
     storage = storage()
@@ -69,7 +69,6 @@ def run():
     if report_stats:
         print("Ok")
 
-
     dup_dict = {}
 
     for object_no in range(objects):
@@ -77,12 +76,11 @@ def run():
 
         if object.isBookmark:
             href = object.href
-            if dup_dict.has_key(href):
+            if href in dup_dict:
                 report_dup(href, dup_dict[href])
             else:
                 dup_dict[href] = object_no
 
-
     if log_filename:
         log_file.close()