On Thu, Jun 5, 2008 at 2:31 PM, Terry Brown <[EMAIL PROTECTED]> wrote:
>
> > I think the complexity is, in fact, part of the problem domain. You
> > simply must be aware of whether positions are valid or not.
>
> Agreed given the way positions work. Seems this sort of thing is
> easier in some o
On Thu, 5 Jun 2008 13:45:30 -0500
"Edward K. Ream" <[EMAIL PROTECTED]> wrote:
> > Is that the best way to address these things? It seems to add
> > complexity beyond the problem domain.
>
> I think the complexity is, in fact, part of the problem domain. You
> simply must be aware of whether
On Thu, 5 Jun 2008 13:42:04 -0500
"Edward K. Ream" <[EMAIL PROTECTED]> wrote:
> uses this fact. It creates a target node, whose position (the root)
> does not change, then traverses the tree moving nodes under the
> target. You could do the same thing: create a target node as the
> root, traver
On Thu, Jun 5, 2008 at 1:34 PM, Terry Brown <[EMAIL PROTECTED]> wrote:
>
> but only because it's careful to only use positions that occur before
> (in document order) points where changes have been made.
> ...
> Is that the best way to address these things? It seems to add
> complexity beyond the
On Thu, Jun 5, 2008 at 1:27 PM, Terry Brown <[EMAIL PROTECTED]>
wrote:
>
>
> > This is wrong: positions become invalid after changing the outline.
>
> Sort of what I thought, but how do you get around that?
Not all positions become invalid. A position remains valid if the stack of
its parents re
On Thu, 5 Jun 2008 13:27:28 -0500
Terry Brown <[EMAIL PROTECTED]> wrote:
> I'll try re-arranging the algorithm so things are changed from the end
> of lists first, but that's a bit arcane.
ok, this version works:
bn = p.headString().strip('/')
n = p.insertAfter()
c.setHeadString(n, bn)
c.setBod
On Thu, 5 Jun 2008 13:21:06 -0500
"Edward K. Ream" <[EMAIL PROTECTED]> wrote:
> others = [i.copy() for i in p.siblings_iter()
> > if i.headString().startswith(bn+'.')]
>
>
> This is wrong: positions become invalid after changing the outline.
Sort of what I thought, but how do you get around
On Thu, Jun 5, 2008 at 11:52 AM, Terry Brown <[EMAIL PROTECTED]>
wrote:
>
> I run this script from a button:
> ...
others = [i.copy() for i in p.siblings_iter()
> if i.headString().startswith(bn+'.')]
This is wrong: positions become invalid after changing the outline.
Edward
--~--~
I have
Dog
Horse
/Cat/
Mouse
Cat.aux
Cat.rrd
Mite
I want to select "/Cat/", run a button script, and get this
Dog
Horse
Cat
/Cat/
Cat.aux
Cat.rrd
Mouse
Mite
I run this script from a button:
bn = p.headString().strip('/')
others = [i.copy() for i in p.siblings_iter()
if i.headStri