-"""
- Bookmarks storage manager - json.
+"""Bookmarks storage manager - json
- Written by Broytman, Jul 2010. Copyright (C) 2010 PhiloSoft Design
+This file is a part of Bookmarks database and Internet robot.
"""
+__version__ = "$Revision$"[11:-2]
+__revision__ = "$Id$"[5:-2]
+__date__ = "$Date$"[7:-2]
+__author__ = "Oleg Broytman <phd@phdru.name>"
+__copyright__ = "Copyright (C) 2010, 2011 PhiloSoft Design"
+__license__ = "GNU GPL"
+
+__all__ = ['storage_json']
+
try:
import json
outfile.close()
del self.dict
-
def load(self):
infile = open(self.filename, 'rb')
bkmk_s = infile.read()
# Work around a bug in Mozilla - remove the trailing comma
bkmk_s = bkmk_s.strip().replace(',]', ']')
bookmarks_dict = json.loads(bkmk_s)
+ del bkmk_s
root_folder = Folder()
root_folder.header = ''
def load_folder(self, folder, fdict):
if fdict["type"] != "text/x-moz-place-container":
- raise ValueError("Root object is not a Mozilla container")
+ raise ValueError("The object is not a Mozilla container")
folder.id = fdict["id"]
folder.index = fdict.get("index")