Re: Code Academy: find by predicate or attribute

2016-02-26 Thread Richard Andersen
I had a minor cut/paste syntax error... hasOpenTask(p) ... instead of ... isOpenTask(p) ... but resolved it, and it is working now.It creates the list. In my case, I put tasks under a parent node, which is usually either myself or another person.Showing the parents, but only the

Re: Code Academy: find by predicate or attribute

2016-02-26 Thread Edward K. Ream
On Fri, Feb 26, 2016 at 9:49 AM, Richard Andersen wrote: > Thank you very much, Edward. > > I have the code working now.It is finding all my nodes, so I'll see if > I can figure out what further changes will limit the result set to just > those with open and todo tags. >

Re: Code Academy: find by predicate or attribute

2016-02-26 Thread Edward K. Ream
On Fri, Feb 26, 2016 at 9:23 AM, 'Terry Brown' via leo-editor < leo-editor@googlegroups.com> wrote: Sorry to bring up the "inadmissible" ;-) solutions again, but todo.py > includes icons, of course, and a "go to next todo node" which seems to > cover similar ground to the finding nodes which have

Re: Code Academy: find by predicate or attribute

2016-02-26 Thread Richard Andersen
Thank you very much, Edward. I have the code working now.It is finding all my nodes, so I'll see if I can figure out what further changes will limit the result set to just those with open and todo tags. -Richard On Friday, February 26, 2016 at 6:47:29 AM UTC-8, Edward K. Ream wrote: > >

Re: Code Academy: find by predicate or attribute

2016-02-26 Thread 'Terry Brown' via leo-editor
> > From: Edward K. Ream <edream...@gmail.com> >To: leo-editor <leo-editor@googlegroups.com> >Sent: Friday, February 26, 2016 8:47 AM >Subject: Re: Code Academy: find by predicate or attribute > >On Friday, February 26, 2016 at

Re: Code Academy: find by predicate or attribute

2016-02-26 Thread Edward K. Ream
On Friday, February 26, 2016 at 6:42:34 AM UTC-6, Edward K. Ream wrote: > On Thu, Feb 25, 2016 at 6:42 PM, Richard Andersen wrote: >> ​I'd like...to use the Clone Find All Flattened command to find all my Nodes which are "open tasks"...Ideally, these would be shown in

Re: Code Academy: find by predicate or attribute

2016-02-26 Thread Edward K. Ream
On Fri, Feb 26, 2016 at 6:42 AM, Edward K. Ream wrote: ​Oops. hasOpenTask misuses the else clause after a for loop. There is no break statement, so it should be this: def hasOpenTask(p): > '''Return True if p is a top-level node containing any open task.''' > if

Re: Code Academy: find by predicate or attribute

2016-02-26 Thread Edward K. Ream
On Thu, Feb 25, 2016 at 6:42 PM, Richard Andersen wrote: ​> ​ What I'd like to do next is to use the Clone Find All Flattened command to find all my Nodes which are "open tasks" ​... ​Use c.cloneFindByPredicate. Like this (tested code): tc = c.theTagController def

Re: Code Academy: find by predicate or attribute

2016-02-26 Thread Edward K. Ream
On Thu, Feb 25, 2016 at 6:12 AM, Edward K. Ream wrote: > Writing the cffm and cfam commands was snap using c.cloneFindByPredicate, > a powerful new addition to Leo. > ​Recent revs add the following new position methods: - p.is_at_all(): True if p is an @ node containing

Re: Code Academy: find by predicate or attribute

2016-02-26 Thread Edward K. Ream
On Thu, Feb 25, 2016 at 6:12 AM, Edward K. Ream wrote: > Writing the cffm and cfam commands was snap using c.cloneFindByPredicate, > a powerful new addition to Leo. > ​c.cloneFindByPredicate now supports an optional failMsg keyword arg. This is the warning given if no nodes

Re: Code Academy: find by predicate or attribute

2016-02-25 Thread Richard Andersen
Edward -- these are really useful improvements! I have the latest build and am testing out the new commands. Clone Find All Flattened is really useful.I am using a combination of Tags and Icons to track open and closed tasks. Here's an example of one script to mark a node as an

Code Academy: find by predicate or attribute

2016-02-25 Thread Edward K. Ream
Writing the cffm and cfam commands was snap using c.cloneFindByPredicate, a powerful new addition to Leo. Here is the entire code for the new commands: @cmd('clone-find-all-marked') @cmd('cfam') def cloneFindAllMarked(self, event=None): '''The clone-find-all-marked