From 2ca2ad54c78716e2367e5754911113055391980d Mon Sep 17 00:00:00 2001 From: "J. Nathanael Philipp" Date: Thu, 19 Sep 2019 14:59:18 +0200 Subject: [PATCH] Improvements. --- README.md | 2 +- gnome-pass-search-provider.py | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ce7d4f2..1bcce0d 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ The [pass-otp](https://github.com/tadfisher/pass-otp) extension is supported. Se # Fields -To copy other values than the password in the first line from a pass file, start the search with `:NAME search...`. This requieres `GPaste`. +To copy other values than the password in the first line from a pass file, start the search with `:NAME search...`. The field name must be a full but case insensitive match. This requires `GPaste`. For example with a pass file like: ``` diff --git a/gnome-pass-search-provider.py b/gnome-pass-search-provider.py index aa83ec3..b4a924d 100755 --- a/gnome-pass-search-provider.py +++ b/gnome-pass-search-provider.py @@ -25,17 +25,18 @@ # Copyright (C) 2012 Red Hat, Inc. # Author: Luke Macken -from fuzzywuzzy import process, fuzz -from gi.repository import GLib -from os import getenv, walk -from os.path import expanduser, join as path_join - import dbus import dbus.glib import dbus.service import re import subprocess +from os import getenv, walk +from os.path import expanduser, join as path_join + +from gi.repository import GLib +from fuzzywuzzy import process, fuzz + # Convenience shorthand for declaring dbus interface methods. # s.b.n. -> search_bus_name search_bus_name = 'org.gnome.Shell.SearchProvider2' @@ -122,8 +123,8 @@ class SearchPassService(dbus.service.Object): if match: password = match.group('value') else: - raise RuntimeError(f'The field {field} not found in pass' + - ' file.') + raise RuntimeError(f'The field {field} was not found in ' + + 'the pass file.') else: password = output.split('\n', 1)[0]