From 0ad84b575f3ea45452b90dacf9b79ac06bea1e83 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Sun, 23 Dec 2012 08:24:09 +0100 Subject: [PATCH] Fix the unity-lens for the new python module setup --- .../unity-lens-recoll/recollscope/rclsearch.py | 11 +++++++++-- src/recollinstall.in | 5 ++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/desktop/unity-lens-recoll/recollscope/rclsearch.py b/src/desktop/unity-lens-recoll/recollscope/rclsearch.py index 70dffe7b..42e89e04 100755 --- a/src/desktop/unity-lens-recoll/recollscope/rclsearch.py +++ b/src/desktop/unity-lens-recoll/recollscope/rclsearch.py @@ -9,7 +9,13 @@ import locale from gi.repository import Unity, GObject, Gio -import recoll +try: + from recoll import recoll + from recoll import rclextract + hasextract = True +except: + import recoll + hasextract = False BUS_PATH = "/org/recoll/unitylensrecoll/scope/main" @@ -68,7 +74,8 @@ class Scope (Unity.Scope): try: self.db = recoll.connect() self.db.setAbstractParams(maxchars=200, contextwords=4) - except: + except Exception, s: + print >> sys.stderr, "recoll-lens: Error connecting to db:", s return def get_search_string (self): diff --git a/src/recollinstall.in b/src/recollinstall.in index 98f18aeb..7033baca 100755 --- a/src/recollinstall.in +++ b/src/recollinstall.in @@ -41,6 +41,9 @@ if test -n "$DESTDIR" ; then mandir=$DESTDIR/$mandir ROOTFORPYTHON="--root=${DESTDIR}" fi +if test -f /etc/debian_version ; then + OPTSFORPYTHON=--install-layout=deb +fi echo "Installing to $PREFIX" @@ -140,4 +143,4 @@ ${INSTALL} -m 0444 ${I18N}/recoll_zh_CN.qm \ @NOPYTHON@(cd python/recoll;python setup.py install \ -@NOPYTHON@ --prefix=${REALPREFIX} ${ROOTFORPYTHON}) +@NOPYTHON@ --prefix=${REALPREFIX} ${ROOTFORPYTHON} ${OPTSFORPYTHON})