Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
node context
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
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:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kent Tenney  
View profile  
(1 user)  More options Oct 6 2008, 7:50 am
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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Edward K. Ream  
View profile  
 More options Oct 6 2008, 8:22 am
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

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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent Tenney  
View profile  
 More options Oct 6 2008, 10:25 am
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:

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)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Edward K. Ream  
View profile  
 More options Oct 6 2008, 10:28 am
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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Edward K. Ream  
View profile  
 More options Oct 6 2008, 11:21 am
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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent Tenney  
View profile  
 More options Oct 6 2008, 12:10 pm
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!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google