Allow for string entries (in addition to hash entries) in the shows config hash.
This commit is contained in:
parent
e654edd1d5
commit
2459ee1c82
1 changed files with 11 additions and 7 deletions
|
@ -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)"
|
||||||
|
|
Loading…
Reference in a new issue