The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
"Kent Tenney" <kten... @gmail.com>
Date: Mon, 6 Oct 2008 06:50:42 -0500
Local: Mon, Oct 6 2008 7:50 am
Subject: node context
I'm working on some application specific buttons, which would benefit from easy access to some attributes of the current node. looking at dir(p) I don't see a direct way to determine where the node is relative to @path and @<file> declarations.
what would you think of
p.getNodePath()
which would return either None or the @path this node lives in
p.getNodeFileName()
which would return either None or the filename of the @<file> this node lives in.
Thanks, Kent
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Edward K. Ream" <edream... @gmail.com>
Date: Mon, 6 Oct 2008 07:22:25 -0500
Local: Mon, Oct 6 2008 8:22 am
Subject: Re: node context
On Mon, Oct 6, 2008 at 6:50 AM, Kent Tenney <kten
... @gmail.com> wrote:
> I'm working on some application specific buttons, which would > benefit from easy access to some attributes of the current node.
> looking at dir(p) I don't see a direct way to determine where the > node is relative to @path and @<file> declarations.
> what would you think of
> p.getNodePath()
> which would return either None or the @path this node lives in
> p.getNodeFileName()
> which would return either None or the filename of the @<file> this > node lives in.
The following probably does what you want for getNodePath: aList = g.get_directives_dict_list(p) path = c.scanAtPathDirectives(aList)
And this for getNodeFileName:
aList = g.get_directives_dict_list(p) path = c.scanAtPathDirectives(aList) filename = p.isAnyAtFileNode() return filename and g.os_path_finalize_join(path,filename)
These use the load directory if there is no @path. These convenience methods would have to be methods of the commands class:
path = c.getNodePath(p) path = c.getNodeFileName(p)
I'll add these convenience methods if they do, in fact, do what you want.
BTW, there appears to be a bug with @path: the path is created when any child is created, even if the child is no kind of @file node.
Edward
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Kent Tenney" <kten... @gmail.com>
Date: Mon, 6 Oct 2008 09:25:49 -0500
Local: Mon, Oct 6 2008 10:25 am
Subject: Re: node context
On Mon, Oct 6, 2008 at 7:22 AM, Edward K. Ream <edream... @gmail.com> wrote:
> On Mon, Oct 6, 2008 at 6:50 AM, Kent Tenney <kten... @gmail.com> wrote:
>> I'm working on some application specific buttons, which would >> benefit from easy access to some attributes of the current node.
>> looking at dir(p) I don't see a direct way to determine where the >> node is relative to @path and @<file> declarations.
>> what would you think of
>> p.getNodePath()
>> which would return either None or the @path this node lives in
>> p.getNodeFileName()
>> which would return either None or the filename of the @<file> this >> node lives in.
> The following probably does what you want for getNodePath:
> aList = g.get_directives_dict_list(p) > path = c.scanAtPathDirectives(aList)
works for me.
> And this for getNodeFileName:
> aList = g.get_directives_dict_list(p) > path = c.scanAtPathDirectives(aList) > filename = p.isAnyAtFileNode() > return filename and g.os_path_finalize_join(path,filename)
again, works for me.
> These use the load directory if there is no @path. These convenience > methods would have to be methods of the commands class:
> path = c.getNodePath(p) > path = c.getNodeFileName(p)
> I'll add these convenience methods if they do, in fact, do what you want.
> BTW, there appears to be a bug with @path: the path is created when > any child is created, even if the child is no kind of @file node.
This is NOT a bug, but a really nice feature! @path is not just for @files anymore
There's much sweetness in context aware @buttons;
@button do it here ... node_path = c.getNodePath(p) Popen(cmd, cwd=node_path)
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Edward K. Ream" <edream... @gmail.com>
Date: Mon, 6 Oct 2008 09:28:03 -0500
Local: Mon, Oct 6 2008 10:28 am
Subject: Re: node context
On Mon, Oct 6, 2008 at 9:25 AM, Kent Tenney <kten
... @gmail.com> wrote:
> again, works for me.
Ok. I'll add these soon.
>> BTW, there appears to be a bug with @path: the path is created when
>> any child is created, even if the child is no kind of @file node.
> This is NOT a bug, but a really nice feature!
I'm not sure everyone will agree, but in the interest of laziness I'll leave things alone until somebody complains :-) Edward
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Edward K. Ream" <edream... @gmail.com>
Date: Mon, 6 Oct 2008 08:21:20 -0700 (PDT)
Local: Mon, Oct 6 2008 11:21 am
Subject: Re: node context
On Oct 6, 9:28 am, "Edward K. Ream" <edream... @gmail.com> wrote:
> On Mon, Oct 6, 2008 at 9:25 AM, Kent Tenney <kten
... @gmail.com> wrote:
> > again, works for me.
> Ok. I'll add these soon.
Done on the trunk at rev 1220.
Edward
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Kent Tenney" <kten... @gmail.com>
Date: Mon, 6 Oct 2008 11:10:02 -0500
Local: Mon, Oct 6 2008 12:10 pm
Subject: Re: node context
On Mon, Oct 6, 2008 at 10:21 AM, Edward K. Ream <edream... @gmail.com> wrote:
> On Oct 6, 9:28 am, "Edward K. Ream" <edream... @gmail.com> wrote: >> On Mon, Oct 6, 2008 at 9:25 AM, Kent Tenney <kten... @gmail.com> wrote: >> > again, works for me.
>> Ok. I'll add these soon.
> Done on the trunk at rev 1220.
Thanks!
You must
Sign in before you can post messages.
You do not have the permission required to post.