[Xfce4-commits] [apps/catfish] 01/01: Add /dev to list of standard excluded directories

noreply at xfce.org noreply at xfce.org
Sun Jan 20 16:03:44 CET 2019


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/catfish.

commit d39b50199090c6240fa676490bc63d93503542d0
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sun Jan 20 10:03:39 2019 -0500

    Add /dev to list of standard excluded directories
---
 ChangeLog                      |  1 +
 catfish/CatfishSearchEngine.py | 28 ++++++++++++++++------------
 po/catfish.pot                 |  2 +-
 3 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e1db746..b0b0ca1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@ v1.4.7:
        in the Catfish configuration file (~/.config/catfish/catfish.rc)
  + Performance:
    - Thumbnails will now only be generated when requested (Xfce #14689)
+   - Added /dev to list of standard excluded directories
  + Bug Fixes:
    - Quoted search strings now work as expected (Xfce #14501)
    - Files can now be dragged into other applications (Xfce #14492)
diff --git a/catfish/CatfishSearchEngine.py b/catfish/CatfishSearchEngine.py
index 1cae6b1..a2ff77f 100644
--- a/catfish/CatfishSearchEngine.py
+++ b/catfish/CatfishSearchEngine.py
@@ -165,12 +165,14 @@ class CatfishSearchEngine:
 
         # Path exclusions for efficiency
         exclude = []
-        cache_path = os.path.expanduser("~/.cache")
-        if cache_path not in path:
-            exclude.append(cache_path)
-        gvfs_path = os.path.expanduser("~/.gvfs")
-        if gvfs_path not in path:
-            exclude.append(gvfs_path)
+        maybe_exclude = [
+            os.path.expanduser("~/.cache"),
+            os.path.expanduser("~/.gvfs"),
+            "/dev"
+        ]
+        for maybe_path in maybe_exclude:
+            if not path.startswith(maybe_path):
+                exclude.append(maybe_path)
 
         file_count = 0
         for method in self.methods:
@@ -296,12 +298,14 @@ class CatfishSearchMethod_Walk(CatfishSearchMethod):
         This function is a generator and will yield files as they are found or
         True if still running."""
         exclude = []
-        cache_path = os.path.expanduser("~/.cache")
-        if cache_path not in path:
-            exclude.append(cache_path)
-        gvfs_path = os.path.expanduser("~/.gvfs")
-        if gvfs_path not in path:
-            exclude.append(gvfs_path)
+        maybe_exclude = [
+            os.path.expanduser("~/.cache"),
+            os.path.expanduser("~/.gvfs"),
+            "/dev"
+        ]
+        for maybe_path in maybe_exclude:
+            if not path.startswith(maybe_path):
+                exclude.append(maybe_path)
 
         self.running = True
         if isinstance(keywords, str):
diff --git a/po/catfish.pot b/po/catfish.pot
index 61a7563..3ddcc88 100644
--- a/po/catfish.pot
+++ b/po/catfish.pot
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2019-01-20 09:44-0500\n"
+"POT-Creation-Date: 2019-01-20 10:03-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list