mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 06:48:16 +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
|
self.response = None
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
return self.get_path()
|
||||||
|
|
||||||
|
def get_path(self):
|
||||||
return '%s:%s' % (self.PATH_PREFIX, self.device['path'])
|
return '%s:%s' % (self.PATH_PREFIX, self.device['path'])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -79,6 +79,9 @@ class HidTransport(Transport):
|
|||||||
self.hid_version = None
|
self.hid_version = None
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
return self.get_path()
|
||||||
|
|
||||||
|
def get_path(self):
|
||||||
return "%s:%s" % (self.PATH_PREFIX, self.device['path'].decode())
|
return "%s:%s" % (self.PATH_PREFIX, self.device['path'].decode())
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -56,6 +56,9 @@ class UdpTransport(Transport):
|
|||||||
self.socket = None
|
self.socket = None
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
return self.get_path()
|
||||||
|
|
||||||
|
def get_path(self):
|
||||||
return "%s:%s:%s" % ((self.PATH_PREFIX,) + self.device)
|
return "%s:%s:%s" % ((self.PATH_PREFIX,) + self.device)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -88,6 +88,9 @@ class WebUsbTransport(Transport):
|
|||||||
self.debug = debug
|
self.debug = debug
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
return self.get_path()
|
||||||
|
|
||||||
|
def get_path(self):
|
||||||
return "%s:%s" % (self.PATH_PREFIX, dev_to_str(self.device))
|
return "%s:%s" % (self.PATH_PREFIX, dev_to_str(self.device))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user