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,16 +64,20 @@ 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 show:
|
|
||||||
value = show[key]
|
|
||||||
if value and 'short' in value:
|
|
||||||
IncludeShow(key, value['short'])
|
|
||||||
else:
|
|
||||||
IncludeShow(key)
|
|
||||||
for key in y:
|
for key in y:
|
||||||
setattr(self, key, y[key])
|
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)
|
||||||
|
else:
|
||||||
|
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