9 lilypond_git_dir = os.environ["LILYPOND_GIT"]
10 lilypond_web_media_dir = os.environ["LILYPOND_WEB_MEDIA_GIT"]
12 print "Error: you must have these environment variables defined:"
13 print " $LILYPOND_GIT"
14 print " $LILYPOND_WEB_MEDIA_GIT"
17 build_dir = os.path.join(lilypond_git_dir, 'build')
19 def get_pictures_from(dirname):
21 examine_dirname = os.path.join(build_dir,
22 "Documentation", dirname, "out-www")
24 glob.glob(os.path.join(examine_dirname, "*.png")) +
25 glob.glob(os.path.join(examine_dirname, "*.jpg")))
27 print "Cannot find files (maybe a problem with your build directory?)"
30 pictures_filenames = get_pictures_from("pictures")
31 ly_examples_filenames = get_pictures_from(os.path.join("web", "ly-examples"))
33 pictures_dest = os.path.join(lilypond_web_media_dir, "pictures")
34 ly_examples_dest = os.path.join(lilypond_web_media_dir, "ly-examples")
35 for filename in pictures_filenames:
36 shutil.copy(filename, pictures_dest)
37 for filename in ly_examples_filenames:
38 shutil.copy(filename, ly_examples_dest)
40 print "Finished copying."
41 print "Don't forget to git commit and push to the lilypond-web-media repository!"