summaryrefslogtreecommitdiff
path: root/sandbox/py-rest-doc/convert.py
blob: 3654a1fca903492c1908a90c4e9f41564ce94375 (plain)
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
# -*- coding: utf-8 -*-
"""
    Convert the Python documentation to Sphinx
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    :copyright: 2007 by Georg Brandl.
    :license: Python license.
"""

import sys
import os

from converter import convert_dir

if __name__ == '__main__':
    try:
        rootdir = sys.argv[1]
        destdir = os.path.abspath(sys.argv[2])
    except IndexError:
        print "usage: convert.py docrootdir destdir"
        sys.exit()

    assert os.path.isdir(os.path.join(rootdir, 'texinputs'))
    os.chdir(rootdir)
    convert_dir(destdir, *sys.argv[3:])