From: Oleg Broytman Date: Sat, 19 Mar 2005 20:14:05 +0000 (+0000) Subject: Upon storint put an every comment into one line (marking eol's); X-Git-Tag: v4.5.3~318 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=f97d97b040fc8dcab4b43af16e966e0ff4c877a9;p=bookmarks_db.git Upon storint put an every comment into one line (marking eol's); Upon loading restore multi-line comments. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@58 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- diff --git a/Storage/bkmk_stflad.py b/Storage/bkmk_stflad.py index 3c017fa..031b036 100644 --- a/Storage/bkmk_stflad.py +++ b/Storage/bkmk_stflad.py @@ -2,7 +2,7 @@ Bookmarks storage module - FLAD (Flat ASCII Database) special version for compatibility with old (version 1) bkmk2db - Written by BroytMann, Feb 2000 - Aug 2004. Copyright (C) 2000-2004 PhiloSoft Design + Written by BroytMann, Feb 2000 - Mar 2005. Copyright (C) 2000-2005 PhiloSoft Design """ @@ -45,7 +45,8 @@ LastVisit: %s LastModified: %s Keyword: %s Comment: %s -""" % (level+1, b.name, b.href, b.add_date, b.last_visit, b.last_modified, b.keyword, b.comment)) +""" % (level+1, b.name, b.href, b.add_date, b.last_visit, b.last_modified, + b.keyword, b.comment.replace('\n', "\\n"))) def ruler(self, r, level): @@ -104,7 +105,10 @@ Comment: %s got_folder = record.has_key("Folder") # Test here to save got_folder for next loop if record.has_key("URL"): - bookmark = Bookmark(record["URL"], record["AddDate"], record["LastVisit"], record["LastModified"], record["Keyword"], record["Comment"]) + comment = record["Comment"].replace("\\n", '\n') + bookmark = Bookmark(record["URL"], record["AddDate"], + record["LastVisit"], record["LastModified"], + record["Keyword"], comment) bookmark.name = record["Title"] self.current_folder.append(bookmark)