Browse Source

Création d'un répertoire SHARE, qui contient des données

pull/3/head
Louis 11 years ago
parent
commit
0b99b8f1ff
  1. 0
      share/examples/README
  2. 1
      share/examples/example.sb
  3. 0
      share/examples/img/README
  4. 0
      share/examples/img/treble_a.png
  5. 0
      share/examples/latex/README
  6. 0
      share/examples/songs/README
  7. 0
      share/examples/songs/_lilypond/header
  8. 0
      share/examples/songs/chevaliers_de_la_table_ronde.sg
  9. 0
      share/examples/songs/example-en.sg
  10. 0
      share/examples/songs/example-fr.sg
  11. 0
      share/examples/songs/greensleeves.ly
  12. 0
      share/examples/songs/greensleeves.sg
  13. 0
      share/examples/songs/traditionnel.jpg
  14. 0
      share/examples/songs/vent_frais.sg
  15. 0
      share/examples/templates/README
  16. 0
      share/latex/chords.sty
  17. 0
      share/latex/crepbook.cls
  18. 0
      share/latex/songs.sty
  19. 0
      share/latex/venturisold.sty
  20. 0
      share/latex/xstring.sty
  21. 8
      share/templates/default.tmpl
  22. 5
      songbook/__init__.py
  23. 7
      songbook/build.py

0
examples/README → share/examples/README

1
examples/example.sb → share/examples/example.sb

@ -1,5 +1,4 @@
{
"template" : "default.tmpl",
"bookoptions" : [
"importantdiagramonly",
"repeatchords",

0
examples/img/README → share/examples/img/README

0
examples/img/treble_a.png → share/examples/img/treble_a.png

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

0
examples/latex/README → share/examples/latex/README

0
examples/songs/README → share/examples/songs/README

0
examples/songs/_lilypond/header → share/examples/songs/_lilypond/header

0
examples/songs/chevaliers_de_la_table_ronde.sg → share/examples/songs/chevaliers_de_la_table_ronde.sg

0
examples/songs/example-en.sg → share/examples/songs/example-en.sg

0
examples/songs/example-fr.sg → share/examples/songs/example-fr.sg

0
examples/songs/greensleeves.ly → share/examples/songs/greensleeves.ly

0
examples/songs/greensleeves.sg → share/examples/songs/greensleeves.sg

0
examples/songs/traditionnel.jpg → share/examples/songs/traditionnel.jpg

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

0
examples/songs/vent_frais.sg → share/examples/songs/vent_frais.sg

0
examples/templates/README → share/examples/templates/README

0
latex/chords.sty → share/latex/chords.sty

0
latex/crepbook.cls → share/latex/crepbook.cls

0
latex/songs.sty → share/latex/songs.sty

0
latex/venturisold.sty → share/latex/venturisold.sty

0
latex/xstring.sty → share/latex/xstring.sty

8
examples/templates/default.tmpl → share/templates/default.tmpl

@ -4,7 +4,7 @@
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or (at your option) any later nersion.
% of the License, or (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -25,8 +25,8 @@
% Template parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%:[
%%: {"name":"title", "description":"Title", "default":"Song book example", "mandatory":true},
%%: {"name":"author", "description":"Author", "default":"The Songbook team (Crep (R. Goffe), Lohrun (A. Dupas), et al.)", "mandatory":true},
%%: {"name":"title", "description":"Title", "default":"Recueil de chansons pour guitare", "mandatory":true},
%%: {"name":"author", "description":"Author", "default":"The Songbook Team", "mandatory":true},
%%: {"name":"booktype", "description":"Type", "type":"enum", "values":["chorded","lyric"], "default":"chorded", "mandatory":true},
%%: {"name":"lang", "description":"Language", "default":"english"},
%%: {"name":"instruments", "description":"Instruments", "type":"flag", "values":["guitar","ukulele"], "join":",", "mandatory":true, "default":["guitar"]},
@ -37,7 +37,7 @@
%%: {"name":"mail", "description":"Email", "default":"crep@team-on-fire.com"},
%%: {"name":"picture", "description":"Picture", "type":"file", "default":"treble_a"},
%%: {"name":"picturecopyright", "description":"Copyright", "default":"Dbolton \\url{http://commons.wikimedia.org/wiki/User:Dbolton}"},
%%: {"name":"footer", "description":"Footer", "default":""},
%%: {"name":"footer", "description":"Footer", "default":"\\begin{flushright}Generated using Songbook (\\url{http://www.patacrep.com})\\end{flushright}"},
%%: {"name":"mainfontsize", "description":"Font Size", "type":"font", "default":"10"},
%%: {"name":"songnumberbgcolor", "description":"Number Shade", "type":"color", "default":"#D1E4AE"},
%%: {"name":"notebgcolor", "description":"Note Shade", "type":"color", "default":"#D1E4AE"},

5
songbook/__init__.py

@ -1 +1,6 @@
import os
__VERSION__ = "3.7.2"
# Directory containing shared data (default templates, custom LaTeX packages, etc.)
__SHAREDIR__ = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "share"))

7
songbook/build.py

@ -12,6 +12,7 @@ import sys
from songbook.files import recursiveFind
from songbook.index import processSXD
from songbook.songs import Song, SongsList
from songbook import __SHAREDIR__
def parseTemplate(template):
embeddedJsonPattern = re.compile(r"^%%:")
@ -61,8 +62,6 @@ def makeTexFile(sb, output):
datadir = sb['datadir']
name = output[:-4]
template_dir = os.path.join(datadir, 'templates')
# default value
template = "patacrep.tmpl"
songs = []
prefixes_tex = ""
@ -75,6 +74,8 @@ def makeTexFile(sb, output):
if "template" in sb:
template = sb["template"]
del sb["template"]
else:
template = os.path.join(__SHAREDIR__, "templates", "default.tmpl")
if "songs" in sb:
songs = sb["songs"]
del sb["songs"]
@ -179,7 +180,7 @@ def buildsongbook(sb, basename):
if not os.environ.has_key('TEXINPUTS'):
os.environ['TEXINPUTS'] = ''
os.environ['TEXINPUTS'] += os.pathsep + os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'latex')
os.environ['TEXINPUTS'] += os.pathsep + os.path.join(__SHAREDIR__, 'latex')
os.environ['TEXINPUTS'] += os.pathsep + os.path.join(sb['datadir'], 'latex')
# First pdflatex pass

Loading…
Cancel
Save