From 26d46a725a5bce588013662744d2c20345fdea59 Mon Sep 17 00:00:00 2001 From: Jonathan Lestrelin Date: Mon, 2 Oct 2017 00:33:07 +0200 Subject: [PATCH] Make sure that non-gpg files are not shown in the search results. Fix some typos and PEP8 stuff. --- gnome-pass-search-provider.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gnome-pass-search-provider.py b/gnome-pass-search-provider.py index 651ba69..b287dea 100755 --- a/gnome-pass-search-provider.py +++ b/gnome-pass-search-provider.py @@ -6,13 +6,13 @@ # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# gnome-pass-search-providers is distributed in the hope that it will be useful, +# gnome-pass-search-provider is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with search-pass. If not, see +# along with gnome-pass-search-provider. If not, see # . # Copyright (C) 2017 Jonathan Lestrelin @@ -94,12 +94,14 @@ class SearchPassService(dbus.service.Object): continue for filename in files: + if filename[-4:] != '.gpg': + continue path = path_join(dir_path, filename)[:-4] for name in path.split('/'): matcher.set_seq1(name) score = matcher.ratio() - - if score >= 0.5 and (path not in matches or score > matches[path]): + if score >= 0.5 and \ + (path not in matches or score > matches[path]): matches[path] = score return sorted(matches, key=matches.__getitem__, reverse=True)