예제 #1
0
 def init_scoutfish(self):
     """ Create/open .scout database index file to help querying
         using scoutfish from https://github.com/mcostalba/scoutfish
     """
     if scoutfish_path is not None and self.path and self.size > 0:
         try:
             if self.progressbar is not None:
                 from gi.repository import GLib
                 GLib.idle_add(self.progressbar.set_text,
                               _("Creating .scout index file..."))
             self.scoutfish = Scoutfish(engine=(scoutfish_path, ))
             self.scoutfish.open(self.path)
             scout_path = os.path.splitext(self.path)[0] + '.scout'
             if getmtime(self.path) > getmtime(scout_path):
                 self.scoutfish.make()
         except OSError as err:
             self.scoutfish = None
             log.warning("Failed to sart scoutfish. OSError %s %s" %
                         (err.errno, err.strerror))
         except pexpect.TIMEOUT:
             self.scoutfish = None
             log.warning("scoutfish failed (pexpect.TIMEOUT)")
         except pexpect.EOF:
             self.scoutfish = None
             log.warning("scoutfish failed (pexpect.EOF)")
예제 #2
0
 def init_scoutfish(self):
     # Create/open .scout database index file to help querying
     # using scoutfish from https://github.com/mcostalba/scoutfish
     if scoutfish_path is not None and self.path and self.size > 0:
         try:
             if self.progressbar is not None:
                 self.progressbar.set_text("Creating .scout index file...")
             self.scoutfish = Scoutfish(engine=scoutfish_path)
             self.scoutfish.open(self.path)
             scout_path = os.path.splitext(self.path)[0] + '.scout'
             if getmtime(self.path) > getmtime(scout_path):
                 self.scoutfish.make()
         except OSError as err:
             self.scoutfish = None
             log.debug("Failed to sart scoutfish. OSError %s %s" %
                       (err.errno, err.strerror))
         except pexpect.TIMEOUT:
             self.scoutfish = None
             print("scoutfish failed (pexpect.TIMEOUT)")
         except pexpect.EOF:
             self.scoutfish = None
             print("scoutfish failed (pexpect.EOF)")