Allow for string entries (in addition to hash entries) in the shows config hash.

This commit is contained in:
Stefan Bethke 2017-07-18 00:00:36 +02:00
parent e654edd1d5
commit 2459ee1c82

View file

@ -64,15 +64,19 @@ class Config:
with open(file, 'r') as f: with open(file, 'r') as f:
y = yaml.load(f) y = yaml.load(f)
for show in y['shows']: for key in y:
setattr(self, key, y[key])
for show in self.shows:
for key in show: for key in show:
if isinstance(key, dict):
value = show[key] value = show[key]
if value and 'short' in value: if value and 'short' in value:
IncludeShow(key, value['short']) IncludeShow(key, value['short'])
else: else:
IncludeShow(key) IncludeShow(key)
for key in y: else:
setattr(self, key, y[key]) IncludeShow(key)
def __repr__(self): def __repr__(self):
return "Config options for tivomirror (singleton)" return "Config options for tivomirror (singleton)"