Skip to content

Commit

Permalink
Always include "uniq" address in InputDevice.__str__()
Browse files Browse the repository at this point in the history
  • Loading branch information
gvalkov committed Jan 28, 2024
1 parent 595c08f commit 693a297
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions evdev/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def __init__(self, dev):
#: The physical topology of the device.
self.phys = info_res[5]

#: The unique address of the device.
#: The unique identifier of the device.
self.uniq = info_res[6]

#: The evdev protocol version.
Expand Down Expand Up @@ -283,9 +283,8 @@ def __eq__(self, other):
and self.path == other.path

def __str__(self):
msg = 'device {}, name "{}", phys "{}"{}'
uniq = ', uniq "{}"'.format(self.uniq) if self.uniq else ''
return msg.format(self.path, self.name, self.phys, uniq)
msg = 'device {}, name "{}", phys "{}", uniq "{}"'
return msg.format(self.path, self.name, self.phys, self.uniq or "")

def __repr__(self):
msg = (self.__class__.__name__, self.path)
Expand Down

0 comments on commit 693a297

Please sign in to comment.