]> git.donarmstrong.com Git - lilypond.git/blobdiff - buildscripts/www_post.py
Merge master into nested-bookparts
[lilypond.git] / buildscripts / www_post.py
index 278895aff93b7cc51ea73e9cd980fe932cfa2e0b..29f80cf09fa2bb208995e7c5094974782c6ee566 100644 (file)
@@ -3,15 +3,19 @@
 ## This is www_post.py. This script is the main stage
 ## of toplevel GNUmakefile local-WWW-post target.
 
-# USAGE: www_post PACKAGE_NAME TOPLEVEL_VERSION BUILDSCRIPT-DIR OUTDIR TARGETS
+# USAGE: www_post PACKAGE_NAME TOPLEVEL_VERSION OUTDIR TARGETS
 # please call me from top of the source directory
 
 import sys
 import os
 import re
-import gettext
 
-package_name, package_version, buildscript_dir, localedir, outdir, targets = sys.argv[1:]
+import langdefs
+
+import mirrortree
+import postprocess_html
+
+package_name, package_version, outdir, targets = sys.argv[1:]
 targets = targets.split (' ')
 outdir = os.path.normpath (outdir)
 doc_dirs = ['input', 'Documentation', outdir]
@@ -30,8 +34,6 @@ static_files = {
 <html><body>Redirecting to the documentation index...</body></html>\n'''
     }
 
-import langdefs
-
 for l in langdefs.LANGUAGES:
     static_files[os.path.join ('Documentation', 'user', outdir, l.file_name ('index', '.html'))] = \
                                   '<META HTTP-EQUIV="refresh" content="0;URL=../' + l.file_name ('index', '.html') + \
@@ -40,17 +42,12 @@ for l in langdefs.LANGUAGES:
 for f, contents in static_files.items ():
     open (f, 'w').write (contents)
 
-
-sys.path.append (buildscript_dir)
-import mirrortree
-import add_html_footer
-
 sys.stderr.write ("Mirrorring...\n")
 dirs, symlinks, files = mirrortree.walk_tree (
     tree_roots = doc_dirs,
     process_dirs = outdir,
-    exclude_dirs = '(^|/)(' + '|'.join ([l.code for l in langdefs.LANGUAGES]) + r'|po|out|.*?[.]t2d|\w*?-root)(/|$)',
-    find_files = r'.*?\.(?:midi|html|pdf|png|txt|ly|signature)$|VERSION',
+    exclude_dirs = '(^|/)(' + r'|po|out|out-test|.*?[.]t2d|\w*?-root)(/|$)|Documentation/(' + '|'.join ([l.code for l in langdefs.LANGUAGES]) + ')',
+    find_files = r'.*?\.(?:midi|html|pdf|png|txt|i?ly|signature|css)$|VERSION',
     exclude_files = r'lily-[0-9a-f]+.*\.(pdf|txt)')
 
 # actual mirrorring stuff
@@ -92,17 +89,10 @@ if 'online' in targets:
     f.write ('#.htaccess\nDirectoryIndex index\n')
     f.close ()
 
-# load gettext messages catalogs
-translation = {}
-for l in langdefs.LANGUAGES:
-    if l.enabled and l.code != 'en':
-        translation[l.code] = gettext.translation('lilypond-doc', localedir, [l.code]).gettext
-
-add_html_footer.build_pages_dict (html_files)
+postprocess_html.build_pages_dict (html_files)
 for t in targets:
     sys.stderr.write ("Processing HTML pages for %s target...\n" % t)
-    add_html_footer.add_html_footer (
-        translation = translation,
+    postprocess_html.process_html_files (
         package_name = package_name,
         package_version = package_version,
         target = t,