removed obsolete issues (many of them fixed with AE)
[docutils.git] / sandbox / paultremblay / docutils_nest / scripts / docutils-nest-xml.py
blob788f341905d4b9a06465266ff19c46278e90f939
1 #!/usr/bin/env python
3 import sys, os
4 import docutils_nest.nest_utils
5 import docutils_nest.rst_options
8 def convert_file():
9 options_dict = {
10 'output': [1]
12 opt_obj = docutils_nest.rst_options.OptionsRst(sys.argv, options_dict)
13 inline_opts, args, doc_opts = opt_obj.parse_options()
14 if inline_opts == 0:
15 print_help_message()
16 sys.stderr.write('Script will now quite because of illegal options\n')
17 sys.exit(1)
18 try:
19 file = args[0]
20 except IndexError:
21 sys.stderr.write('You must provide a file for the script to convert.\n'
22 'Script will now quit'
24 sys.exit(1)
25 output = inline_opts.get('output')
26 if not output:
27 sys.stderr.write('You must provide an output option for the script to work\n'
28 'Script will now quit\n'
30 sys.exit(1)
31 convert_obj = docutils_nest.nest_utils.RstWithInline(file, output, docutils_opts = doc_opts)
32 convert_obj.convert()
34 if __name__ == '__main__':
35 convert_file()