Browse Source

Merge pull request #174 from patacrep/new_extensions

New file extensions
pull/178/head
Louis 9 years ago
parent
commit
9b1b94cdd4
  1. 0
      examples/songs/chevaliers_de_la_table_ronde.tsg
  2. 0
      examples/songs/example-en.tsg
  3. 0
      examples/songs/example-fr.tsg
  4. 0
      examples/songs/greensleeves.csg
  5. 0
      examples/songs/greensleeves.tsg
  6. 0
      examples/songs/tests/chords.csg
  7. 0
      examples/songs/tests/errors.csg
  8. 0
      examples/songs/tests/newline.csg
  9. 0
      examples/songs/tests/nolyrics.csg
  10. 0
      examples/songs/vent_frais.tsg
  11. 2
      patacrep/build.py
  12. 1
      patacrep/songbook/__main__.py
  13. 10
      patacrep/songs/chordpro/__init__.py
  14. 4
      patacrep/songs/convert/__main__.py
  15. 7
      patacrep/songs/latex/__init__.py
  16. 0
      test/test_chordpro/00.csg
  17. 0
      test/test_chordpro/00.csg.source
  18. 0
      test/test_chordpro/00.tsg
  19. 0
      test/test_chordpro/01.csg
  20. 0
      test/test_chordpro/01.csg.source
  21. 0
      test/test_chordpro/01.tsg
  22. 0
      test/test_chordpro/02.csg
  23. 0
      test/test_chordpro/02.csg.source
  24. 0
      test/test_chordpro/02.tsg
  25. 0
      test/test_chordpro/03.csg
  26. 0
      test/test_chordpro/03.csg.source
  27. 0
      test/test_chordpro/03.tsg
  28. 0
      test/test_chordpro/04.csg
  29. 0
      test/test_chordpro/04.csg.source
  30. 0
      test/test_chordpro/04.tsg
  31. 0
      test/test_chordpro/05.csg
  32. 0
      test/test_chordpro/05.csg.source
  33. 0
      test/test_chordpro/05.tsg
  34. 0
      test/test_chordpro/06.csg
  35. 0
      test/test_chordpro/06.csg.source
  36. 0
      test/test_chordpro/06.tsg
  37. 0
      test/test_chordpro/07.csg
  38. 0
      test/test_chordpro/07.csg.source
  39. 0
      test/test_chordpro/07.tsg
  40. 0
      test/test_chordpro/08.csg
  41. 0
      test/test_chordpro/08.csg.source
  42. 0
      test/test_chordpro/08.tsg
  43. 0
      test/test_chordpro/09.csg
  44. 0
      test/test_chordpro/09.csg.source
  45. 0
      test/test_chordpro/09.tsg
  46. 0
      test/test_chordpro/10.csg
  47. 0
      test/test_chordpro/10.csg.source
  48. 0
      test/test_chordpro/10.tsg
  49. 0
      test/test_chordpro/11.csg
  50. 0
      test/test_chordpro/11.csg.source
  51. 0
      test/test_chordpro/11.tsg
  52. 0
      test/test_chordpro/12.csg
  53. 0
      test/test_chordpro/12.csg.source
  54. 0
      test/test_chordpro/12.tsg
  55. 0
      test/test_chordpro/13.csg
  56. 0
      test/test_chordpro/13.csg.source
  57. 0
      test/test_chordpro/13.tsg
  58. 0
      test/test_chordpro/21.csg
  59. 0
      test/test_chordpro/21.csg.source
  60. 0
      test/test_chordpro/21.tsg
  61. 0
      test/test_chordpro/22.csg
  62. 0
      test/test_chordpro/22.csg.source
  63. 0
      test/test_chordpro/22.tsg
  64. 0
      test/test_chordpro/23.csg
  65. 0
      test/test_chordpro/23.csg.source
  66. 0
      test/test_chordpro/23.tsg
  67. 0
      test/test_chordpro/24.csg
  68. 0
      test/test_chordpro/24.csg.source
  69. 0
      test/test_chordpro/24.tsg
  70. 0
      test/test_chordpro/25.csg
  71. 0
      test/test_chordpro/25.csg.source
  72. 0
      test/test_chordpro/25.tsg
  73. 0
      test/test_chordpro/26.csg
  74. 0
      test/test_chordpro/26.csg.source
  75. 0
      test/test_chordpro/26.tsg
  76. 0
      test/test_chordpro/27.csg
  77. 0
      test/test_chordpro/27.csg.source
  78. 0
      test/test_chordpro/27.tsg
  79. 0
      test/test_chordpro/28.csg
  80. 0
      test/test_chordpro/28.csg.source
  81. 0
      test/test_chordpro/28.tsg
  82. 0
      test/test_chordpro/29.csg
  83. 0
      test/test_chordpro/29.csg.source
  84. 0
      test/test_chordpro/29.tsg
  85. 0
      test/test_chordpro/author_names.csg
  86. 0
      test/test_chordpro/author_names.csg.source
  87. 0
      test/test_chordpro/author_names.tsg
  88. 0
      test/test_chordpro/chords.csg
  89. 0
      test/test_chordpro/chords.csg.source
  90. 0
      test/test_chordpro/chords.tsg
  91. 0
      test/test_chordpro/customchords.csg
  92. 0
      test/test_chordpro/customchords.csg.source
  93. 0
      test/test_chordpro/customchords.tsg
  94. 0
      test/test_chordpro/errors/invalid_content.csg.source
  95. 0
      test/test_chordpro/greensleeves.csg
  96. 0
      test/test_chordpro/greensleeves.csg.source
  97. 0
      test/test_chordpro/greensleeves.tsg
  98. 0
      test/test_chordpro/invalid_chord.csg
  99. 0
      test/test_chordpro/invalid_chord.csg.source
  100. 0
      test/test_chordpro/invalid_chord.tsg

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

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

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

