~parthm/bzr-alldocs/bzr-grep-0.3.0-help

« back to all changes in this revision

Viewing changes to build-sites.py

  • Committer: Ian Clatworthy
  • Date: 2010-01-20 02:18:43 UTC
  • Revision ID: ian.clatworthy@canonical.com-20100120021843-hoqvtm8p7kw09yvj
extend build-sites.py to rebuild the plugins guide

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import os, shutil
20
20
 
21
21
langs = ['en', 'fr', 'ja', 'ru']
 
22
guides = ['plugins']
22
23
 
23
24
# Build the sites
24
25
for lang in langs:
26
27
    os.chdir(lang)
27
28
    os.system("make html")
28
29
    os.chdir("..")
 
30
for guide in guides:
 
31
    print "\nBuilding the %s guide ..." % (guide,)
 
32
    os.chdir("%s/en" % guide)
 
33
    os.system("make html")
 
34
    os.chdir("../..")
29
35
 
30
36
# Collect the sites together into one place
31
37
if not os.path.exists("_build"):
38
44
        shutil.rmtree(dest)
39
45
    print "copying %s => %s" % (src, dest)
40
46
    shutil.copytree(src, dest)
 
47
for guide in guides:
 
48
    src = os.path.join(guide, "en", "_build", "html")
 
49
    parent_dest = os.path.join("_build", guide)
 
50
    if not os.path.exists(parent_dest):
 
51
        os.mkdir(parent_dest)
 
52
    dest = os.path.join(parent_dest, "en")
 
53
    if os.path.exists(dest):
 
54
        print "removing existing %s" % (dest,)
 
55
        shutil.rmtree(dest)
 
56
    print "copying %s => %s" % (src, dest)
 
57
    shutil.copytree(src, dest)