Browse Source

Use full names for cover and language

pull/152/head
Louis 9 years ago
parent
commit
3cab46e897
  1. 2
      examples/songs/chevaliers_de_la_table_ronde.sg
  2. 2
      examples/songs/example-en.sg
  3. 2
      examples/songs/example-fr.sg
  4. 2
      examples/songs/greensleeves.sg
  5. 2
      examples/songs/vent_frais.sg
  6. 2
      patacrep/data/latex/patacrep.sty
  7. 2
      patacrep/songs/chordpro/__init__.py
  8. 6
      patacrep/songs/chordpro/ast.py
  9. 4
      patacrep/songs/chordpro/data/chordpro/song_header
  10. 12
      patacrep/songs/chordpro/data/latex/song
  11. 2
      test/test_chordpro/greensleeves.sgc
  12. 2
      test/test_chordpro/greensleeves.tex
  13. 2
      test/test_chordpro/metadata.sgc
  14. 2
      test/test_chordpro/metadata.tex
  15. 8
      test/test_compilation/datadir.tex.control
  16. 2
      test/test_compilation/datadir_datadir/songs/datadir.sg
  17. 2
      test/test_compilation/datadir_datadir/songs/datadir2.sg
  18. 2
      test/test_compilation/datadir_datadir/songs/relative.sg
  19. 2
      test/test_compilation/datadir_datadir/songs/subdir/subdir.sg

2
examples/songs/chevaliers_de_la_table_ronde.sg

@ -1,7 +1,7 @@
\selectlanguage{french} \selectlanguage{french}
\songcolumns{2} \songcolumns{2}
\beginsong{Chevaliers de la table ronde} \beginsong{Chevaliers de la table ronde}
[by={Traditionnel},cov={traditionnel},album={France}] [by={Traditionnel},cover={traditionnel},album={France}]
\cover \cover
\gtab{C}{X32010} \gtab{C}{X32010}

2
examples/songs/example-en.sg

@ -24,7 +24,7 @@
% traditionnel : the file "8-bit-lagerfeuer.jpg" that corresponds to the album art % traditionnel : the file "8-bit-lagerfeuer.jpg" that corresponds to the album art
% 8 bit lagerfeuer : the album whose song is extracted from % 8 bit lagerfeuer : the album whose song is extracted from
\beginsong{Sad robot} \beginsong{Sad robot}
[by={Pornophonique},cov={traditionnel},album={8 bit lagerfeuer}] [by={Pornophonique},cover={traditionnel},album={8 bit lagerfeuer}]
% inserts the album art (8-bit-lagerfeuer.jpg) % inserts the album art (8-bit-lagerfeuer.jpg)
\cover \cover

2
examples/songs/example-fr.sg

@ -26,7 +26,7 @@
% traditionnel : le fichier "8-bit-lagerfeuer.jpg" correspondant à la pochette de l'album % traditionnel : le fichier "8-bit-lagerfeuer.jpg" correspondant à la pochette de l'album
% 8 bit lagerfeuer : le nom de l'album dont la chanson est extraite % 8 bit lagerfeuer : le nom de l'album dont la chanson est extraite
\beginsong{Sad robot} \beginsong{Sad robot}
[by={Pornophonique},cov={traditionnel},album={8 bit lagerfeuer}] [by={Pornophonique},cover={traditionnel},album={8 bit lagerfeuer}]
% insère la pochette de l'album (8-bit-lagerfeuer.jpg) % insère la pochette de l'album (8-bit-lagerfeuer.jpg)
\cover \cover

2
examples/songs/greensleeves.sg

@ -1,7 +1,7 @@
\selectlanguage{english} \selectlanguage{english}
\songcolumns{2} \songcolumns{2}
\beginsong{Greensleeves} \beginsong{Greensleeves}
[by={Traditionnel},cov={traditionnel},album={Angleterre}] [by={Traditionnel},cover={traditionnel},album={Angleterre}]
\cover \cover
\gtab{Am}{X02210} \gtab{Am}{X02210}

2
examples/songs/vent_frais.sg

