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) return joinText.join(data)
elif parameter["type"] == "color": elif parameter["type"] == "color":
return data[1:] 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): def formatDeclaration(name, parameter):
value = "" value = ""
@ -111,7 +119,7 @@ def makeDepend(sb, output):
# check for lilypond deps (in songs data) if necessary # check for lilypond deps (in songs data) if necessary
lilypond = [] lilypond = []
if "booktype" in sb and "lilypond" in sb["booktype"]: if "bookoptions" in sb and "lilypond" in sb["bookoptions"]:
for filename in deps: for filename in deps:
tmpl = open(filename) tmpl = open(filename)
lilypond += matchRegexp(lilypondPattern, tmpl) lilypond += matchRegexp(lilypondPattern, tmpl)

7
templates/minimal.tmpl

@ -25,7 +25,12 @@
% Template parameters % 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 % begin document

7
templates/patacrep.tmpl

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

Loading…
Cancel
Save