Folder: %s
AddDate: %s
Comment: %s
-""" % (level, f.name, f.add_date, f.comment))
-
+LastModified: %s
+""" % (level, f.name, f.add_date, f.comment, f.last_modified or ''))
def bookmark(self, b, level):
self.outfile.write("""
self.current_folder.append(bookmark)
elif record.has_key("Folder"):
- folder = Folder(record["AddDate"], record["Comment"])
+ folder = Folder(record["AddDate"], record["Comment"], record["LastModified"])
folder.name = record["Folder"]
self.current_folder.append(folder)
self.folder_stack.append(folder)
Folder: %s
AddDate: %s
Comment: %s
-""" % (level, f.name, strftime(f.add_date), f.comment))
+LastModified: %s
+""" % (level, f.name, strftime(f.add_date), f.comment, f.last_modified or ''))
def bookmark(self, b, level):
self._folder(f, 0)
def start_folder(self, f, level):
- self.outfile.write(ind_s*level + '<DT><H3 ADD_DATE="%s">%s</H3>\n' % (f.add_date, f.name))
+ self.outfile.write(ind_s*level + '<DT><H3 ADD_DATE="%s"' % f.add_date)
+ if f.last_modified:
+ self.outfile.write(' LAST_MODIFIED="%s"' % f.last_modified)
+ self.outfile.write('>%s</H3>\n' % f.name)
self._folder(f, level)
def end_folder(self, f, level):
"""
Objects to represent bookmarks.html structure
- Written by BroytMann, Mar 2000 - Aug 2004. Copyright (C) 2000-2004 PhiloSoft Design
+ Written by BroytMann, Mar 2000 - Sep 2007. Copyright (C) 2000-2007 PhiloSoft Design
"""
isFolder = 1
isBookmark = 0
- def __init__(self, add_date = None, comment = ''):
+ def __init__(self, add_date = None, comment = '', last_modified=None):
UserList.__init__(self)
self.comment = comment
self.add_date = add_date
-
+ self.last_modified = last_modified
def walk_depth(self, walker, level=0):
if hasattr(self, "header"): # root folder
"""
Parser for Netscape Navigator's and Mozilla's bookmarks.html
- Written by BroytMann. Copyright (C) 1997-2005 PhiloSoft Design
+ Written by BroytMann. Copyright (C) 1997-2007 PhiloSoft Design
"""
# Start a folder
def start_h3(self, attrs):
+ last_modified = None
for attrname, value in attrs:
value = value.strip()
if attrname == 'add_date':
add_date = value
+ elif attrname == 'last_modified':
+ last_modified = value
debug("New folder...")
- folder = Folder(add_date)
+ folder = Folder(add_date, last_modified=last_modified)
self.current_object = folder
self.current_folder.append(folder)
self.folder_stack.append(folder) # push new folder
-Store LAST_MODIFIED in folder's attributes.
-
Store icon, charset in bookmark's attributes.
ICON="data:image/x-icon;base64,AAABAAIAEBAQAAAAAAAoAQAAJgAAACAgEAAAAAAA6AIAAE4BAAAoAAAAEAAAACAAAAABAAQAAAAAAMAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAACZAJmZAAAAAAmQCZAAAAAACZAJkAAAAAAJkAmQAAAAAAmQCZAAAAAACZAJkAAAAAAAmZmQAAAAAACZmZAAAAAACZAJkAAAAAAJkAmQAAAAAAmQCZAAAAAACZAJkAAAAAAJkAmQAAAAAACZmZkAAAAAAAAAAAAA//////MP///5n///+Z////mf///5n///+Z////wf///8H///+Z////mf///5n///+Z////mf///8D////////ygAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmZkAAJmZmZkAAAAAAAAAAJmZkACZmZmZAAAAAAAAAAAAmZkAAJmZAAAAAAAAAAAAAJmZAACZmQAAAAAAAAAAAACZmQAAmZkAAAAAAAAAAAAAmZkAAJmZAAAAAAAAAAAAAJmZAACZmQAAAAAAAAAAAACZmQAAmZkAAAAAAAAAAAAAmZkAAJmZAAAAAAAAAAAAAJmZAACZmQAAAAAAAAAAAACZmQAAmZkAAAAAAAAAAAAACZmQAJmZAAAAAAAAAAAAAAmZmZmZmQAAAAAAAAAAAAAAmZmZmZkAAAAAAAAAAAAAAJmZmZmZAAAAAAAAAAAAAAmZmZmZmQAAAAAAAAAAAAAJmZAAmZkAAAAAAAAAAAAAmZkAAJmZAAAAAAAAAAAAAJmZAACZmQAAAAAAAAAAAACZmQAAmZkAAAAAAAAAAAAAmZkAAJmZAAAAAAAAAAAAAJmZAACZmQAAAAAAAAAAAACZmQAAmZkAAAAAAAAAAAAAmZkAAJmZAAAAAAAAAAAAAJmZAACZmQAAAAAAAAAAAAAJmZAAmZkAAAAAAAAAAAAACZmZmZmZmQAAAAAAAAAAAACZmZmZmZkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8PAP//BwD//8PD///Dw///w8P//8PD///Dw///w8P//8PD///Dw///w8P//+HD///gA///8AP///AD///gA///4cP//8PD///Dw///w8P//8PD///Dw///w8P//8PD///Dw///4cP//+AA///wAP///////////w=="
LAST_CHARSET="windows-1251"