]> git.phdru.name Git - bookmarks_db.git/commitdiff
Separate Netscape and Mozilla formats.
authorOleg Broytman <phd@phdru.name>
Sun, 23 Sep 2007 13:03:53 +0000 (13:03 +0000)
committerOleg Broytman <phd@phdru.name>
Sun, 23 Sep 2007 13:03:53 +0000 (13:03 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@71 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

Writers/bkmk_whtml.py

index f2986fd4577ffed773740ef2fe5092d287cdfc6d..3fe863719d94851385d7f8b4e544fb4376e9ff90 100644 (file)
@@ -6,7 +6,11 @@
 
 
 import os
-NSFORMAT = os.environ.has_key("BKMK_NSFORMAT")
+MZFORMAT = os.environ.has_key("BKMK_MZFORMAT")
+if MZFORMAT:
+   NSFORMAT = True
+else:
+   NSFORMAT = os.environ.has_key("BKMK_NSFORMAT")
 
 
 def dump_comment(comment):
@@ -35,7 +39,7 @@ class writer_html(Writer):
 
    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 MZFORMAT and f.last_modified: self.outfile.write(' LAST_MODIFIED="%s"' % f.last_modified)
       self.outfile.write('>%s</H3>\n' % f.name)
       self._folder(f, level)
 
@@ -44,9 +48,10 @@ class writer_html(Writer):
 
    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)
+      if MZFORMAT:
+         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))