mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 22:38:08 +00:00
Added get_path() to transports
This commit is contained in:
parent
f00a689087
commit
e141a6f5d1
@ -52,6 +52,9 @@ class BridgeTransport(Transport):
|
||||
self.response = None
|
||||
|
||||
def __str__(self):
|
||||
return self.get_path()
|
||||
|
||||
def get_path(self):
|
||||
return '%s:%s' % (self.PATH_PREFIX, self.device['path'])
|
||||
|
||||
@staticmethod
|
||||
|
@ -79,6 +79,9 @@ class HidTransport(Transport):
|
||||
self.hid_version = None
|
||||
|
||||
def __str__(self):
|
||||
return self.get_path()
|
||||
|
||||
def get_path(self):
|
||||
return "%s:%s" % (self.PATH_PREFIX, self.device['path'].decode())
|
||||
|
||||
@staticmethod
|
||||
|
@ -56,6 +56,9 @@ class UdpTransport(Transport):
|
||||
self.socket = None
|
||||
|
||||
def __str__(self):
|
||||
return self.get_path()
|
||||
|
||||
def get_path(self):
|
||||
return "%s:%s:%s" % ((self.PATH_PREFIX,) + self.device)
|
||||
|
||||
@staticmethod
|
||||
|
@ -88,6 +88,9 @@ class WebUsbTransport(Transport):
|
||||
self.debug = debug
|
||||
|
||||
def __str__(self):
|
||||
return self.get_path()
|
||||
|
||||
def get_path(self):
|
||||
return "%s:%s" % (self.PATH_PREFIX, dev_to_str(self.device))
|
||||
|
||||
@classmethod
|
||||
|
Loading…
Reference in New Issue
Block a user