evdev 1.9.1__tar.gz → 1.9.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {evdev-1.9.1/src/evdev.egg-info → evdev-1.9.2}/PKG-INFO +3 -2
  2. {evdev-1.9.1 → evdev-1.9.2}/pyproject.toml +2 -2
  3. {evdev-1.9.1 → evdev-1.9.2}/setup.py +10 -3
  4. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/device.py +6 -4
  5. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/genecodes_c.py +11 -6
  6. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/util.py +2 -2
  7. {evdev-1.9.1 → evdev-1.9.2/src/evdev.egg-info}/PKG-INFO +3 -2
  8. {evdev-1.9.1 → evdev-1.9.2}/LICENSE +0 -0
  9. {evdev-1.9.1 → evdev-1.9.2}/MANIFEST.in +0 -0
  10. {evdev-1.9.1 → evdev-1.9.2}/README.md +0 -0
  11. {evdev-1.9.1 → evdev-1.9.2}/setup.cfg +0 -0
  12. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/__init__.py +0 -0
  13. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/ecodes.py +0 -0
  14. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/ecodes_runtime.py +0 -0
  15. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/eventio.py +0 -0
  16. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/eventio_async.py +0 -0
  17. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/events.py +0 -0
  18. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/evtest.py +0 -0
  19. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/ff.py +0 -0
  20. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/genecodes_py.py +0 -0
  21. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/input.c +0 -0
  22. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/py.typed +0 -0
  23. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/uinput.c +0 -0
  24. {evdev-1.9.1 → evdev-1.9.2}/src/evdev/uinput.py +0 -0
  25. {evdev-1.9.1 → evdev-1.9.2}/src/evdev.egg-info/SOURCES.txt +0 -0
  26. {evdev-1.9.1 → evdev-1.9.2}/src/evdev.egg-info/dependency_links.txt +0 -0
  27. {evdev-1.9.1 → evdev-1.9.2}/src/evdev.egg-info/top_level.txt +0 -0
  28. {evdev-1.9.1 → evdev-1.9.2}/tests/test_ecodes.py +0 -0
  29. {evdev-1.9.1 → evdev-1.9.2}/tests/test_events.py +0 -0
  30. {evdev-1.9.1 → evdev-1.9.2}/tests/test_uinput.py +0 -0
  31. {evdev-1.9.1 → evdev-1.9.2}/tests/test_util.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: evdev
3
- Version: 1.9.1
3
+ Version: 1.9.2
4
4
  Summary: Bindings to the Linux input handling subsystem
5
5
  Author-email: Georgi Valkov <georgi.t.valkov@gmail.com>
6
6
  Maintainer-email: Tobi <proxima@sezanzeb.de>
@@ -46,6 +46,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
46
46
  Requires-Python: >=3.8
47
47
  Description-Content-Type: text/markdown
48
48
  License-File: LICENSE
49
+ Dynamic: license-file
49
50
 
50
51
  # evdev
51
52
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "evdev"
7
- version = "1.9.1"
7
+ version = "1.9.2"
8
8
  description = "Bindings to the Linux input handling subsystem"
9
9
  keywords = ["evdev", "input", "uinput"]
10
10
  readme = "README.md"
@@ -36,7 +36,7 @@ line-length = 120
36
36
  ignore = ["E265", "E241", "F403", "F401", "E401", "E731"]
37
37
 
38
38
  [tool.bumpversion]
39
- current_version = "1.9.1"
39
+ current_version = "1.9.2"
40
40
  commit = true
41
41
  tag = true
42
42
  allow_dirty = true
@@ -14,7 +14,7 @@ curdir = Path(__file__).resolve().parent
14
14
  ecodes_c_path = curdir / "src/evdev/ecodes.c"
15
15
 
16
16
 
17
- def create_ecodes(headers=None):
17
+ def create_ecodes(headers=None, reproducible=False):
18
18
  if not headers:
19
19
  include_paths = set()
20
20
  cpath = os.environ.get("CPATH", "").strip()
@@ -65,7 +65,10 @@ def create_ecodes(headers=None):
65
65
 
66
66
  print("writing %s (using %s)" % (ecodes_c_path, " ".join(headers)))
67
67
  with ecodes_c_path.open("w") as fh:
68
- cmd = [sys.executable, "src/evdev/genecodes_c.py", "--ecodes", *headers]
68
+ cmd = [sys.executable, "src/evdev/genecodes_c.py"]
69
+ if reproducible:
70
+ cmd.append("--reproducible")
71
+ cmd.extend(["--ecodes", *headers])
69
72
  run(cmd, check=True, stdout=fh)
70
73
 
71
74
 
@@ -74,17 +77,21 @@ class build_ecodes(Command):
74
77
 
75
78
  user_options = [
76
79
  ("evdev-headers=", None, "colon-separated paths to input subsystem headers"),
80
+ ("reproducible", None, "hide host details (host/paths) to create a reproducible output"),
77
81
  ]
78
82
 
79
83
  def initialize_options(self):
80
84
  self.evdev_headers = None
85
+ self.reproducible = False
81
86
 
82
87
  def finalize_options(self):
83
88
  if self.evdev_headers:
84
89
  self.evdev_headers = self.evdev_headers.split(":")
90
+ if self.reproducible is None:
91
+ self.reproducible = False
85
92
 
86
93
  def run(self):
87
- create_ecodes(self.evdev_headers)
94
+ create_ecodes(self.evdev_headers, reproducible=self.reproducible)
88
95
 
