]> git.phdru.name Git - bookmarks_db.git/commitdiff
Upon storint put an every comment into one line (marking eol's);
authorOleg Broytman <phd@phdru.name>
Sat, 19 Mar 2005 20:14:05 +0000 (20:14 +0000)
committerOleg Broytman <phd@phdru.name>
Sat, 19 Mar 2005 20:14:05 +0000 (20:14 +0000)
Upon loading restore multi-line comments.

git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@58 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

Storage/bkmk_stflad.py

index 3c017fa12c5768546c5a5504c70b2456a82b8ada..031b03622f2918e1e196518eeb4cc3c2f240ef3f 100644 (file)
@@ -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)