@ -1,7 +1,7 @@
\selectlanguage{french} \selectlanguage{french}
\songcolumns{2} \songcolumns{2}
\beginsong{Vent frais} \beginsong{Vent frais}
[by={Traditionnel},cov={traditionnel},album={France}] [by={Traditionnel},cover={traditionnel},album={France}]
\cover \cover
\gtab{Dm}{XX0231} \gtab{Dm}{XX0231}

2
patacrep/data/latex/patacrep.sty

@ -139,7 +139,7 @@
\setlength{\coverspace}{0.1cm} \setlength{\coverspace}{0.1cm}
\newcommand{\songcover}{} \newcommand{\songcover}{}
\newcommand{\songalbum}{} \newcommand{\songalbum}{}
\newsongkey{cov}{\let\songcover\@empty}{\def\songcover{#1}} \newsongkey{cover}{\let\songcover\@empty}{\def\songcover{#1}}
\newsongkey{album}{\let\songalbum\@empty}{\def\songalbum{#1}} \newsongkey{album}{\let\songalbum\@empty}{\def\songalbum{#1}}
\newsongkey{url}{\let\songurl\@empty}{\def\songurl{#1}} \newsongkey{url}{\let\songurl\@empty}{\def\songurl{#1}}
\newsongkey{original}{\let\songoriginal\@empty}{\def\songoriginal{#1}} \newsongkey{original}{\let\songoriginal\@empty}{\def\songoriginal{#1}}

2
patacrep/songs/chordpro/__init__.py

@ -26,7 +26,7 @@ class ChordproSong(Song):
song = parse_song(song.read(), self.fullpath) song = parse_song(song.read(), self.fullpath)
self.authors = song.authors self.authors = song.authors
self.titles = song.titles self.titles = song.titles
self.lang = song.get_data_argument('lang', self.config['lang']) self.lang = song.get_data_argument('language', self.config['lang'])
self.data = song.meta self.data = song.meta
self.cached = { self.cached = {
'song': song, 'song': song,

6
patacrep/songs/chordpro/ast.py

@ -24,7 +24,7 @@ AVAILABLE_DIRECTIVES = [
"guitar_comment", "guitar_comment",
"image", "image",
"key", "key",
"lang", "language",
"newline", "newline",
"partition", "partition",
"subtitle", "subtitle",
@ -51,8 +51,8 @@ DIRECTIVE_SHORTCUTS = {
"by": "artist", "by": "artist",
"c": "comment", "c": "comment",
"gc": "guitar_comment", "gc": "guitar_comment",
"cover": "cov", "cov": "cover",
"language": "lang", "lang": "language",
} }
def directive_name(text): def directive_name(text):

4
patacrep/songs/chordpro/data/chordpro/song_header

@ -21,8 +21,8 @@
{(( key )): (( metadata[key] ))} {(( key )): (( metadata[key] ))}
(* endif *) (* endif *)
(* endfor *) (* endfor *)
(* if 'cov' in metadata -*) (* if 'cover' in metadata -*)
{(( 'cov' )): (( metadata['cov'].argument|search_image ))} {(( 'cover' )): (( metadata['cover'].argument|search_image ))}
(* endif *) (* endif *)
(*- for key in metadata.morekeys -*) (*- for key in metadata.morekeys -*)

12
patacrep/songs/chordpro/data/latex/song

@ -27,11 +27,11 @@
(( key ))={(( metadata[key] ))}, (( key ))={(( metadata[key] ))},
(* endif *) (* endif *)
(* endfor *) (* endfor *)
(* if 'cov' in metadata *) (* if 'cover' in metadata *)
(* block cov *) (* block cover *)
(* set cov = metadata["cov"].argument|search_image *) (* set cover = metadata["cover"].argument|search_image *)
(* if cov *) (* if cover *)
cov={(( cov ))}, cover={(( cover ))},
(* endif *) (* endif *)
(* endblock *) (* endblock *)
(* endif *) (* endif *)
@ -40,7 +40,7 @@
(* endfor *) (* endfor *)
] ]
(* if (metadata.cov is defined) *) (* if (metadata.cover is defined) *)
\cover \cover
(* endif *) (* endif *)

2
test/test_chordpro/greensleeves.sgc

@ -5,7 +5,7 @@
{title: Un sous titre} {title: Un sous titre}
{artist: Traditionnel} {artist: Traditionnel}
{album: Angleterre} {album: Angleterre}
{cov: traditionnel} {cover: traditionnel}
{partition: greensleeves.ly} {partition: greensleeves.ly}

2
test/test_chordpro/greensleeves.tex

@ -7,7 +7,7 @@ Un sous titre}[
by={ by={
Traditionnel }, Traditionnel },
album={Angleterre}, album={Angleterre},
cov={img/traditionnel}, cover={img/traditionnel},
] ]
\cover \cover

2
test/test_chordpro/metadata.sgc

@ -10,7 +10,7 @@
{artist: Texte de Jean Richepin, chanté par Georges Brassens} {artist: Texte de Jean Richepin, chanté par Georges Brassens}
{album: Album} {album: Album}
{copyright: Copyright} {copyright: Copyright}
{cov: metadata_cover} {cover: metadata_cover}
{key: foo: Foo} {key: foo: Foo}
{comment: Comment} {comment: Comment}

2
test/test_chordpro/metadata.tex

@ -11,7 +11,7 @@ Subtitle5}[
Texte de Jean Richepin, chanté par Georges Brassens }, Texte de Jean Richepin, chanté par Georges Brassens },
album={Album}, album={Album},
copyright={Copyright}, copyright={Copyright},
cov={img/test/test_chordpro/metadata_cover}, cover={img/test/test_chordpro/metadata_cover},
foo={Foo}, foo={Foo},
] ]

8
test/test_compilation/datadir.tex.control

@ -103,7 +103,7 @@ guitar,
Chordpro}[ Chordpro}[
by={ by={
}, },
cov={img/datadir.png}, cover={img/datadir.png},
] ]
\cover \cover
@ -130,7 +130,7 @@ Chordpro}[
Chordpro}[ Chordpro}[
by={ by={
}, },
cov={img/datadir2.png}, cover={img/datadir2.png},
] ]
\cover \cover
@ -157,7 +157,7 @@ Chordpro}[
Chordpro}[ Chordpro}[
by={ by={
}, },
cov={@TEST_FOLDER@/datadir_datadir/songs/./relative.png}, cover={@TEST_FOLDER@/datadir_datadir/songs/./relative.png},
] ]
\cover \cover
@ -184,7 +184,7 @@ Chordpro}[
Chordpro}[ Chordpro}[
by={ by={
}, },
cov={@TEST_FOLDER@/datadir_datadir/songs/./subdir/subdir.png}, cover={@TEST_FOLDER@/datadir_datadir/songs/./subdir/subdir.png},
] ]
\cover \cover

2
test/test_compilation/datadir_datadir/songs/datadir.sg

@ -1,5 +1,5 @@
\beginsong{Image included from datadir\\\LaTeX} \beginsong{Image included from datadir\\\LaTeX}
[cov={img/datadir}] [cover={img/datadir}]
\cover \cover

2
test/test_compilation/datadir_datadir/songs/datadir2.sg

@ -1,5 +1,5 @@
\beginsong{Image included from a different datadir\\\LaTeX} \beginsong{Image included from a different datadir\\\LaTeX}
[cov={img/datadir2}] [cover={img/datadir2}]
\cover \cover

2
test/test_compilation/datadir_datadir/songs/relative.sg

@ -1,5 +1,5 @@
\beginsong{Image included from song directory\\\LaTeX} \beginsong{Image included from song directory\\\LaTeX}
[cov={relative}] [cover={relative}]
\cover \cover

2
test/test_compilation/datadir_datadir/songs/subdir/subdir.sg

@ -1,5 +1,5 @@
\beginsong{Image included from a nested song directory\\\LaTeX} \beginsong{Image included from a nested song directory\\\LaTeX}
[cov={subdir}] [cover={subdir}]
\cover \cover

Loading…
Cancel
Save