Browse Source

Merge branch 'master' of git://git.lohrun.net/songbook

remotes/origin/translate_notes
Romain Goffe 16 years ago
parent
commit
62285f1317
  1. 40
      songbook-volume.py
  2. 0
      songs/Eels/Dirty_girl.sg
  3. 0
      songs/Kana/Plantation.sg
  4. 0
      songs/Pow_Wow/Le_lion_est_mort_ce_soir.sg
  5. 0
      songs/The_Pogues/Fairytale_of_New-York.sg

40
songbook-volume.py

@ -0,0 +1,40 @@
#!/usr/bin/python
#
import os.path
import glob
def formatSongsDatabase( file, songs ):
sdb = open( file, 'w' )
dir = ['img']+map(os.path.dirname, songs)
dir = set( dir )
sdb.write('\graphicspath{\n')
for dirname in dir:
sdb.write(' {{{imagedir}/}},\n'.format(imagedir=dirname))
sdb.write('}\n')
for song in songs:
sdb.write('\input{{{songfile}}}\n'.format(songfile=song.strip()))
sdb.close();
def main():
songfiles = glob.glob('songs/*/*.sg')
songvolumes = glob.glob('songs-volume-*')
for volume in songvolumes:
songs = []
vol = open( volume )
for song in vol:
s = song.strip()
songs.append( s )
songfiles.remove( s )
vol.close()
formatSongsDatabase( 'db_'+volume+'.sdb', songs )
formatSongsDatabase( 'songs.sdb', songfiles )
if __name__ == '__main__':
main()

0
songs/Eels/Dirty_girl.sg

0
songs/Kana/Plantation.sg

0
songs/Pow_Wow/Le_lion_est_mort_ce_soir.sg

0
songs/The_Pogues/Fairytale_of_New-York.sg

Loading…
Cancel
Save