Improvements.

This commit is contained in:
J. Nathanael Philipp 2019-09-19 14:59:18 +02:00
parent 1e53479189
commit 2ca2ad54c7
No known key found for this signature in database
GPG Key ID: B1734342CFA62253
2 changed files with 9 additions and 8 deletions

View File

@ -43,7 +43,7 @@ The [pass-otp](https://github.com/tadfisher/pass-otp) extension is supported. Se
# Fields # 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: For example with a pass file like:
``` ```

View File

@ -25,17 +25,18 @@
# Copyright (C) 2012 Red Hat, Inc. # Copyright (C) 2012 Red Hat, Inc.
# Author: Luke Macken <lmacken@redhat.com> # Author: Luke Macken <lmacken@redhat.com>
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
import dbus.glib import dbus.glib
import dbus.service import dbus.service
import re import re
import subprocess 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. # Convenience shorthand for declaring dbus interface methods.
# s.b.n. -> search_bus_name # s.b.n. -> search_bus_name
search_bus_name = 'org.gnome.Shell.SearchProvider2' search_bus_name = 'org.gnome.Shell.SearchProvider2'
@ -122,8 +123,8 @@ class SearchPassService(dbus.service.Object):
if match: if match:
password = match.group('value') password = match.group('value')
else: else:
raise RuntimeError(f'The field {field} not found in pass' + raise RuntimeError(f'The field {field} was not found in ' +
' file.') 'the pass file.')
else: else:
password = output.split('\n', 1)[0] password = output.split('\n', 1)[0]