Skip to content

Commit

Permalink
Pass mypy and link issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Aug 25, 2024
1 parent 3f1e844 commit 54aff31
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions jaraco/input/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

__all__ = ['Joystick']

import sys
import importlib
import sys

platform_path = '.'.join((__name__, sys.platform))

try:
Joystick = importlib.import_module(platform_path).Joystick # type: ignore
Joystick = importlib.import_module(platform_path).Joystick
except ImportError:
pass
8 changes: 4 additions & 4 deletions jaraco/input/linux2/joystick.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
borrowed from http://entitycrisis.blogspot.com/2008/02/pyglet-joystick.html
"""

from pyglet import event

from glob import glob
import struct
from glob import glob
from select import select

from jaraco.input import NormalizingAxisJoystick as NormalizingJS
from pyglet import event

from jaraco.input.base import NormalizingAxisJoystick as NormalizingJS

# Linux only gives us axis numbers: translate these to meaningful
# names (as found in the XINPUT_GAMEPAD structure)
Expand Down
7 changes: 5 additions & 2 deletions jaraco/input/win32/xinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
via the XInput library.
"""

from __future__ import annotations

import ctypes
import sys
import time
from operator import itemgetter, attrgetter
from itertools import count, starmap
from operator import attrgetter, itemgetter
from typing import ClassVar

from pyglet import event

Expand All @@ -16,7 +19,7 @@


class XINPUT_GAMEPAD(ctypes.Structure):
_fields_ = [
_fields_: ClassVar[list[tuple[str, type[ctypes._CData]]]] = [
('buttons', ctypes.c_ushort), # wButtons
('left_trigger', ctypes.c_ubyte), # bLeftTrigger
('right_trigger', ctypes.c_ubyte), # bLeftTrigger
Expand Down
4 changes: 4 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ explicit_package_bases = True

# Disable overload-overlap due to many false-positives
disable_error_code = overload-overlap

# pyglet/pyglet#643
[mypy-pyglet.*]
ignore_missing_imports = True
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,3 @@ type = [


[tool.setuptools_scm]


[tool.pytest-enabler.mypy]
# Disabled due to jaraco/skeleton#143

0 comments on commit 54aff31

Please sign in to comment.