diff --git a/setup.py b/setup.py index 1501fdc..b0e9f72 100644 --- a/setup.py +++ b/setup.py @@ -9,8 +9,7 @@ setup( author_email='roman.zeyde@gmail.com', url='http://github.com/romanz/trezor-agent', packages=['trezor_agent', 'trezor_agent.gpg'], - install_requires=['ecdsa>=0.13', 'ed25519>=1.4', 'Cython>=0.23.4', 'protobuf>=3.0.0', 'trezor>=0.7.4', 'semver>=2.2', - 'keepkey>=0.7.3'], + install_requires=['ecdsa>=0.13', 'ed25519>=1.4', 'Cython>=0.23.4', 'protobuf>=3.0.0', 'trezor>=0.7.4', 'semver>=2.2'], platforms=['POSIX'], classifiers=[ 'Environment :: Console', @@ -28,6 +27,10 @@ setup( 'Topic :: Security', 'Topic :: Utilities', ], + extras_require={ + 'trezorlib': ['python-trezor>=0.7.4'], + 'keepkeylib': ['keepkey>=0.7.3'], + }, entry_points={'console_scripts': [ 'trezor-agent = trezor_agent.__main__:run_agent', 'trezor-git = trezor_agent.__main__:run_git', diff --git a/trezor_agent/factory.py b/trezor_agent/factory.py index 50da0f3..fb97509 100644 --- a/trezor_agent/factory.py +++ b/trezor_agent/factory.py @@ -92,8 +92,9 @@ def load(loaders=None): device = loader() if device: device_list.extend(device) + break # stop polling if we found the device... - if len(device_list) == 1: + if len(device_list) == 1: # ...especialy when we need exactly one return device_list[0] msg = '{:d} devices found'.format(len(device_list)) diff --git a/trezor_agent/gpg/keyring.py b/trezor_agent/gpg/keyring.py index eeea055..caf9cdf 100644 --- a/trezor_agent/gpg/keyring.py +++ b/trezor_agent/gpg/keyring.py @@ -18,7 +18,7 @@ def get_agent_sock_path(sp=subprocess): """Parse gpgconf output to find out GPG agent UNIX socket path.""" lines = sp.check_output(['gpgconf', '--list-dirs']).strip().split(b'\n') dirs = dict(line.split(b':', 1) for line in lines) - return dirs['agent-socket'] + return dirs[b'agent-socket'] def connect_to_agent(sp=subprocess):