Re: rst2odt and odf-config-file option
Dave Kuhlman <[email protected]>
| Newsgroups | gmane.text.docutils.user |
|---|---|
| Message-ID | <[email protected]> |
Gilles,
Ugh. Did I really do that?
Thanks for this fix.
I'll do some testing and will check the unit tests. Then I'll push
it back to the repo.
Question for the docutils list: When I apply the `flake8` style and
error checker to `__init__.py`, I get lots of warnings (405 when I
count them with `wc`). Most of them have to do with indentation,
missing or extra blank lines, missing or extra spaces, etc. I'm
willing to clean those up. Or, would that amount of changes be too
disruptive (for example, in making svn history less useful)? Anyone
have an opinion? Clean it up? Leave it alone? If I do it, I'll
make an extra check-in with only those cleanup changes.
Dave K
On Thu, Feb 07, 2019 at 01:48:42PM +0100, POIRET via Docutils-users wrote:
> Hello,
>
> I guess I've found a bug on rst2odt.py
>
> --
>
> I wanted to apply custom style with rst2odt, and discovered the
> --odf-config-file option.
>
> This option allows to map the default style to a custom one (so, used in
> conjunction with --template option).
>
> But it was not working on my environment (Debian 9, python3, docutils 1.4)
>
> --
>
> The __init__ method (l. 888) of the ODFTranslator class initializes a
> dictionary : format_map, but it's filled only for python2
>
> Involved file:
> /usr/lib/python3/dist-packages/docutils/writers/odf_odt/__init__.py
>
> parser = ConfigParser()
> parser.read(self.settings.odf_config_file)
> for rststyle, format in parser.items("Formats"):
> if rststyle not in self.used_styles:
> self.document.reporter.warning(
> 'Style "%s" is not a style used by odtwriter.' % (
> rststyle, ))
> if sys.version_info.major == 2:
> self.format_map[rststyle] = format.decode('utf-8')
> # my addition below
>
> else:
> self.format_map[rststyle] = format
>
> ---
>
> After applying my update, it works. (never tested with python2)
>
>
> Let me know if I can do something else.
>
> Regards,
>
> --
>
> Gilles
>
>
>
>
>
>
> _______________________________________________
> Docutils-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/docutils-users
>
> Please use "Reply All" to reply to the list.
--
Dave Kuhlman
http://www.davekuhlman.org