Re: dogtail Question about labellers/labellees

On Wed, 2005-10-19 at 18:07 -0700, David Hoover wrote:
> First, the obligatory thanks for dogtail so far: it seems pretty damned
> slick, and I'm actually working on building some helper classes at work
> for our own software so that people can use it to do gui scripting;
> people need to do iterations over lots of things, and it looks like
> running MovieOS and having python scripts that literally just drive our
> GUI is going to be a perfect solution (and great for demos)

Hi David!

Glad you like it, and hope it's useful to you.

> I'm not sure if I'm misunderstanding things, or if things aren't working
> quite the way they should:
> In glade, I can tell a field that it labels another, or I can tell a
> field that it is labeled by another. I would think that those two sets
> of relationships should be merged automatically into some
> uber-relationship, but that doesn't seem to be the case.

My belief (but I haven't checked this) is that the relations are not
reflexive by default, i.e.

"A -> B" does not imply "B <- A" by default

I believe you have to set up both of them.

> In there, I have a glade file that defines two gtklabels and two
> gtkentries
> I tell it:
>    labelA labels entryA
>    entryB is labeled by labelB
> I would then assume that it should be true that:
>    entryA is labeled by labelA
>    labelB labels entryB
> This does not seem to be the case. In, I iterate
> over both entries and print entry.labeller, then I iterate over both
> labels and print label.labellee, and get:
> Entry (B):
> Node roleName='label' name='B' description='' text='B'
> Entry (A):
> None
> Label (A):
> Node roleName='text' name='' description='' text='A'
> Label (B):
> None

I got thoroughly confused at this point by the fact that there are nodes
that are of roleName "label" and nodes that have label-for and label-by

It may be easier to debug if you also print out the relationSet of the
nodes, which is what is ultimately used.  Have a look at the innards of
the Node.__getattr__ method...

> Can anyone tell me if I'm misunderstanding things, or if this is a bug?
> If it's the latter, is anyone currently working on it or should I look
> into writing the patch myself? (it's standing in the way of work-work so
> I can see about fixing it on company time :) )

I recommend digging into the code and "getting your hands dirty"...
patches welcome!

> Also, on a bit of a tangent, is "labelled" a britishism? It looks weird
> to my yankee eyes, and evolution keeps putting red squigglies under it.
> says that both "labeled" and "labelled" are correct, but
> I'd never seen the latter before, and am curious why.

Probably a britishism... I wrote that stuff, and I'm still split between
en_US and en_GB, 18 months after moving from the UK to the US.

I'm happy for the spelling to be standardised to US English spelling,
whatever that is. [1] 

Dave Malcolm

[1] /me mutters something incoherent about colourisation vs colorization

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]