Bookmarks storage module - FLAD (Flat ASCII Database)
special version for compatibility with old (version 1) bkmk2db
- Written by BroytMann, Feb 2000 - Mar 2005. Copyright (C) 2000-2005 PhiloSoft Design
+ Written by BroytMann, Feb 2000 - Sep 2007. Copyright (C) 2000-2007 PhiloSoft Design
"""
LastModified: %s
Keyword: %s
Comment: %s
+Icon: %s
+Charset: %s
""" % (level+1, b.name, b.href, b.add_date, b.last_visit, b.last_modified,
- b.keyword, b.comment.replace('\n', "\\n")))
+ b.keyword, b.comment.replace('\n', "\\n"), b.icon or '', b.charset or ''))
def ruler(self, r, level):
"""
Dump bookmarks db to a more readable FLAD after check_urls
- Written by BroytMann, Apr 2000 - Aug 2004. Copyright (C) 2000-2004 PhiloSoft Design
+ Written by BroytMann, Apr 2000 - Sep 2007. Copyright (C) 2000-2007 PhiloSoft Design
"""
for attr_name, attr_out in (("error", "Error"), ("no_error", "NoError"),
("moved", "Moved"), ("size", "Size"), ("md5", "Md5"),
- ("real_title", "RealTitle"), ("test_time", "TestTime")):
+ ("real_title", "RealTitle"), ("test_time", "TestTime"),
+ ("icon", "Icon"), ("charset", "Charset")):
if hasattr(b, attr_name):
self.outfile.write("\n%s: %s" % (attr_out, getattr(b, attr_name)))
"""
Convert a bkmk database back to bookmarks.html
- Written by BroytMann. Copyright (C) 2000-2004 PhiloSoft Design
+ Written by BroytMann. Copyright (C) 2000-2007 PhiloSoft Design
"""
def start_folder(self, f, level):
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)
+ 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 bookmark(self, b, level):
self.outfile.write(ind_s*(level+1) + '<DT><A HREF="%s" ADD_DATE="%s" LAST_VISIT="%s" LAST_MODIFIED="%s"' % (b.href, b.add_date, b.last_visit, b.last_modified))
if b.keyword: self.outfile.write(' SHORTCUTURL="%s"' % b.keyword)
+ if b.icon: self.outfile.write(' ICON="%s"' % b.icon)
+ if b.charset: self.outfile.write(' LAST_CHARSET="%s"' % b.charset)
self.outfile.write('>%s</A>\n' % b.name)
if b.comment: self.outfile.write('<DD>%s\n' % dump_comment(b.comment))
isFolder = 1
isBookmark = 0
- def __init__(self, add_date = None, comment = '', last_modified=None):
+ def __init__(self, add_date=None, comment='', last_modified=None):
UserList.__init__(self)
self.comment = comment
self.add_date = add_date
isBookmark = 1
def __init__(self, href, add_date, last_visit=None, last_modified=None,
- keyword=None, comment = ''):
- self.comment = comment
+ keyword=None, comment='', icon=None, charset=None):
self.href = href
self.add_date = add_date
self.last_visit = last_visit
self.last_modified = last_modified
self.keyword = keyword
+ self.comment = comment
+ self.icon = icon
+ self.charset = charset
class Ruler:
last_visit = None
last_modified = None
keyword = None
+ icon = None
+ charset = None
for attrname, value in attrs:
value = value.strip()
last_modified = value
elif attrname == "shortcuturl":
keyword = value
+ elif attrname == "icon":
+ icon = value
+ elif attrname == "last_charset":
+ charset = value
debug("Bookmark points to: `%s'" % href)
- bookmark = Bookmark(href, add_date, last_visit, last_modified, keyword or '')
+ bookmark = Bookmark(href, add_date, last_visit, last_modified,
+ keyword or '', '', icon, charset)
self.current_object = bookmark
self.current_folder.append(bookmark)
self.urls += 1
-Store icon, charset in bookmark's attributes.
+Store icon and 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"