21 |
# MA 02111-1307 USA |
# MA 02111-1307 USA |
22 |
# |
# |
23 |
|
|
24 |
#$id:$ |
#$Id$ |
25 |
|
|
26 |
# |
# |
27 |
# Written by Asko Soukka |
# Written by Asko Soukka |
29 |
|
|
30 |
__docformat__ = 'reStructuredText' |
__docformat__ = 'reStructuredText' |
31 |
|
|
32 |
|
import config |
33 |
|
|
34 |
import sys, os, getopt |
import sys, os, getopt |
35 |
import docutils.core |
import docutils.core |
36 |
|
|
|
import config |
|
|
|
|
37 |
import navidoc.directives |
import navidoc.directives |
38 |
import navidoc.writers |
#import navidoc.writers |
39 |
|
import navidoc.modules |
40 |
|
|
41 |
from navidoc.utils.path import _slashify, _listdir |
from navidoc.utils.path import * |
42 |
|
|
43 |
""" |
""" |
44 |
The main frontend for running Navidoc. |
The main frontend for running Navidoc. |
127 |
specified by ``path``) and forwards them to conversion method. |
specified by ``path``) and forwards them to conversion method. |
128 |
""" |
""" |
129 |
if os.path.isdir(path) and not os.path.islink(path): |
if os.path.isdir(path) and not os.path.islink(path): |
130 |
dirlist = _listdir(path,['rst'],dirs=1) |
dirlist = listdir(path,['rst'],dirs=1) |
131 |
if os.path.isfile(_slashify(path) + 'docutils.conf'): |
if os.path.isfile(slashify(path) + 'docutils.conf'): |
132 |
config.docutils = _slashify(path) + 'docutils.conf' |
config.docutils = slashify(path) + 'docutils.conf' |
133 |
for entry in dirlist: |
for entry in dirlist: |
134 |
run_docutils(_slashify(path)+entry) |
run_docutils(slashify(path)+entry) |
135 |
elif os.path.isfile(path): |
elif os.path.isfile(path): |
136 |
config.working_directory = os.path.normpath(os.path.dirname(path)) |
config.working_directory = os.path.normpath(os.path.dirname(path)) |
137 |
config.input_filename = os.path.basename(path) |
config.input_filename = os.path.basename(path) |