/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to tools/package_docs.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    copytree(src_html, dest_html)
42
42
 
43
43
    # Package the html as a downloadable archive
44
 
    archive_root = "bzr-%s-html" % (section,)
 
44
    archive_root = "brz-%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')
49
49
    # Copy across the PDF docs, if any, including the quick ref card
50
50
    pdf_files = []
51
51
    quick_ref = os.path.join(src_html,
52
 
        '_static/%s/bzr-%s-quick-reference.pdf' % (section, section))
 
52
        '_static/%s/brz-%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