Skip to content

suggestion: move examples.demo_opts.get_device() into core #178

@BeauSlim

Description

@BeauSlim

I've been messing around with a library I'm writing and trying it with numerous displays, including an ssd1306, an ili9341 and an st7789 in addition to the pygame emulator. A config file (same file name, different contents) helps when testing on different displays, so I have used examples' get_device() as a start.

While it isn't difficult to do

from luma.core import cmdline
parser = cmdline.create_parser(description='luma config')
config = cmdline.load_config('device.conf')
args = parser.parse_args(config)
device = cmdline.create_device(args)

It occurs to me that something like device=conf2dev(dev_conf='device.conf') might be useful for users in general and really should be built into luma.core. Probably just the file-based config not the command line stuff, since that might be messy.

Or maybe the use of config files should just be documented better?

Either way I'm happy to work it up as a pull request.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions