Browse Source

Use a more elegant syntax to select diagrampages

pull/266/head
Olivier Radisson 4 years ago
parent
commit
890abc59db
  1. 10
      patacrep/data/templates/songbook_model.yml
  2. 6
      patacrep/templates.py

10
patacrep/data/templates/songbook_model.yml

@ -55,8 +55,14 @@ schema:
value: "guitar" value: "guitar"
- type: //str - type: //str
value: "ukulele" value: "ukulele"
- type: //str - type: //arr
value: "guitar+ukulele" contents:
type: //any
of:
- type: //str
value: "guitar"
- type: //str
value: "ukulele"
notation: notation:
type: //any type: //any
of: of:

6
patacrep/templates.py

@ -325,5 +325,7 @@ def iter_bookoptions(config):
elif config['chords']['diagrampage'] == "all": elif config['chords']['diagrampage'] == "all":
yield 'diagrampage' yield 'diagrampage'
for instrument in config['chords']['instrument'].split("+"): if isinstance(config['chords']['instrument'], str):
yield instrument yield config['chords']['instrument']
else:
yield from config['chords']['instrument']

Loading…
Cancel
Save