27 |
|
|
28 |
__docformat__ = 'reStructuredText' |
__docformat__ = 'reStructuredText' |
29 |
|
|
30 |
import sys, os.path |
import sys, os.path, getopt |
31 |
|
|
32 |
import docutils.core |
import docutils.core |
33 |
|
|
34 |
import navidoc.utils.path |
from navidoc.utils.path import _rstFiles, _slashify, relative_path |
35 |
|
|
36 |
import config |
import config |
37 |
|
|
79 |
docutils.core.publish_cmdline(writer_name='latex', argv=args.split()) |
docutils.core.publish_cmdline(writer_name='latex', argv=args.split()) |
80 |
|
|
81 |
# catching loop parameters from the command line |
# catching loop parameters from the command line |
82 |
try: sys.argv.remove("loop"); loop = 1 |
try: sys.argv.remove("--loop"); loop = 1 |
83 |
except ValueError: loop = 0 |
except ValueError: loop = 0 |
84 |
|
|
85 |
# catching writer parameters from the command line |
# catching writer parameters from the command line |
86 |
try: sys.argv.remove("2latex"); latex = 1 |
try: sys.argv.remove("--latex"); latex = 1 |
87 |
except ValueError: latex = 0 |
except ValueError: latex = 0 |
88 |
|
|
89 |
# catching writer parameters from the command line |
# catching writer parameters from the command line |
90 |
try: sys.argv.remove("2html"); html = 1 |
try: sys.argv.remove("--html"); html = 1 |
91 |
except ValueError: html = 0 |
except ValueError: html = 0 |
92 |
|
|
93 |
# catching debug parameters |
# catching debug parameters |
94 |
try: |
dbg_names, sys.argv = getopt.getopt(sys.argv[1:], config.dbg.short, config.dbg.long) |
95 |
while 1: |
for dbg_name in dbg_names: |
96 |
dbg_name = sys.argv[sys.argv.index("-d") + 1] |
config.dbg.enable(dbg_name[1]) |
97 |
config.dbg.enable(dbg_name) |
print "Enabling debug output for:", dbg_name[1] |
|
print "Enabling debug output for:", dbg_name |
|
|
sys.argv.remove("-d") |
|
|
sys.argv.remove(dbg_name) |
|
|
|
|
|
except ValueError: pass |
|
98 |
|
|
99 |
# conversion loop |
# conversion loop |
100 |
while 1: |
while 1: |
101 |
|
|
102 |
#the first pass, docutils |
#the first pass, docutils |
103 |
for path in sys.argv[1:]: |
for path in sys.argv: |
104 |
run_docutils(path) |
run_docutils(path) |
105 |
|
|
106 |
# try: |
# try: |