From d80fac7f68f2033d74811486eabfbb01837cfcd2 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Wed, 17 Jul 2024 02:12:48 +0200 Subject: [PATCH 1/3] remove usage of OrederedDict dict gained the ability to remember insertion order in py3.7, so this OrderedDict usage isn't needed any longer --- luma/core/cmdline.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/luma/core/cmdline.py b/luma/core/cmdline.py index 892bf64..321e2d0 100644 --- a/luma/core/cmdline.py +++ b/luma/core/cmdline.py @@ -1,12 +1,11 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2017-2022 Richard Hull and contributors +# Copyright (c) 2017-2024 Richard Hull and contributors # See LICENSE.rst for details. import atexit import inspect import argparse import importlib -from collections import OrderedDict def get_choices(module_name): @@ -86,9 +85,9 @@ def get_display_types(): Get ordered dict containing available display types from available luma sub-projects. - :rtype: collections.OrderedDict + :rtype: dict """ - display_types = OrderedDict() + display_types = dict() for namespace in get_supported_libraries(): display_types[namespace] = get_choices(f'luma.{namespace}.device') From 61980f439e2f3922fcdad8964ecdf45a2f88dc1f Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Wed, 17 Jul 2024 02:20:44 +0200 Subject: [PATCH 2/3] fix path --- tests/test_bitmap_font.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_bitmap_font.py b/tests/test_bitmap_font.py index 1407aba..03d6e6d 100644 --- a/tests/test_bitmap_font.py +++ b/tests/test_bitmap_font.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (c) 2020 Richard Hull and contributors +# Copyright (c) 2020-2024 Richard Hull and contributors # See LICENSE.rst for details. """ @@ -234,7 +234,7 @@ def test_load_sprite_table_exceptions_1(): with pytest.raises(FileNotFoundError) as ex: filename = 'badfile' bitmap_font.load_sprite_table(filename, range(16, 256), 5, (5, 8), (5, 8), FONTDATA['mappings'][1]) - assert ex.value.filename == filename + assert Path(ex.value.filename).stem == filename def test_load_sprite_table_exceptions_2(): From 95174ff82df1c903dd44781bebb0c4a4c7b3a628 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Wed, 17 Jul 2024 02:28:15 +0200 Subject: [PATCH 3/3] doc update --- luma/core/cmdline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luma/core/cmdline.py b/luma/core/cmdline.py index 321e2d0..8059c92 100644 --- a/luma/core/cmdline.py +++ b/luma/core/cmdline.py @@ -82,7 +82,7 @@ def get_interface_types(): def get_display_types(): """ - Get ordered dict containing available display types from available luma + Get ``dict`` containing available display types from available luma sub-projects. :rtype: dict