Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add locate entry points #1762

Merged
merged 3 commits into from Jun 10, 2012
Merged

add locate entry points #1762

merged 3 commits into from Jun 10, 2012

Conversation

minrk
Copy link
Member

@minrk minrk commented May 24, 2012

These would be useful for quickly locating IPython directories and profiles from other (non-Python) applications.

Examples:

$> ipython locate
/Users/me/.ipython

$> ipython locate profile foo
/Users/me/.ipython/profile_foo

$> ipython locate profile 
/Users/me/.ipython/profile_default

$> ipython locate profile dne
[ProfileLocate] Profile u'dne' not found.

locate profile is also available as profile locate, since that subcommand tree already exists.

@takluyver
Copy link
Member

Do we also have documentation on how to find them from Python code, i.e. starting from IPython.config import ...?

@minrk
Copy link
Member Author

minrk commented May 24, 2012

For ipython_dir, absolutely, but I don't think there is a prominent mention for utils.path.locate_profile(name).

@minrk
Copy link
Member Author

minrk commented May 31, 2012

I added a simple doc section describing these entry points, and the corresponding utility functions.

@@ -85,6 +85,8 @@
_main_examples = """
ipython profile create -h # show the help string for the create subcommand
ipython profile list -h # show the help string for the list subcommand

ipython profile locate foo # print the path to the directory for profile 'foo'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it deliberate to allow both ipython profile locate foo and ipython locate profile foo? It seems kind of unpythonic to offer two similar commands for the same thing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in both because I didn't know which one to choose. If there were no other commands, locate profile foo makes more sense because it's an actual sentence. But we already have an ipython profile subtree of commands, so it seemed weird for it to not be there. I will add ipython locate profile foo to the ipython profile help, if you think that's best, and remove the ipython profile locate entry point.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - I'm fairly neutral on which is better, but I think I marginally prefer having the locate commands together, so I'd remove ipython profile locate. Adding a note in the help makes sense too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ipython profile locate removed

@takluyver
Copy link
Member

Thanks, I think the doc section looks good.

@fperez
Copy link
Member

fperez commented Jun 10, 2012

This looks very useful, and after the review and fixes I see no reason to delay it further. Thanks guys! Going in...

fperez added a commit that referenced this pull request Jun 10, 2012
Add `locate` entry points; these would be useful for quickly locating IPython directories and profiles from other (non-Python) applications.

Examples:

    $> ipython locate
    /Users/me/.ipython
    
    $> ipython locate profile foo
    /Users/me/.ipython/profile_foo
    
    $> ipython locate profile 
    /Users/me/.ipython/profile_default
    
    $> ipython locate profile dne
    [ProfileLocate] Profile u'dne' not found.
@fperez fperez merged commit 0d0d208 into ipython:master Jun 10, 2012
@minrk minrk deleted the locate branch March 31, 2014 23:36
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Add `locate` entry points; these would be useful for quickly locating IPython directories and profiles from other (non-Python) applications.

Examples:

    $> ipython locate
    /Users/me/.ipython
    
    $> ipython locate profile foo
    /Users/me/.ipython/profile_foo
    
    $> ipython locate profile 
    /Users/me/.ipython/profile_default
    
    $> ipython locate profile dne
    [ProfileLocate] Profile u'dne' not found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants