On Tuesday, October 15, 2013 2:57:45 AM UTC-5, Edward K. Ream wrote:
>
> On Mon, Oct 14, 2013 at 3:09 PM, Viktor Ransmayr <
> [email protected]> wrote:
>
> >> [Terry] it sounds as if the rst3 command expects the view rendered 
> pane to exist, and fails if it doesn't.
>
> > 
> You were right. - As soon as I added the plugin 'viewrendered.py' to 
> 'myLeoSettings.leo' the command 'rst3' worked without problems ...
>
> I think this should be fixed somehow.  I'll look into it.
>

Mystery solved.  There is no actual dependency in leoRst.py on the 
viewrendered plugin, but there was a missing import in leoRst that happened 
to be viewrendered.py(!)

The fix is on the trunk at rev 6145.  All unit tests pass, and the rst3 
command still works ;-)

The old code, in both viewrendered.py and leoRst.py was (modulo the plugin 
name)::

    docutils = 
g.importExtension('docutils',pluginName='viewrendered.py',verbose=False)

But in viewrendered, there was *also* this import::

    from docutils.core import publish_string

It looks like this additional statement sufficed to define docutils.core in 
leoRst.py(!)

The new code, in both places is::

    try:
        import docutils
        import docutils.core
    except ImportError:
        docutils = None

Imo, g.importExtension should be deprecated unless the module is expected 
to be in the extensions folder, and I don't see why this applies to 
docutils.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to