On 6/13/2013 1:24 PM, Fidel Pérez wrote:
It happens as follows:

I have two nodes, the parent node, whose body is:

    @others
    speak('this is a test')
    #Original_Function_XX_00 Read (MyVariable) out loud using
    TTS_XX_00_TTS_XX_00_Functions_XX_00_Python 2.7_XX_00_Programming
    Languages
    #Original_Variable_XX_0 'this is a test'


And the child node, whose body is:

    import pyttsx
    def speak( text ):
        if text != "":
            engine = pyttsx.init()
            v=engine.getProperty('voices')
            engine.setProperty('voice', v[3].id)
            engine.say( text )
            engine.runAndWait()
        else:
            g.es("There is no text to read!")



The Leo-generated ScriptFile.py for execution is as follows:

    #@+leo-ver=5
    #@+node:Read ('this is a test') out loud using TTS
    #@+others
    #@+node:Import and definition
    import pyttsx
    def speak( text ):
        if text != "":
            engine = pyttsx.init()
            v=engine.getProperty('voices')
            engine.setProperty('voice', v[3].id)
            engine.say( text )
            engine.runAndWait()
        else:
            g.es("There is no text to read!")
    #@-others
    #@-leo

For some reason, it does not use the contains of the parent node. Im thinking it is a bug since if I use simpler code, it works, for instance, the following code will work as expected:

parent body:

    @others
    g.es('work')

Child body:

    g.es('this should')



Any thoughts?

Confirmed! It appears to be the quotes in the headline of the parent node. When I removed them, the file generated properly.

This is most definitely a bug, imo. I'd say "please file a bug report" but I'm sure you will.

-->Jake


--
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.



--
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
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