From 24fcbf491a96767248fbd19733d831b92e71e483 Mon Sep 17 00:00:00 2001 From: Mike Walters Date: Tue, 3 Dec 2024 13:29:08 +0000 Subject: [PATCH 1/4] Update Python versions: drop 3.8, add 3.13 to CI --- .github/workflows/workflow.yml | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 77f5c0c..519f833 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -16,11 +16,11 @@ jobs: max-parallel: 5 matrix: python-version: - - '3.8' - '3.9' - '3.10' - '3.11' - '3.12' + - '3.13' name: test (${{ matrix.python-version }}) steps: diff --git a/pyproject.toml b/pyproject.toml index 1931d93..6d1379c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "usb-protocol" description = "Python library providing utilities, data structures, constants, parsers, and tools for working with the USB protocol." license = { text = "BSD" } readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.9" authors = [ {name = "Great Scott Gadgets", email = "dev@greatscottgadgets.com"}, ] @@ -15,11 +15,11 @@ authors = [ classifiers = [ "Development Status :: 4 - Beta", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Natural Language :: English", From 11cb23b66f006fe07a4d76b03d10e60a237fccca Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Mon, 3 Mar 2025 20:48:06 +0000 Subject: [PATCH 2/4] Fix string escaping of paths with backslashes. Fixes "SyntaxWarning: invalid escape sequence '\s'" with Python 3.13. --- usb_protocol/emitters/descriptors/microsoft10.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usb_protocol/emitters/descriptors/microsoft10.py b/usb_protocol/emitters/descriptors/microsoft10.py index ef3500d..6f54099 100644 --- a/usb_protocol/emitters/descriptors/microsoft10.py +++ b/usb_protocol/emitters/descriptors/microsoft10.py @@ -64,7 +64,7 @@ def Property(self): with d.Property() as p: p.dwPropertyDataType = RegistryTypes.REG_EXPAND_SZ p.PropertyName = "Icons" - p.PropertyData = "%SystemRoot%\system32\shell32.dll,-233" + p.PropertyData = "%SystemRoot%\\system32\\shell32.dll,-233" This adds the relevant descriptor, automatically. """ @@ -232,7 +232,7 @@ def test_extended_properties_descriptor(self): with d.Property() as p: p.dwPropertyDataType = RegistryTypes.REG_EXPAND_SZ p.PropertyName = "Icons" - p.PropertyData = "%SystemRoot%\system32\shell32.dll,-233" + p.PropertyData = "%SystemRoot%\\system32\\shell32.dll,-233" with d.Property() as p: p.dwPropertyDataType = RegistryTypes.REG_SZ p.PropertyName = "Label" From a4c92fe2bab43c7c3355810643eae87bfff7b6b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Mar 2025 03:34:02 +0000 Subject: [PATCH 3/4] build(deps): bump jinja2 from 3.1.4 to 3.1.6 in /docs Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.4 to 3.1.6. - [Release notes](https://github.com/pallets/jinja/releases) - [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/jinja/compare/3.1.4...3.1.6) --- updated-dependencies: - dependency-name: jinja2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 67e3df3..6d55b9e 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,7 +3,7 @@ sphinx_rtd_theme==2.0.0 sphinxcontrib-apidoc readthedocs-sphinx-search==0.3.2 recommonmark==0.7.1 -jinja2==3.1.4 +jinja2==3.1.6 # needed for sphinxcontrib-apidoc to do its thing usb_protocol @ git+https://github.com/greatscottgadgets/python-usb-protocol.git From 273a9d6c78bbd5338c4fd446857159b8799df553 Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Fri, 6 Dec 2024 11:51:10 +0100 Subject: [PATCH 4/4] midi1: Add the ability to specify iJack --- usb_protocol/emitters/descriptors/midi1.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/usb_protocol/emitters/descriptors/midi1.py b/usb_protocol/emitters/descriptors/midi1.py index cbd0ef4..caf6fb9 100644 --- a/usb_protocol/emitters/descriptors/midi1.py +++ b/usb_protocol/emitters/descriptors/midi1.py @@ -28,8 +28,17 @@ def add_source(self, sourceId, sourcePin=1): sourceDescriptor.BaSourcePin = sourcePin self.add_subordinate_descriptor(sourceDescriptor) + def __setattr__(self, name, value): + if name == "iJack": + self._iJack = value + else: + return super().__setattr__(name, value) + def _pre_emit(self): - self.add_subordinate_descriptor(MidiOutJackDescriptorFootEmitter()) + foot = MidiOutJackDescriptorFootEmitter() + if hasattr(self, "_iJack"): + foot.iJack = self._iJack + self.add_subordinate_descriptor(foot) # Figure out the total length of our descriptor, including subordinates. subordinate_length = sum(len(sub) for sub in self._subordinates) self.bLength = subordinate_length + self.DESCRIPTOR_FORMAT.sizeof()