Skip to content

Commit

Permalink
remove usage of OrderedDict (#281)
Browse files Browse the repository at this point in the history
* remove usage of OrederedDict

dict gained the ability to remember insertion order in py3.7, so this OrderedDict usage isn't needed any longer

* tests: fix path

* doc update
  • Loading branch information
thijstriemstra authored Jul 21, 2024
1 parent 6b69584 commit e5b83e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions luma/core/cmdline.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -83,12 +82,12 @@ 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: 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')

Expand Down
4 changes: 2 additions & 2 deletions tests/test_bitmap_font.py
Original file line number Diff line number Diff line change
@@ -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.

"""
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit e5b83e8

Please sign in to comment.