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:
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:
if isinstance(key, dict):
value = show[key]
if value and 'short' in value:
IncludeShow(key, value['short'])
else:
IncludeShow(key)
for key in y:
setattr(self, key, y[key])
else:
IncludeShow(key)
def __repr__(self):
return "Config options for tivomirror (singleton)"