rst2odt.py 825 B

12345678910111213141516171819202122232425262728
  1. #!/Users/sasha/Desktop/sharix-open-webapp-base/venv/bin/python3
  2. # $Id: rst2odt.py 8994 2022-01-29 16:28:17Z milde $
  3. # Author: Dave Kuhlman <dkuhlman@rexx.com>
  4. # Copyright: This module has been placed in the public domain.
  5. """
  6. A front end to the Docutils Publisher, producing OpenOffice documents.
  7. """
  8. try:
  9. import locale
  10. locale.setlocale(locale.LC_ALL, '')
  11. except:
  12. pass
  13. from docutils.core import publish_cmdline_to_binary, default_description
  14. from docutils.writers.odf_odt import Writer, Reader
  15. description = ('Generates OpenDocument/OpenOffice/ODF documents from '
  16. 'standalone reStructuredText sources. ' + default_description)
  17. writer = Writer()
  18. reader = Reader()
  19. output = publish_cmdline_to_binary(reader=reader, writer=writer,
  20. description=description)