Skip to content

Commit

Permalink
add supported libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
thijstriemstra committed Mar 22, 2017
1 parent 712d128 commit 9628c2e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions luma/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
from collections import OrderedDict


__all__ = ["deprecation", "monotonic", "get_choices", "get_interface_types",
"get_display_types", "get_transformer_choices", "load_config",
"make_serial", "create_device", "create_parser"]
__all__ = ["deprecation", "monotonic", "get_choices", "get_supported_libraries",
"get_interface_types", "get_display_types", "get_transformer_choices",
"load_config", "make_serial", "create_device", "create_parser"]


try:
Expand Down Expand Up @@ -89,6 +89,15 @@ def get_choices(module_name):
return []


def get_supported_libraries():
"""
Get list of supported libraries for the parser.
:rtype: list
"""
return ['oled', 'lcd', 'led_matrix', 'emulator']


def get_interface_types():
"""
Get list of available interface types, e.g. ``['spi', 'i2c']``.
Expand All @@ -106,7 +115,7 @@ def get_display_types():
:rtype: OrderedDict
"""
display_types = OrderedDict()
for namespace in ['oled', 'lcd', 'led_matrix', 'emulator']:
for namespace in get_supported_libraries():
display_types[namespace] = get_choices('luma.{0}.device'.format(
namespace))

Expand Down

0 comments on commit 9628c2e

Please sign in to comment.