Browse Source

Add flag type for parameter

remotes/origin/translate_notes
Alexandre Dupas 15 years ago
parent
commit
a09ede4e77
  1. 10
      songbook.py
  2. 7
      templates/minimal.tmpl
  3. 7
      templates/patacrep.tmpl

10
songbook.py

@ -38,6 +38,14 @@ def toValue(parameter, data):
return joinText.join(data)
elif parameter["type"] == "color":
return data[1:]
elif parameter["type"] == "enum":
return data
elif parameter["type"] == "flag":
if "join" in parameter:
joinText = parameter["join"]
else:
joinText = ''
return joinText.join(data)
def formatDeclaration(name, parameter):
value = ""
@ -111,7 +119,7 @@ def makeDepend(sb, output):
# check for lilypond deps (in songs data) if necessary
lilypond = []
if "booktype" in sb and "lilypond" in sb["booktype"]:
if "bookoptions" in sb and "lilypond" in sb["bookoptions"]:
for filename in deps:
tmpl = open(filename)
lilypond += matchRegexp(lilypondPattern, tmpl)

7
templates/minimal.tmpl

@ -25,7 +25,12 @@
% Template parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%:[
%%: {"name":"booktype", "description":"Booktype", "type":"stringlist", "default":["chorded"], "join":","}
%%: {"name":"booktype", "description":"Type", "type":"enum", "values":["chorded","lyric"], "default":"chorded", "mandatory":true},
%%: {"name":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","lilypond","tabs"], "join":",", "mandatory":true, "default":["diagram"]},
%%: {"name":"mainfontsize", "description":"Font Size", "type":"enum", "values":["10pt","11pt","12pt"], "default":"10pt"},
%%: {"name":"songnumberbgcolor", "description":"Number Shade", "type":"color", "default":"#D1E4AE"},
%%: {"name":"notebgcolor", "description":"Note Shade", "type":"color", "default":"#D1E4AE"},
%%: {"name":"indexbgcolor", "description":"Index Shade", "type":"color", "default":"#D1E4AE"}
%%:]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% begin document

7
templates/patacrep.tmpl

@ -25,8 +25,10 @@
% Template parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%:[
%%: {"name":"title", "description":"Title", "default":"Recueil de chansons pour guitare"},
%%: {"name":"author", "description":"Author", "default":"Romain Goffe \\and Alexandre Dupas"},
%%: {"name":"title", "description":"Title", "default":"Recueil de chansons pour guitare", "mandatory":true},
%%: {"name":"author", "description":"Author", "default":"Romain Goffe \\and Alexandre Dupas", "mandatory":true},
%%: {"name":"booktype", "description":"Type", "type":"enum", "values":["chorded","lyric"], "default":"chorded", "mandatory":true},
%%: {"name":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","lilypond","tabs"], "join":",", "mandatory":true, "default":["diagram"]},
%%: {"name":"version", "description":"Version", "default":"3.2"},
%%: {"name":"subtitle", "description":"Subtitle"},
%%: {"name":"web", "description":"Web", "default":"http://www.patacrep.com"},
@ -35,7 +37,6 @@
%%: {"name":"picturecopyright", "description":"Copyright", "default":"foxygamergirl@deviantart.com"},
%%: {"name":"footer", "description":"Footer", "default":"\\begin{flushleft}\\includegraphics[width=3cm]{on-fire}\\end{flushleft}"},
%%: {"name":"license", "description":"License", "default":"\\input{license.tex}"},
%%: {"name":"booktype", "description":"Booktype", "type":"stringlist", "default":["chorded"], "join":","},
%%: {"name":"mainfontsize", "description":"Font Size", "values":["10pt","11pt","12pt"], "default":"10pt"},
%%: {"name":"songnumberbgcolor", "description":"Number Shade", "type":"color", "default":"#D1E4AE"},
%%: {"name":"notebgcolor", "description":"Note Shade", "type":"color", "default":"#D1E4AE"},

Loading…
Cancel
Save