configfile: Allow getchoice() to take a list
If a list is passed to getchoice(), seamlessly convert it to a dict. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -8,7 +8,7 @@ import logging
|
||||
|
||||
BACKGROUND_PRIORITY_CLOCK = 0x7fffffff00000000
|
||||
LINE_LENGTH_DEFAULT=20
|
||||
LINE_LENGTH_OPTIONS={16:16, 20:20}
|
||||
LINE_LENGTH_OPTIONS=[16, 20]
|
||||
|
||||
TextGlyphs = { 'right_arrow': b'\x7e' }
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import logging
|
||||
from .. import bus
|
||||
|
||||
LINE_LENGTH_DEFAULT=20
|
||||
LINE_LENGTH_OPTIONS={16:16, 20:20}
|
||||
LINE_LENGTH_OPTIONS=[16, 20]
|
||||
|
||||
TextGlyphs = { 'right_arrow': b'\x7e' }
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class MenuKeys:
|
||||
# Register rotary encoder
|
||||
encoder_pins = config.get('encoder_pins', None)
|
||||
encoder_steps_per_detent = config.getchoice('encoder_steps_per_detent',
|
||||
{2: 2, 4: 4}, 4)
|
||||
[2, 4], 4)
|
||||
if encoder_pins is not None:
|
||||
try:
|
||||
pin1, pin2 = encoder_pins.split(',')
|
||||
|
||||
Reference in New Issue
Block a user