| | 7 | from distutils.cmd import Command |
|---|
| | 8 | |
|---|
| | 9 | class build_doc(Command): |
|---|
| | 10 | description = 'Builds the documentation' |
|---|
| | 11 | user_options = [] |
|---|
| | 12 | |
|---|
| | 13 | def initialize_options(self): |
|---|
| | 14 | pass |
|---|
| | 15 | |
|---|
| | 16 | def finalize_options(self): |
|---|
| | 17 | pass |
|---|
| | 18 | |
|---|
| | 19 | def run(self): |
|---|
| | 20 | epydoc_conf = 'epydoc.conf' |
|---|
| | 21 | |
|---|
| | 22 | try: |
|---|
| | 23 | import sys |
|---|
| | 24 | from epydoc import cli |
|---|
| | 25 | old_argv = sys.argv[1:] |
|---|
| | 26 | sys.argv[1:] = [ |
|---|
| | 27 | '--config=%s' % epydoc_conf, |
|---|
| | 28 | '--no-private', # epydoc bug, not read from config |
|---|
| | 29 | '--simple-term', |
|---|
| | 30 | '--verbose' |
|---|
| | 31 | ] |
|---|
| | 32 | cli.cli() |
|---|
| | 33 | sys.argv[1:] = old_argv |
|---|
| | 34 | |
|---|
| | 35 | except ImportError: |
|---|
| | 36 | print 'epydoc not installed, skipping API documentation.' |
|---|