root_folder = Folder()
root_folder.header = ''
+ root_folder.add_date = bookmarks_dict["dateAdded"]
+ root_folder.comment = ''
+ root_folder.last_modified = bookmarks_dict["lastModified"]
self.folder_stack = [root_folder]
self.current_folder = root_folder
return root_folder
- def load_folder(self, folder, _dict):
- if _dict["type"] != "text/x-moz-place-container":
+ def load_folder(self, folder, fdict):
+ if fdict["type"] != "text/x-moz-place-container":
raise ValueError("Root object is not a Mozilla container")
- folder.id = _dict["id"]
- folder.index = _dict.get("index")
- folder.parent_idx = _dict.get("parent")
+ folder.id = fdict["id"]
+ folder.index = fdict.get("index")
+ folder.parent_idx = fdict.get("parent")
+ folder.name = encode(fdict["title"])
- folder.name = encode(_dict["title"])
- folder.comment = ''
- folder.add_date = _dict["dateAdded"]
- folder.last_modified = _dict["lastModified"]
-
- for record in _dict["children"]:
+ for record in fdict["children"]:
if record["type"] == "text/x-moz-place-container":
folder = Folder(
add_date=record["dateAdded"],
comment=get_comment(record.get("annos")),
last_modified=record["lastModified"])
- folder.id = record["id"]
- folder.parent_idx = record["parent"]
- folder.name = encode(record["title"])
self.current_folder.append(folder)
self.folder_stack.append(folder)
self.current_folder = folder