From 17a525a15b24cb62938267a4840eccb3dd0ab908 Mon Sep 17 00:00:00 2001 From: Raymond Li Date: Tue, 2 Jul 2024 18:28:21 -0400 Subject: [PATCH 1/2] Fix small stuff --- .gitignore | 4 ++++ LICENSE | 2 +- charachorder/__init__.py | 2 +- charachorder/{types.py => charachorder_types.py} | 0 charachorder/device.py | 10 +++++----- 5 files changed, 11 insertions(+), 7 deletions(-) rename charachorder/{types.py => charachorder_types.py} (100%) diff --git a/.gitignore b/.gitignore index c18dd8d..3c3b979 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ __pycache__/ +.idea/ +*.pyc +venv/ +*.egg-info diff --git a/LICENSE b/LICENSE index 477e631..f34f020 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Priyanshu Tripathi +Copyright (c) 2023-Present CharaChorder Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/charachorder/__init__.py b/charachorder/__init__.py index 4c7b572..b090abb 100644 --- a/charachorder/__init__.py +++ b/charachorder/__init__.py @@ -17,4 +17,4 @@ from .device import * from .errors import * -from .types import * +from .charachorder_types import * diff --git a/charachorder/types.py b/charachorder/charachorder_types.py similarity index 100% rename from charachorder/types.py rename to charachorder/charachorder_types.py diff --git a/charachorder/device.py b/charachorder/device.py index b4e023f..07dbea6 100644 --- a/charachorder/device.py +++ b/charachorder/device.py @@ -19,7 +19,7 @@ UnknownProduct, UnknownVendor, ) -from .types import Chord, ChordPhrase, Keymap, OperatingSystem +from .charachorder_types import Chord, ChordPhrase, Keymap, OperatingSystem if TYPE_CHECKING: from typing_extensions import Self @@ -266,7 +266,7 @@ def get_chordmap(self, index: int) -> tuple[Chord, ChordPhrase]: return Chord.from_hex(chord), ChordPhrase.from_hex(phrase) def get_chordmaps(self) -> Generator[tuple[Chord, ChordPhrase], None, None]: - """Returns a iterable generator over all the chordmaps in the device.""" + """Returns an iterable generator over all the chordmaps in the device.""" chordmap_count = self.get_chordmap_count() return (self.get_chordmap(i) for i in range(chordmap_count)) @@ -339,7 +339,7 @@ def is_serial_mouse_enabled(self) -> bool: def is_usb_hid_keyboard_enabled(self) -> bool: return bool(self.get_parameter(0x11)) - def is_charachter_entry_enabled(self) -> bool: + def is_character_entry_enabled(self) -> bool: return bool(self.get_parameter(0x12)) def get_key_scan_duration(self) -> int: @@ -476,10 +476,10 @@ def enable_usb_hid_keyboard(self, *, commit: bool = False) -> bool: def disable_usb_hid_keyboard(self, *, commit: bool = False) -> bool: return self._maybe_commit(self.set_parameter(0x11, 0), commit) - def enable_charachter_entry(self, *, commit: bool = False) -> bool: + def enable_character_entry(self, *, commit: bool = False) -> bool: return self._maybe_commit(self.set_parameter(0x12, 1), commit) - def disable_charachter_entry(self, *, commit: bool = False) -> bool: + def disable_character_entry(self, *, commit: bool = False) -> bool: return self._maybe_commit(self.set_parameter(0x12, 0), commit) def set_key_scan_duration(self, value: int, *, commit: bool = False) -> bool: From 497ff55614576afe74a93408e5c1a4060917fef0 Mon Sep 17 00:00:00 2001 From: Raymond Li Date: Wed, 3 Jul 2024 12:13:08 -0400 Subject: [PATCH 2/2] Rename types file --- charachorder/__init__.py | 2 +- charachorder/{charachorder_types.py => _types.py} | 0 charachorder/device.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename charachorder/{charachorder_types.py => _types.py} (100%) diff --git a/charachorder/__init__.py b/charachorder/__init__.py index b090abb..ade446a 100644 --- a/charachorder/__init__.py +++ b/charachorder/__init__.py @@ -17,4 +17,4 @@ from .device import * from .errors import * -from .charachorder_types import * +from ._types import * diff --git a/charachorder/charachorder_types.py b/charachorder/_types.py similarity index 100% rename from charachorder/charachorder_types.py rename to charachorder/_types.py diff --git a/charachorder/device.py b/charachorder/device.py index 07dbea6..fddcbff 100644 --- a/charachorder/device.py +++ b/charachorder/device.py @@ -19,7 +19,7 @@ UnknownProduct, UnknownVendor, ) -from .charachorder_types import Chord, ChordPhrase, Keymap, OperatingSystem +from ._types import Chord, ChordPhrase, Keymap, OperatingSystem if TYPE_CHECKING: from typing_extensions import Self