139 |
config.mp_generate = 0 |
config.mp_generate = 0 |
140 |
for rstfile in rstfiles: |
for rstfile in rstfiles: |
141 |
config.input_filename = rstfile |
config.input_filename = rstfile |
142 |
config.output_filename = '' |
config.output_filename = rstfile[0:len(rstfile)-4]+'.gen.html' |
143 |
pub = Publisher() |
pub = Publisher() |
144 |
pub.set_reader('standalone', None, 'restructuredtext') |
pub.set_reader('standalone', None, 'restructuredtext') |
145 |
filename = slashify(config.working_directory)+rstfile |
filename = slashify(config.working_directory)+rstfile |
149 |
try: |
try: |
150 |
pub.set_io() |
pub.set_io() |
151 |
document = pub.reader.read(pub.source, pub.parser, pub.settings) |
document = pub.reader.read(pub.source, pub.parser, pub.settings) |
|
config.output_filename = rstfile[0:len(rstfile)-4]+'.gen.html' |
|
152 |
pub.apply_transforms(document) |
pub.apply_transforms(document) |
153 |
peg['ignore'].append(config.output_filename) |
peg['ignore'].append(config.output_filename) |
|
config.output_filename = '' |
|
154 |
|
|
155 |
#conversion have succeeded so far, parsing peg's metadata |
#conversion have succeeded so far, parsing peg's metadata |
156 |
#from its document tree |
#from its document tree |
176 |
except: |
except: |
177 |
dbg_fail('PEG %s: Docutil raised an exception while converting %s. ' % (pegdir, rstfile)) |
dbg_fail('PEG %s: Docutil raised an exception while converting %s. ' % (pegdir, rstfile)) |
178 |
dbg_fail('Conversion failed and HTML not created.\n') |
dbg_fail('Conversion failed and HTML not created.\n') |
179 |
|
|
180 |
config.dbg.enable('docutils') |
config.dbg.enable('docutils') |
181 |
config.mp_generate = 1 |
config.mp_generate = 1 |
182 |
|
|