0
examples/songs/greensleeves.sgc → examples/songs/greensleeves.csg

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

0
examples/songs/tests/chords.sgc → examples/songs/tests/chords.csg

0
examples/songs/tests/errors.sgc → examples/songs/tests/errors.csg

0
examples/songs/tests/newline.sgc → examples/songs/tests/newline.csg

0
examples/songs/tests/nolyrics.sgc → examples/songs/tests/nolyrics.csg

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

2
patacrep/build.py

@ -109,7 +109,7 @@ class Songbook(object):
datadirs=config.get('datadir', []), datadirs=config.get('datadir', []),
root_modules=['songs'], root_modules=['songs'],
keyword='SONG_RENDERERS', keyword='SONG_RENDERERS',
)['latex'] )['tsg']
# Configuration set # Configuration set
config['render'] = content.render config['render'] = content.render

1
patacrep/songbook/__main__.py

@ -153,7 +153,6 @@ def main():
# Command line options # Command line options
datadirs += [item[0] for item in options.datadir] datadirs += [item[0] for item in options.datadir]
if 'datadir' in songbook: if 'datadir' in songbook:
# .sg file
if isinstance(songbook['datadir'], str): if isinstance(songbook['datadir'], str):
songbook['datadir'] = [songbook['datadir']] songbook['datadir'] = [songbook['datadir']]
datadirs += [ datadirs += [

10
patacrep/songs/chordpro/__init__.py

@ -131,13 +131,13 @@ class Chordpro2ChordproSong(ChordproSong):
return filename return filename
SONG_RENDERERS = { SONG_RENDERERS = {
"latex": { "tsg": {
'sgc': Chordpro2LatexSong, 'csg': Chordpro2LatexSong,
}, },
"html": { "html": {
'sgc': Chordpro2HtmlSong, 'csg': Chordpro2HtmlSong,
}, },
"chordpro": { "csg": {
'sgc': Chordpro2ChordproSong, 'csg': Chordpro2ChordproSong,
}, },
} }

4
patacrep/songs/convert/__main__.py

@ -17,7 +17,7 @@ def __usage():
return "python3 -m patacrep.songs.convert INPUTFORMAT OUTPUTFORMAT FILES" return "python3 -m patacrep.songs.convert INPUTFORMAT OUTPUTFORMAT FILES"
def confirm(destname): def confirm(destname):
while True while True:
try: try:
return yesno(input("File '{}' already exist. Overwrite? [yn] ".format(destname))) return yesno(input("File '{}' already exist. Overwrite? [yn] ".format(destname)))
except ValueError: except ValueError:
@ -62,7 +62,7 @@ if __name__ == "__main__":
if not confirm(destname): if not confirm(destname):
continue continue
with open(destname, "w") as destfile: with open(destname, "w") as destfile:
destfile.write(song.render(dest)) destfile.write(song.render())
except NotImplementedError: except NotImplementedError:
LOGGER.error("Cannot convert to format '%s'.", dest) LOGGER.error("Cannot convert to format '%s'.", dest)

7
patacrep/songs/latex/__init__.py

@ -49,8 +49,11 @@ class Latex2LatexSong(Song):
self.lang = custom_lang self.lang = custom_lang
SONG_RENDERERS = { SONG_RENDERERS = {
"latex": { "tsg": {
'is': Latex2LatexSong, 'tis': Latex2LatexSong,
'tsg': Latex2LatexSong,
# For backward compatibility
'sg': Latex2LatexSong, 'sg': Latex2LatexSong,
}, },
} }

0
test/test_chordpro/00.sgc → test/test_chordpro/00.csg

0
test/test_chordpro/00.source → test/test_chordpro/00.csg.source

0
test/test_chordpro/00.tex → test/test_chordpro/00.tsg

0
test/test_chordpro/01.sgc → test/test_chordpro/01.csg

0
test/test_chordpro/01.source → test/test_chordpro/01.csg.source

0
test/test_chordpro/01.tex → test/test_chordpro/01.tsg

0
test/test_chordpro/02.sgc → test/test_chordpro/02.csg

0
test/test_chordpro/02.source → test/test_chordpro/02.csg.source

0
test/test_chordpro/02.tex → test/test_chordpro/02.tsg

0
test/test_chordpro/03.sgc → test/test_chordpro/03.csg

0
test/test_chordpro/03.source → test/test_chordpro/03.csg.source

0
test/test_chordpro/03.tex → test/test_chordpro/03.tsg

0
test/test_chordpro/04.sgc → test/test_chordpro/04.csg

0
test/test_chordpro/04.source → test/test_chordpro/04.csg.source

0
test/test_chordpro/04.tex → test/test_chordpro/04.tsg

0
test/test_chordpro/05.sgc → test/test_chordpro/05.csg

0
test/test_chordpro/05.source → test/test_chordpro/05.csg.source

0
test/test_chordpro/05.tex → test/test_chordpro/05.tsg

0
test/test_chordpro/06.sgc → test/test_chordpro/06.csg

0
test/test_chordpro/06.source → test/test_chordpro/06.csg.source

0
test/test_chordpro/06.tex → test/test_chordpro/06.tsg

0
test/test_chordpro/07.sgc → test/test_chordpro/07.csg

0
test/test_chordpro/07.source → test/test_chordpro/07.csg.source

0
test/test_chordpro/07.tex → test/test_chordpro/07.tsg

0
test/test_chordpro/08.sgc → test/test_chordpro/08.csg

0
test/test_chordpro/08.source → test/test_chordpro/08.csg.source

0
test/test_chordpro/08.tex → test/test_chordpro/08.tsg

0
test/test_chordpro/09.sgc → test/test_chordpro/09.csg

0
test/test_chordpro/09.source → test/test_chordpro/09.csg.source

0
test/test_chordpro/09.tex → test/test_chordpro/09.tsg

0
test/test_chordpro/10.sgc → test/test_chordpro/10.csg

0
test/test_chordpro/10.source → test/test_chordpro/10.csg.source

0
test/test_chordpro/10.tex → test/test_chordpro/10.tsg

0
test/test_chordpro/11.sgc → test/test_chordpro/11.csg

0
test/test_chordpro/11.source → test/test_chordpro/11.csg.source

0
test/test_chordpro/11.tex → test/test_chordpro/11.tsg

0
test/test_chordpro/12.sgc → test/test_chordpro/12.csg

0
test/test_chordpro/12.source → test/test_chordpro/12.csg.source

0
test/test_chordpro/12.tex → test/test_chordpro/12.tsg

0
test/test_chordpro/13.sgc → test/test_chordpro/13.csg

0
test/test_chordpro/13.source → test/test_chordpro/13.csg.source

0
test/test_chordpro/13.tex → test/test_chordpro/13.tsg

0
test/test_chordpro/21.sgc → test/test_chordpro/21.csg

0
test/test_chordpro/21.source → test/test_chordpro/21.csg.source

0
test/test_chordpro/21.tex → test/test_chordpro/21.tsg

0
test/test_chordpro/22.sgc → test/test_chordpro/22.csg

0
test/test_chordpro/22.source → test/test_chordpro/22.csg.source

0
test/test_chordpro/22.tex → test/test_chordpro/22.tsg

0
test/test_chordpro/23.sgc → test/test_chordpro/23.csg

0
test/test_chordpro/23.source → test/test_chordpro/23.csg.source

0
test/test_chordpro/23.tex → test/test_chordpro/23.tsg

0
test/test_chordpro/24.sgc → test/test_chordpro/24.csg

0
test/test_chordpro/24.source → test/test_chordpro/24.csg.source

0
test/test_chordpro/24.tex → test/test_chordpro/24.tsg

0
test/test_chordpro/25.sgc → test/test_chordpro/25.csg

0
test/test_chordpro/25.source → test/test_chordpro/25.csg.source

0
test/test_chordpro/25.tex → test/test_chordpro/25.tsg

0
test/test_chordpro/26.sgc → test/test_chordpro/26.csg

0
test/test_chordpro/26.source → test/test_chordpro/26.csg.source

0
test/test_chordpro/26.tex → test/test_chordpro/26.tsg

0
test/test_chordpro/27.sgc → test/test_chordpro/27.csg

0
test/test_chordpro/27.source → test/test_chordpro/27.csg.source

0
test/test_chordpro/27.tex → test/test_chordpro/27.tsg

0
test/test_chordpro/28.sgc → test/test_chordpro/28.csg

0
test/test_chordpro/28.source → test/test_chordpro/28.csg.source

0
test/test_chordpro/28.tex → test/test_chordpro/28.tsg

0
test/test_chordpro/29.sgc → test/test_chordpro/29.csg

0
test/test_chordpro/29.source → test/test_chordpro/29.csg.source

0
test/test_chordpro/29.tex → test/test_chordpro/29.tsg

0
test/test_chordpro/author_names.sgc → test/test_chordpro/author_names.csg

0
test/test_chordpro/author_names.source → test/test_chordpro/author_names.csg.source

0
test/test_chordpro/author_names.tex → test/test_chordpro/author_names.tsg

0
test/test_chordpro/chords.sgc → test/test_chordpro/chords.csg

0
test/test_chordpro/chords.source → test/test_chordpro/chords.csg.source

0
test/test_chordpro/chords.tex → test/test_chordpro/chords.tsg

0
test/test_chordpro/customchords.sgc → test/test_chordpro/customchords.csg

0
test/test_chordpro/customchords.source → test/test_chordpro/customchords.csg.source

0
test/test_chordpro/customchords.tex → test/test_chordpro/customchords.tsg

0
test/test_chordpro/errors/invalid_content.source → test/test_chordpro/errors/invalid_content.csg.source

0
test/test_chordpro/greensleeves.sgc → test/test_chordpro/greensleeves.csg

0
test/test_chordpro/greensleeves.source → test/test_chordpro/greensleeves.csg.source

0
test/test_chordpro/greensleeves.tex → test/test_chordpro/greensleeves.tsg

0
test/test_chordpro/invalid_chord.sgc → test/test_chordpro/invalid_chord.csg

0
test/test_chordpro/invalid_chord.source → test/test_chordpro/invalid_chord.csg.source

0
test/test_chordpro/invalid_chord.tex → test/test_chordpro/invalid_chord.tsg

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save