From a8cce72842351341232a75a9e65f8e3890a0315f Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 29 Dec 2007 16:01:38 +0000 Subject: [PATCH] Unquote title for comparison. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@147 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- bkmk_objects.py | 6 ++++++ check_title.py | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/bkmk_objects.py b/bkmk_objects.py index cb65303..b6905fb 100644 --- a/bkmk_objects.py +++ b/bkmk_objects.py @@ -175,3 +175,9 @@ def quote_title(title): #title = cgi.escape(title, 1).replace("'", "'") title = title.replace("'", "'") return title + +def unquote_title(title): + if BKMK_FORMAT == "MOZILLA": + from HTMLParser import HTMLParser + title = HTMLParser().unescape(title.replace("&", '&')) + return title diff --git a/check_title.py b/check_title.py index fee4c31..5c23cf6 100755 --- a/check_title.py +++ b/check_title.py @@ -6,7 +6,7 @@ """ import sys -from bkmk_objects import make_linear, quote_title +from bkmk_objects import make_linear, quote_title, unquote_title def run(): @@ -54,10 +54,11 @@ def run(): continue if hasattr(object, "real_title"): - quoted_title = quote_title(object.real_title) - if object.name <> quoted_title: + quoted_title = unquote_title(quote_title(object.real_title)) + unquoted_name = unquote_title(object.name) + if unquote_title(object.name) <> quoted_title: print object.href - print object.name + print unquoted_name print quoted_title print else: -- 2.39.5