From 3cab46e897a670f1f242edb0152aec54b9d78e72 Mon Sep 17 00:00:00 2001 From: Louis Date: Sun, 1 Nov 2015 05:16:16 +0100 Subject: [PATCH] Use full names for cover and language --- examples/songs/chevaliers_de_la_table_ronde.sg | 2 +- examples/songs/example-en.sg | 2 +- examples/songs/example-fr.sg | 2 +- examples/songs/greensleeves.sg | 2 +- examples/songs/vent_frais.sg | 2 +- patacrep/data/latex/patacrep.sty | 2 +- patacrep/songs/chordpro/__init__.py | 2 +- patacrep/songs/chordpro/ast.py | 6 +++--- patacrep/songs/chordpro/data/chordpro/song_header | 4 ++-- patacrep/songs/chordpro/data/latex/song | 12 ++++++------ test/test_chordpro/greensleeves.sgc | 2 +- test/test_chordpro/greensleeves.tex | 2 +- test/test_chordpro/metadata.sgc | 2 +- test/test_chordpro/metadata.tex | 2 +- test/test_compilation/datadir.tex.control | 8 ++++---- .../datadir_datadir/songs/datadir.sg | 2 +- .../datadir_datadir/songs/datadir2.sg | 2 +- .../datadir_datadir/songs/relative.sg | 2 +- .../datadir_datadir/songs/subdir/subdir.sg | 2 +- 19 files changed, 30 insertions(+), 30 deletions(-) diff --git a/examples/songs/chevaliers_de_la_table_ronde.sg b/examples/songs/chevaliers_de_la_table_ronde.sg index 77dfa869..81a725ef 100644 --- a/examples/songs/chevaliers_de_la_table_ronde.sg +++ b/examples/songs/chevaliers_de_la_table_ronde.sg @@ -1,7 +1,7 @@ \selectlanguage{french} \songcolumns{2} \beginsong{Chevaliers de la table ronde} - [by={Traditionnel},cov={traditionnel},album={France}] + [by={Traditionnel},cover={traditionnel},album={France}] \cover \gtab{C}{X32010} diff --git a/examples/songs/example-en.sg b/examples/songs/example-en.sg index 7009cc68..971507a6 100644 --- a/examples/songs/example-en.sg +++ b/examples/songs/example-en.sg @@ -24,7 +24,7 @@ % traditionnel : the file "8-bit-lagerfeuer.jpg" that corresponds to the album art % 8 bit lagerfeuer : the album whose song is extracted from \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) \cover diff --git a/examples/songs/example-fr.sg b/examples/songs/example-fr.sg index c9264096..a0d68b58 100644 --- a/examples/songs/example-fr.sg +++ b/examples/songs/example-fr.sg @@ -26,7 +26,7 @@ % 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 \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) \cover diff --git a/examples/songs/greensleeves.sg b/examples/songs/greensleeves.sg index 469fab99..2d9f3c19 100644 --- a/examples/songs/greensleeves.sg +++ b/examples/songs/greensleeves.sg @@ -1,7 +1,7 @@ \selectlanguage{english} \songcolumns{2} \beginsong{Greensleeves} - [by={Traditionnel},cov={traditionnel},album={Angleterre}] + [by={Traditionnel},cover={traditionnel},album={Angleterre}] \cover \gtab{Am}{X02210} diff --git a/examples/songs/vent_frais.sg b/examples/songs/vent_frais.sg index 36584ad7..662a9ea2 100644 --- a/examples/songs/vent_frais.sg +++ b/examples/songs/vent_frais.sg @@ -1,7 +1,7 @@ \selectlanguage{french} \songcolumns{2} \beginsong{Vent frais} - [by={Traditionnel},cov={traditionnel},album={France}] + [by={Traditionnel},cover={traditionnel},album={France}] \cover \gtab{Dm}{XX0231} diff --git a/patacrep/data/latex/patacrep.sty b/patacrep/data/latex/patacrep.sty index d3735739..9368d118 100644 --- a/patacrep/data/latex/patacrep.sty +++ b/patacrep/data/latex/patacrep.sty @@ -139,7 +139,7 @@ \setlength{\coverspace}{0.1cm} \newcommand{\songcover}{} \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{url}{\let\songurl\@empty}{\def\songurl{#1}} \newsongkey{original}{\let\songoriginal\@empty}{\def\songoriginal{#1}} diff --git a/patacrep/songs/chordpro/__init__.py b/patacrep/songs/chordpro/__init__.py index c46a0880..5095c4da 100644 --- a/patacrep/songs/chordpro/__init__.py +++ b/patacrep/songs/chordpro/__init__.py @@ -26,7 +26,7 @@ class ChordproSong(Song): song = parse_song(song.read(), self.fullpath) self.authors = song.authors 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.cached = { 'song': song, diff --git a/patacrep/songs/chordpro/ast.py b/patacrep/songs/chordpro/ast.py index 87ce2a34..0bfc4013 100644 --- a/patacrep/songs/chordpro/ast.py +++ b/patacrep/songs/chordpro/ast.py @@ -24,7 +24,7 @@ AVAILABLE_DIRECTIVES = [ "guitar_comment", "image", "key", - "lang", + "language", "newline", "partition", "subtitle", @@ -51,8 +51,8 @@ DIRECTIVE_SHORTCUTS = { "by": "artist", "c": "comment", "gc": "guitar_comment", - "cover": "cov", - "language": "lang", + "cov": "cover", + "lang": "language", } def directive_name(text): diff --git a/patacrep/songs/chordpro/data/chordpro/song_header b/patacrep/songs/chordpro/data/chordpro/song_header index 2ffb1d30..cefca9de 100644 --- a/patacrep/songs/chordpro/data/chordpro/song_header +++ b/patacrep/songs/chordpro/data/chordpro/song_header @@ -21,8 +21,8 @@ {(( key )): (( metadata[key] ))} (* endif *) (* endfor *) -(* if 'cov' in metadata -*) - {(( 'cov' )): (( metadata['cov'].argument|search_image ))} +(* if 'cover' in metadata -*) + {(( 'cover' )): (( metadata['cover'].argument|search_image ))} (* endif *) (*- for key in metadata.morekeys -*) diff --git a/patacrep/songs/chordpro/data/latex/song b/patacrep/songs/chordpro/data/latex/song index 6f026c79..1e2ceaf8 100644 --- a/patacrep/songs/chordpro/data/latex/song +++ b/patacrep/songs/chordpro/data/latex/song @@ -27,11 +27,11 @@ (( key ))={(( metadata[key] ))}, (* endif *) (* endfor *) - (* if 'cov' in metadata *) - (* block cov *) - (* set cov = metadata["cov"].argument|search_image *) - (* if cov *) - cov={(( cov ))}, + (* if 'cover' in metadata *) + (* block cover *) + (* set cover = metadata["cover"].argument|search_image *) + (* if cover *) + cover={(( cover ))}, (* endif *) (* endblock *) (* endif *) @@ -40,7 +40,7 @@ (* endfor *) ] -(* if (metadata.cov is defined) *) +(* if (metadata.cover is defined) *) \cover (* endif *) diff --git a/test/test_chordpro/greensleeves.sgc b/test/test_chordpro/greensleeves.sgc index 7ff25a58..aec06809 100644 --- a/test/test_chordpro/greensleeves.sgc +++ b/test/test_chordpro/greensleeves.sgc @@ -5,7 +5,7 @@ {title: Un sous titre} {artist: Traditionnel} {album: Angleterre} -{cov: traditionnel} +{cover: traditionnel} {partition: greensleeves.ly} diff --git a/test/test_chordpro/greensleeves.tex b/test/test_chordpro/greensleeves.tex index f582b0c8..c4bc461d 100644 --- a/test/test_chordpro/greensleeves.tex +++ b/test/test_chordpro/greensleeves.tex @@ -7,7 +7,7 @@ Un sous titre}[ by={ Traditionnel }, album={Angleterre}, - cov={img/traditionnel}, + cover={img/traditionnel}, ] \cover diff --git a/test/test_chordpro/metadata.sgc b/test/test_chordpro/metadata.sgc index 22c59f59..322a591b 100644 --- a/test/test_chordpro/metadata.sgc +++ b/test/test_chordpro/metadata.sgc @@ -10,7 +10,7 @@ {artist: Texte de Jean Richepin, chanté par Georges Brassens} {album: Album} {copyright: Copyright} -{cov: metadata_cover} +{cover: metadata_cover} {key: foo: Foo} {comment: Comment} diff --git a/test/test_chordpro/metadata.tex b/test/test_chordpro/metadata.tex index d2a2273a..0be273f1 100644 --- a/test/test_chordpro/metadata.tex +++ b/test/test_chordpro/metadata.tex @@ -11,7 +11,7 @@ Subtitle5}[ Texte de Jean Richepin, chanté par Georges Brassens }, album={Album}, copyright={Copyright}, - cov={img/test/test_chordpro/metadata_cover}, + cover={img/test/test_chordpro/metadata_cover}, foo={Foo}, ] diff --git a/test/test_compilation/datadir.tex.control b/test/test_compilation/datadir.tex.control index 4f6c8521..a003cd42 100644 --- a/test/test_compilation/datadir.tex.control +++ b/test/test_compilation/datadir.tex.control @@ -103,7 +103,7 @@ guitar, Chordpro}[ by={ }, - cov={img/datadir.png}, + cover={img/datadir.png}, ] \cover @@ -130,7 +130,7 @@ Chordpro}[ Chordpro}[ by={ }, - cov={img/datadir2.png}, + cover={img/datadir2.png}, ] \cover @@ -157,7 +157,7 @@ Chordpro}[ Chordpro}[ by={ }, - cov={@TEST_FOLDER@/datadir_datadir/songs/./relative.png}, + cover={@TEST_FOLDER@/datadir_datadir/songs/./relative.png}, ] \cover @@ -184,7 +184,7 @@ Chordpro}[ Chordpro}[ by={ }, - cov={@TEST_FOLDER@/datadir_datadir/songs/./subdir/subdir.png}, + cover={@TEST_FOLDER@/datadir_datadir/songs/./subdir/subdir.png}, ] \cover diff --git a/test/test_compilation/datadir_datadir/songs/datadir.sg b/test/test_compilation/datadir_datadir/songs/datadir.sg index 933e208b..eb937410 100644 --- a/test/test_compilation/datadir_datadir/songs/datadir.sg +++ b/test/test_compilation/datadir_datadir/songs/datadir.sg @@ -1,5 +1,5 @@ \beginsong{Image included from datadir\\\LaTeX} - [cov={img/datadir}] + [cover={img/datadir}] \cover diff --git a/test/test_compilation/datadir_datadir/songs/datadir2.sg b/test/test_compilation/datadir_datadir/songs/datadir2.sg index 6a805725..f37f351f 100644 --- a/test/test_compilation/datadir_datadir/songs/datadir2.sg +++ b/test/test_compilation/datadir_datadir/songs/datadir2.sg @@ -1,5 +1,5 @@ \beginsong{Image included from a different datadir\\\LaTeX} - [cov={img/datadir2}] + [cover={img/datadir2}] \cover diff --git a/test/test_compilation/datadir_datadir/songs/relative.sg b/test/test_compilation/datadir_datadir/songs/relative.sg index 681b4086..3fc326f0 100644 --- a/test/test_compilation/datadir_datadir/songs/relative.sg +++ b/test/test_compilation/datadir_datadir/songs/relative.sg @@ -1,5 +1,5 @@ \beginsong{Image included from song directory\\\LaTeX} - [cov={relative}] + [cover={relative}] \cover diff --git a/test/test_compilation/datadir_datadir/songs/subdir/subdir.sg b/test/test_compilation/datadir_datadir/songs/subdir/subdir.sg index f86b47b4..b2199460 100644 --- a/test/test_compilation/datadir_datadir/songs/subdir/subdir.sg +++ b/test/test_compilation/datadir_datadir/songs/subdir/subdir.sg @@ -1,5 +1,5 @@ \beginsong{Image included from a nested song directory\\\LaTeX} - [cov={subdir}] + [cover={subdir}] \cover