On Tue, 5 Nov 2013 14:51:18 -0800 (PST)
wgw <[email protected]> wrote:
> Some commands, such as print-settings, go directly to the log panel (via
> g.es) . Is there a way to redirect output from the log pane to a variable?
>
> For example, I would like to be able to run these (fictitous!) commands:
>
> c.redirect(logpane, myvariable)
> c.executeMinibufferCommand("print-settings")
> c.redirect(myvariable,logpane)
>
> list_of_settings= myvariable.split("\n")
c.frame.log.setAllText('') # clears log
[do stuff sending output to log]
text = c.frame.log.getAllText()
> The executeMiniBufferComand does work; I just want to be able to redirect
> the output of the command it executes.
>
> Another question: I noticed that the executeMinibufferCommand is not in the
> c keys if I run:
>
> g.es("Names defined in commander c",color="purple")
> names = c.__dict__.keys()
> names.sort()
> for name in names:
> g.es(name)
I think it's more robust to use `dir(c)` rather than `c.__dict__`, it
shows up in the former. Just depends how it's added to the class.
Cheers -Terry
> I do find it in the docs, and in leo-editor.readthedocs (VERY useful!). The
> readthedocs search doesn't work, but I can find it with Google.
>
> executeMinibufferCommand is available as code completion. Why would it not
> be listed in c.__dict__ ?
>
> Thanks!
>
> Bill
>
--
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.