File: genreference.py

package info (click to toggle)
python-reportlab 3.3.0-2%2Bdeb9u1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 7,172 kB
  • sloc: python: 71,880; ansic: 19,093; xml: 1,494; makefile: 416; java: 193; sh: 100
file content (31 lines) | stat: -rw-r--r-- 1,233 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/env python
#Copyright ReportLab Europe Ltd. 2000-2016
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/docs/reference/genreference.py
__version__='3.3.0'
__doc__ = """
This module contains the script for building the reference.
"""
def run(verbose=None, outDir=None):
    import os, sys, shutil
    if verbose is None: verbose=('-s' not in sys.argv)
    cwd = os.getcwd()
    docsDir=os.path.dirname(os.path.dirname(sys.argv[0]) or cwd)
    topDir=os.path.dirname(docsDir)
    sys.path.insert(0,topDir)
    from tools.docco import yaml2pdf
    yaml2pdf.run('reference.yml','reportlab-reference.pdf')
    if verbose: print('Saved reportlab-reference.pdf')
    if not outDir: outDir = os.path.join(topDir,'docs')
    destfn = os.path.join(outDir,'reportlab-reference.pdf')
    shutil.copyfile('reportlab-reference.pdf', destfn)
    if verbose: print('copied to %s' % destfn)

def makeSuite():
    "standard test harness support - run self as separate process"
    from tests.utils import ScriptThatMakesFileTest
    return ScriptThatMakesFileTest('../docs/reference', 'genreference.py', 'reportlab-reference.pdf')


if __name__=='__main__':
    run()