How to use the ledgerblue.comm.CommException function in ledgerblue

To help you get started, we’ve selected a few ledgerblue examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github romanz / trezor-agent / libagent / device / ledger.py View on Github external
def connect(self):
        """Enumerate and connect to the first USB HID interface."""
        try:
            return comm.getDongle()
        except comm.CommException as e:
            raise interface.NotFoundError(
                '{} not connected: "{}"'.format(self, e))
github romanz / trezor-agent / trezor_agent / factory.py View on Github external
def _load_ledger():
    from ._ledger import LedgerClientConnection, CallException, IdentityType
    try:
        from ledgerblue.comm import getDongle, CommException
    except ImportError as e:
        log.warning('%s: install via "pip install ledgerblue" '
                    'if you need to support this device', e)
        return
    try:
        dongle = getDongle()
    except CommException:
        return

    yield ClientWrapper(connection=LedgerClientConnection(dongle),
                        identity_type=IdentityType,
                        device_name="ledger",
                        call_exception=CallException)