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:
Kevin O'Connor 2024-06-17 13:49:05 -04:00
parent 863a463cb2
commit 11f04ba1ba
11 changed files with 12 additions and 11 deletions

View file

@ -252,7 +252,7 @@ class ProbeSessionHelper:
self.sample_count = config.getint('samples', 1, minval=1)
self.sample_retract_dist = config.getfloat('sample_retract_dist', 2.,
above=0.)
atypes = {'median': 'median', 'average': 'average'}
atypes = ['median', 'average']
self.samples_result = config.getchoice('samples_result', atypes,
'average')
self.samples_tolerance = config.getfloat('samples_tolerance', 0.100,