From: Oleg Broytman Date: Sat, 13 May 2017 16:20:21 +0000 (+0300) Subject: Feat(Python3): `<>` -> `!=` X-Git-Tag: 5.0.0~121 X-Git-Url: https://git.phdru.name/?p=bookmarks_db.git;a=commitdiff_plain;h=b65d59b866ec851da9871afe9707f6b1e38866be Feat(Python3): `<>` -> `!=` --- diff --git a/bkmk-add.py b/bkmk-add.py index f0db4ea..860688e 100755 --- a/bkmk-add.py +++ b/bkmk-add.py @@ -31,7 +31,7 @@ def run(): except NameError: pass - if len(args) <> 1: + if len(args) != 1: sys.stderr.write("bkmk-add: too many or too few arguments\n") sys.stderr.write("Usage: bkmk-add [-s] [-t title] url\n") sys.exit(1) diff --git a/check_title.py b/check_title.py index c93964f..e8215e8 100755 --- a/check_title.py +++ b/check_title.py @@ -62,7 +62,7 @@ def run(): if hasattr(object, "real_title") and (object.real_title is not None): unquoted_title = unquote_title(quote_title(object.real_title)) unquoted_name = unquote_title(object.name) - if unquoted_name <> unquoted_title: + if unquoted_name != unquoted_title: print(object.href) print(unquoted_name) print(unquoted_title) diff --git a/convert_st.py b/convert_st.py index 005710b..4c0cb15 100755 --- a/convert_st.py +++ b/convert_st.py @@ -25,7 +25,7 @@ def run(): except NameError: pass - if len(args) <> 1: + if len(args) != 1: sys.stderr.write("convert_st: too many or too few arguments\n") sys.stderr.write("Usage: convert_st [-s] new_storage\n") sys.exit(1) diff --git a/parse_html/bkmk_parse_html.py b/parse_html/bkmk_parse_html.py index e951cdc..2e412ad 100644 --- a/parse_html/bkmk_parse_html.py +++ b/parse_html/bkmk_parse_html.py @@ -5,7 +5,7 @@ This file is a part of Bookmarks database and Internet robot. """ __author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 1997-2014 PhiloSoft Design" +__copyright__ = "Copyright (C) 1997-2017 PhiloSoft Design" __license__ = "GNU GPL" __all__ = ['parse_html', 'parse_filename', 'universal_charset'] @@ -147,23 +147,23 @@ def parse_html(html_text, charset=None, log=None): parser.charset = parser.charset.lower().replace("windows-", "cp") if title and parser.charset and ( - (parser.charset <> universal_charset) or - ((not charset) or (charset <> parser.charset))): + (parser.charset != universal_charset) or + ((not charset) or (charset != parser.charset))): try: if parser.meta_charset: if log: log(" META charset : %s" % parser.charset) - elif (not charset) or (charset <> parser.charset): + elif (not charset) or (charset != parser.charset): if log: log(" guessed charset: %s" % parser.charset) #if log: log(" current charset: %s" % universal_charset) if log: log(" title : %s" % title) - if parser.charset <> universal_charset: + if parser.charset != universal_charset: try: converted_title = unicode(title, parser.charset).encode(universal_charset) except UnicodeError: if log: log(" incorrect conversion from %s, converting from %s" % (parser.charset, DEFAULT_CHARSET)) converted_title = unicode(title, DEFAULT_CHARSET, "replace").encode(universal_charset, "replace") parser.charset = DEFAULT_CHARSET - if log and (converted_title <> title): log(" converted title: %s" % converted_title) + if log and (converted_title != title): log(" converted title: %s" % converted_title) except LookupError: if log: log(" unknown charset: '%s'" % parser.charset) else: @@ -173,7 +173,7 @@ def parse_html(html_text, charset=None, log=None): final_title = recode_entities(converted_title, universal_charset) parts = [s.strip() for s in final_title.replace('\r', '').split('\n')] final_title = ' '.join([s for s in parts if s]) - if log and (final_title <> converted_title): log(" final title : %s" % final_title) + if log and (final_title != converted_title): log(" final title : %s" % final_title) parser.title = final_title icon = parser.icon diff --git a/set-real_title.py b/set-real_title.py index fab938f..0029221 100755 --- a/set-real_title.py +++ b/set-real_title.py @@ -62,7 +62,7 @@ def run(): real_title = object.real_title if not real_title: real_title = object.href - if object.name <> real_title: + if object.name != real_title: object.name = real_title changed += 1 diff --git a/set-title-list.py b/set-title-list.py index bd0da40..74acae4 100755 --- a/set-title-list.py +++ b/set-title-list.py @@ -30,7 +30,7 @@ def run(): if report_stats: print("Broytman set-title-list, Copyright (C) 2003-2017 PhiloSoft Design") - if len(args) <> 1: + if len(args) != 1: sys.stderr.write("Usage: set-title-list [-s] title_list_file\n") sys.exit(1) @@ -54,8 +54,8 @@ def run(): else: # We've got 3 lines - add new entry to the mapping if titles_dict.has_key(URL): - if title <> titles_dict[URL]: - raise ValueError("titles are not identical for URL `%s': `%s' <> `%s'" % (URL, title, titles_dict[URL])) + if title != titles_dict[URL]: + raise ValueError("titles are not identical for URL `%s': `%s' != `%s'" % (URL, title, titles_dict[URL])) else: titles_dict[URL] = title @@ -92,7 +92,7 @@ def run(): URL = object.href if titles_dict.has_key(URL): name = titles_dict[URL] - if object.name <> name: + if object.name != name: object.name = name changed += 1