mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-04-20 21:20:47 +02:00
scanner: add the Interface.plainname property
Returns "connection" for the "ei_connection" interface, i.e. the interface stripped of any component prefix.
This commit is contained in:
parent
708d0f57e8
commit
f142f802f4
1 changed files with 10 additions and 0 deletions
|
|
@ -317,6 +317,16 @@ class Interface:
|
|||
"""
|
||||
return Interface.mangle_name(self.protocol_name, self.mode)
|
||||
|
||||
@property
|
||||
def plainname(self) -> str:
|
||||
"""
|
||||
Returns the plain name of the interface, i.e. this returns
|
||||
"pointer", "handshake", etc. without the "ei_" or "eis_" prefix.
|
||||
"""
|
||||
if self.protocol_name.startswith("ei_"):
|
||||
return f"{self.protocol_name[3:]}"
|
||||
return self.protocol_name
|
||||
|
||||
@staticmethod
|
||||
def mangle_name(name: str, component: str) -> str:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue