/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tools/package_docs.py

  • Committer: Marius Kruger
  • Date: 2010-07-10 21:28:56 UTC
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100710212856-uq4ji3go0u5se7hx
* Update documentation
* add NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python3
 
1
#!/usr/bin/python
2
2
 
3
3
# Copyright 2009 Canonical Ltd.
4
4
#
41
41
    copytree(src_html, dest_html)
42
42
 
43
43
    # Package the html as a downloadable archive
44
 
    archive_root = "brz-%s-html" % (section,)
 
44
    archive_root = "bzr-%s-html" % (section,)
45
45
    archive_basename = "%s.tar.bz2" % (archive_root,)
46
46
    archive_name = os.path.join(dest_downloads, archive_basename)
47
47
    build_archive(src_html, archive_name, archive_root, 'bz2')
48
48
 
49
49
    # Copy across the PDF docs, if any, including the quick ref card
50
50
    pdf_files = []
51
 
    quick_ref = os.path.join(
52
 
        src_html, '_static/%s/brz-%s-quick-reference.pdf' % (section, section))
 
51
    quick_ref = os.path.join(src_html,
 
52
        '_static/%s/bzr-%s-quick-reference.pdf' % (section, section))
53
53
    if os.path.exists(quick_ref):
54
54
        pdf_files.append(quick_ref)
55
55
    src_pdf = os.path.join(src_build, 'latex')
68
68
 
69
69
 
70
70
def build_archive(src_dir, archive_name, archive_root, format):
71
 
    print("creating %s ..." % (archive_name,))
 
71
    print "creating %s ..." % (archive_name,)
72
72
    tar = tarfile.open(archive_name, "w:%s" % (format,))
73
73
    for relpath in os.listdir(src_dir):
74
74
        src_path = os.path.join(src_dir, relpath)
98
98
    dest_downloads = os.path.join(dest_dir, 'downloads')
99
99
    for d in [dest_dir, dest_downloads]:
100
100
        if not os.path.exists(d):
101
 
            print("creating directory %s ..." % (d,))
 
101
            print "creating directory %s ..." % (d,)
102
102
            os.mkdir(d)
103
103
 
104
104
    # Package and copy the files across