Commits

medoc  committed 7e64660

use the rclconfig module if it is installed to find out and setup the external indexes according to current configuration

  • Participants
  • Parent commits b62f276

Comments (0)

Files changed (1)

File src/desktop/unity-lens-recoll/recollscope/rclsearch.py

 import hashlib
 import os
 import locale
+from gi.repository import Unity, GObject, Gio
 
-from gi.repository import Unity, GObject, Gio
+try:
+    import rclconfig
+    hasrclconfig = True
+except:
+    hasrclconfig = False
 
 try:
     from recoll import recoll
         self.last_connect_time = 0
         self.timeout_id = None
         language, self.localecharset = locale.getdefaultlocale()
+        if hasrclconfig:
+            self.config = rclconfig.RclConfig()
 
     def _connect_db(self):
         #print "Connecting to db"
         self.db = None
+        dblist = []
+        if hasrclconfig:
+            extradbs = rclconfig.RclExtraDbs(self.config)
+            dblist = extradbs.getActDbs()
         try:
-            self.db = recoll.connect()
+            self.db = recoll.connect(extra_dbs=dblist)
             self.db.setAbstractParams(maxchars=200, contextwords=4)
         except Exception, s:
             print >> sys.stderr, "recoll-lens: Error connecting to db:", s