On Fri, 28 Nov 2014 23:11:15 -0800
Matt Wilkie <map...@gmail.com> wrote:

> > for k in c.db.keys():
> >     if k.split('/')[0] in (
> >         "window_position_fcache",
> >         "body_secondary_ratio_fcache",
> >         "body_outline_ratio_fcache",
> >         "current_position_fcache",
> >     ):
> >         del c.db[k]
> >
> 
> 
> Thanks Terry! That cured my problem and introduced me to a new Leo
> thing at the same time. Niceness.
> 
> Now how did you get that nicely formatted `c.db.keys()` in the first
> section? I had to wrap it in `g.es(c.db.keys())`, and then it prints
> all in one line.

There are three command in the valuespace plugin that are easy to use
and understand, unlike the rest of the plugin ;-)

  vs-eval
  
  Execute the selected text, if any. Select next line of text.
  
  Tries hard to capture the result of from the last expression in the
  selected text:
  
  import datetime
  today = datetime.date.today()
  
  will captue the value of today even though the last line is a
  statement, not an expression.
  
  Stores results in c.vs['_last'] for insertion into body by vs-last or 
vs-last-pretty.
  
  Removes common indentation (textwrap.dedent()) before executing,
  allowing execution of indented code.
  
  g, c, and p are available to executing code, assignments are made in
  the c.vs namespace and persist for the life of c.
  
  vs-last
  
  Insert the last result from vs-eval. Inserted as a string, so "1 2 3 4"
  will cover four lines and insert no quotes, for repr() style insertion
  use vs-last-pretty.
  
  vs-last-pretty
  
  Insert the last result from vs-eval. Formatted by pprint.pformat(), so
  "1 2 3 4" will appear as ‘"1 2 3 4"’, see all vs-last.
  
Hmm, I think copy past has confused those docs., but you get the idea -
these are an alternative to the regular Ctrl-B execute code.

Oddly enough I think all the incomprehensible parts of valuespace may
be an option for writing parameterized files (settings.py) as being
discussed in another thread.

Cheers -Terry

> -matt
> 

-- 
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/d/optout.

Reply via email to