]> git.donarmstrong.com Git - lilypond.git/commitdiff
Web build: add .en.html symlinks.
authorGraham Percival <graham@percival-music.ca>
Mon, 8 Mar 2010 12:02:19 +0000 (12:02 +0000)
committerGraham Percival <graham@percival-music.ca>
Mon, 8 Mar 2010 13:27:57 +0000 (13:27 +0000)
According to the old python scripts, this is necessary for
automatic language selection.  I don't know if that's true or not,
but it's an easy addition.

Next step: refactor this file and conform to lilypond's python
guidelines.

scripts/build/website_post.py

index bf04895c772571d8d250ea6aa562a0c39ced882b..9846db819d809fb6fd82e90c028cfb8e7af4b777 100644 (file)
@@ -30,7 +30,9 @@ lang_other_langs = {
 indir = sys.argv[1]
 outdir=indir
 
-html_files = glob.glob( os.path.join(indir, '*.html') )
+os.chdir(indir)
+
+html_files = glob.glob( '*.html' )
 
 # messy way to get all languages
 langs_set = set()
@@ -77,6 +79,9 @@ for file in html_files:
        if (len(file_split) == 2):
                # it's English
                lang = ''
+               # possibly necessary for automatic language selection
+               file_symlink =file.replace(".html", ".en.html")
+               os.symlink (file, file_symlink)
        else:
                # it's a translation
                lang = file_split[1]
@@ -93,7 +98,7 @@ for file in html_files:
        # ick
        lang_footer = makeFooter(lang, out_filename.split('.')[0])
        
-       outfile = open( os.path.join(outdir, out_filename), 'w')
+       outfile = open( out_filename, 'w')
        for line in lines:
                # avoid external links
                if ((line.find("href") >= 0) and (line.find("http")==-1)):