X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=set-title-list.py;h=be0684c15acad921c9f7e04dca9afe3d1fce4109;hb=43c428bf639a603c34669f67989ff5343d2a02d7;hp=065407ed1449c04adf35e6154f4620dacbcee09d;hpb=e2c7ec4349db18acd4c8d0902b0a5ab2cffd5be7;p=bookmarks_db.git diff --git a/set-title-list.py b/set-title-list.py index 065407e..be0684c 100755 --- a/set-title-list.py +++ b/set-title-list.py @@ -42,7 +42,7 @@ def run(): URL = None title = None - title_list_file = open(args[0], 'r') + title_list_file = open(args[0], 'rt') for line in title_list_file: line = line[:-1] # strip trailing newline if URL is None: @@ -58,7 +58,7 @@ def run(): ) else: # We've got 3 lines - add new entry to the mapping - if titles_dict.has_key(URL): + if URL in titles_dict: if title != titles_dict[URL]: raise ValueError( "titles are not identical for URL `%s': `%s' != `%s'" @@ -96,7 +96,7 @@ def run(): if object.isBookmark: URL = object.href - if titles_dict.has_key(URL): + if URL in titles_dict: name = titles_dict[URL] if object.name != name: object.name = name