89
96
 
90
97
  class build_ext(_build_ext.build_ext):
@@ -1,6 +1,6 @@
1
1
  import contextlib
2
2
  import os
3
- from typing import Dict, Iterator, List, Literal, NamedTuple, Tuple, Union, overload
3
+ from typing import Dict, Generic, Iterator, List, Literal, NamedTuple, Tuple, TypeVar, Union, overload
4
4
 
5
5
  from . import _input, ecodes, util
6
6
 
@@ -9,6 +9,8 @@ try:
9
9
  except ImportError:
10
10
  from .eventio import EvdevError, EventIO
11
11
 
12
+ _AnyStr = TypeVar("_AnyStr", str, bytes)
13
+
12
14
 
13
15
  class AbsInfo(NamedTuple):
14
16
  """Absolute axis information.
@@ -100,14 +102,14 @@ class DeviceInfo(NamedTuple):
100
102
  return msg.format(*self) # pylint: disable=not-an-iterable
101
103
 
102
104
 
103
- class InputDevice(EventIO):
105
+ class InputDevice(EventIO, Generic[_AnyStr]):
104
106
  """
105
107
  A linux input device from which input events can be read.
106
108
  """
107
109
 
108
110
  __slots__ = ("path", "fd", "info", "name", "phys", "uniq", "_rawcapabilities", "version", "ff_effects_count")
109
111
 
110
- def __init__(self, dev: Union[str, bytes, os.PathLike]):
112
+ def __init__(self, dev: Union[_AnyStr, "os.PathLike[_AnyStr]"]):
111
113
  """
112
114
  Arguments
113
115
  ---------
@@ -116,7 +118,7 @@ class InputDevice(EventIO):
116
118
  """
117
119
 
118
120
  #: Path to input device.
119
- self.path = dev if not hasattr(dev, "__fspath__") else dev.__fspath__()
121
+ self.path: _AnyStr = dev if not hasattr(dev, "__fspath__") else dev.__fspath__()
120
122
 
121
123
  # Certain operations are possible only when the device is opened in read-write mode.
122
124
  try:
@@ -15,22 +15,27 @@ headers = [
15
15
  "/usr/include/linux/uinput.h",
16
16
  ]
17
17
 
18
- opts, args = getopt.getopt(sys.argv[1:], "", ["ecodes", "stubs"])
18
+ opts, args = getopt.getopt(sys.argv[1:], "", ["ecodes", "stubs", "reproducible"])
19
19
  if not opts:
20
- print("usage: genecodes.py [--ecodes|--stubs] <headers>")
20
+ print("usage: genecodes.py [--ecodes|--stubs] [--reproducible] <headers>")
21
21
  exit(2)
22
22
 
23
23
  if args:
24
24
  headers = args
25
25
 
26
+ reproducible = ("--reproducible", "") in opts
27
+
26
28
 
27
29
  # -----------------------------------------------------------------------------
28
30
  macro_regex = r"#define\s+((?:KEY|ABS|REL|SW|MSC|LED|BTN|REP|SND|ID|EV|BUS|SYN|FF|UI_FF|INPUT_PROP)_\w+)"
29
31
  macro_regex = re.compile(macro_regex)
30
32
 
31
- # Uname without hostname.
32
- uname = list(os.uname())
33
- uname = " ".join((uname[0], *uname[2:]))
33
+ if reproducible:
34
+ uname = "hidden for reproducibility"
35
+ else:
36
+ # Uname without hostname.
37
+ uname = list(os.uname())
38
+ uname = " ".join((uname[0], *uname[2:]))
34
39
 
35
40
 
36
41
  # -----------------------------------------------------------------------------
@@ -138,5 +143,5 @@ elif ("--stubs", "") in opts:
138
143
  template = template_stubs
139
144
 
140
145
  body = os.linesep.join(body)
141
- text = template % (uname, headers, body)
146
+ text = template % (uname, headers if not reproducible else ["hidden for reproducibility"], body)
142
147
  print(text.strip())
@@ -6,7 +6,7 @@ import stat
6
6
  from typing import Union, List
7
7
 
8
8
  from . import ecodes
9
- from .events import InputEvent, event_factory
9
+ from .events import InputEvent, event_factory, KeyEvent, RelEvent, AbsEvent, SynEvent
10
10
 
11
11
 
12
12
  def list_devices(input_device_dir: Union[str, bytes, os.PathLike] = "/dev/input") -> List[str]:
@@ -32,7 +32,7 @@ def is_device(fn: Union[str, bytes, os.PathLike]) -> bool:
32
32
  return True
33
33
 
34
34
 
35
- def categorize(event: InputEvent) -> InputEvent:
35
+ def categorize(event: InputEvent) -> Union[InputEvent, KeyEvent, RelEvent, AbsEvent, SynEvent]:
36
36
  """
37
37
  Categorize an event according to its type.
38
38
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: evdev
3
- Version: 1.9.1
3
+ Version: 1.9.2
4
4
  Summary: Bindings to the Linux input handling subsystem
5
5
  Author-email: Georgi Valkov <georgi.t.valkov@gmail.com>
6
6
  Maintainer-email: Tobi <proxima@sezanzeb.de>
@@ -46,6 +46,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
46
46
  Requires-Python: >=3.8
47
47
  Description-Content-Type: text/markdown
48
48
  License-File: LICENSE
49
+ Dynamic: license-file
49
50
 
50
51
  # evdev
51
52
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes