mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-03 04:30:10 +01:00
ei-scanner: Adjust annotation for list
Otherwise Python complains about: TypeError: 'type' object is not subscriptable
This commit is contained in:
parent
5332124abf
commit
8b7fb73bfd
1 changed files with 10 additions and 10 deletions
|
|
@ -17,7 +17,7 @@ Opcodes for events and request are assigned in order as they
|
|||
appear in the XML file.
|
||||
"""
|
||||
|
||||
from typing import Any, Optional, Union, Tuple
|
||||
from typing import Any, List, Optional, Tuple, Union
|
||||
from pathlib import Path
|
||||
from textwrap import dedent
|
||||
|
||||
|
|
@ -141,7 +141,7 @@ class Message:
|
|||
is_destructor: bool = attr.ib(default=False)
|
||||
context_type: Optional[str] = attr.ib(default=None)
|
||||
|
||||
arguments: list[Argument] = attr.ib(init=False, factory=list)
|
||||
arguments: List[Argument] = attr.ib(init=False, factory=list)
|
||||
|
||||
@context_type.validator # type: ignore
|
||||
def _context_type_validate(self, attr, value):
|
||||
|
|
@ -254,7 +254,7 @@ class Enum:
|
|||
is_bitfield: bool = attr.ib(default=False)
|
||||
description: Optional[Description] = attr.ib(default=None)
|
||||
|
||||
entries: list[Entry] = attr.ib(init=False, factory=list)
|
||||
entries: List[Entry] = attr.ib(init=False, factory=list)
|
||||
|
||||
@classmethod
|
||||
def create(
|
||||
|
|
@ -301,9 +301,9 @@ class Enum:
|
|||
class Interface:
|
||||
name: str = attr.ib()
|
||||
version: int = attr.ib()
|
||||
requests: list[Request] = attr.ib(init=False, factory=list)
|
||||
events: list[Event] = attr.ib(init=False, factory=list)
|
||||
enums: list[Enum] = attr.ib(init=False, factory=list)
|
||||
requests: List[Request] = attr.ib(init=False, factory=list)
|
||||
events: List[Event] = attr.ib(init=False, factory=list)
|
||||
enums: List[Enum] = attr.ib(init=False, factory=list)
|
||||
|
||||
mode: str = attr.ib() # "ei" or "eis"
|
||||
description: Optional[Description] = attr.ib(default=None)
|
||||
|
|
@ -340,7 +340,7 @@ class Interface:
|
|||
return None
|
||||
|
||||
@property
|
||||
def outgoing(self) -> list[Message]:
|
||||
def outgoing(self) -> List[Message]:
|
||||
"""
|
||||
Returns the list of messages outgoing from this implementation.
|
||||
|
||||
|
|
@ -358,7 +358,7 @@ class Interface:
|
|||
)
|
||||
|
||||
@property
|
||||
def incoming(self) -> list[Message]:
|
||||
def incoming(self) -> List[Message]:
|
||||
"""
|
||||
Returns the list of messages incoming to this implementation.
|
||||
|
||||
|
|
@ -416,13 +416,13 @@ class Copyright:
|
|||
@attr.s
|
||||
class Protocol:
|
||||
copyright: Optional[str] = attr.ib(default=None)
|
||||
interfaces: list[Interface] = attr.ib(factory=list)
|
||||
interfaces: List[Interface] = attr.ib(factory=list)
|
||||
|
||||
|
||||
@attr.s
|
||||
class ProtocolParser(xml.sax.handler.ContentHandler):
|
||||
component: str = attr.ib()
|
||||
interfaces: list[Interface] = attr.ib(factory=list)
|
||||
interfaces: List[Interface] = attr.ib(factory=list)
|
||||
copyright: Optional[Copyright] = attr.ib(init=False, default=None)
|
||||
|
||||
current_interface: Optional[Interface] = attr.ib(init=False, default=None)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue