[Python-apps-commits] r10912 - in packages/kupfer/trunk/debian/patches (1 file)
hugo6390-guest at users.alioth.debian.org
hugo6390-guest at users.alioth.debian.org
Sat Jun 7 15:18:19 UTC 2014
Date: Saturday, June 7, 2014 @ 15:18:18
Author: hugo6390-guest
Revision: 10912
Added debian/patches/bookmarks-places.sqlite.patch
Added:
packages/kupfer/trunk/debian/patches/bookmarks-places.sqlite.patch
Added: packages/kupfer/trunk/debian/patches/bookmarks-places.sqlite.patch
===================================================================
--- packages/kupfer/trunk/debian/patches/bookmarks-places.sqlite.patch (rev 0)
+++ packages/kupfer/trunk/debian/patches/bookmarks-places.sqlite.patch 2014-06-07 15:18:18 UTC (rev 10912)
@@ -0,0 +1,37 @@
+From: Itaï BEN YAACOV <candeb at free.fr>
+Subject: Fix the error when reading firefox bookmark files
+ * Read firefox bookmarks from places.sqlite
+
+Bug-Debian: http://bugs.debian.org/749067
+Last-Update: 2014-06-07
+
+--- kupfer-0+v208.orig/kupfer/plugin/firefox.py
++++ kupfer-0+v208/kupfer/plugin/firefox.py
+@@ -65,12 +65,21 @@ class BookmarksSource (AppLeafContentMix
+ self.output_exc()
+
+ def _get_ffx3_bookmarks(self, fpath):
+- """Parse Firefox' .json bookmarks backups"""
+- from kupfer.plugin import firefox3_support
+- self.output_debug("Parsing", fpath)
+- bookmarks = firefox3_support.get_bookmarks(fpath)
+- for book in bookmarks:
+- yield UrlLeaf(book["uri"], book["title"])
++ """Query the firefox places bookmark database"""
++ fpath = firefox_support.get_firefox_home_file("places.sqlite")
++ if not (fpath and os.path.isfile(fpath)):
++ return
++ try:
++ self.output_debug("Reading bookmarks from", fpath)
++ with closing(sqlite3.connect(fpath, timeout=1)) as conn:
++ c = conn.cursor()
++ c.execute("""SELECT moz_places.url, moz_bookmarks.title
++ FROM moz_places, moz_bookmarks
++ WHERE moz_places.id = moz_bookmarks.fk""")
++ return [UrlLeaf(url, title) for url, title in c]
++ except sqlite3.Error:
++ # Something is wrong with the database
++ self.output_exc()
+
+ def _get_ffx2_bookmarks(self, fpath):
+ """Parse Firefox' bookmarks.html"""
More information about the Python-apps-commits
mailing list