Find the path to the folder associated with a given profile. I.e. find $IPYTHONDIR/profile_whatever.
(profile='default')
| 109 | |
| 110 | |
| 111 | def locate_profile(profile='default'): |
| 112 | """Find the path to the folder associated with a given profile. |
| 113 | |
| 114 | I.e. find $IPYTHONDIR/profile_whatever. |
| 115 | """ |
| 116 | from IPython.core.profiledir import ProfileDir, ProfileDirError |
| 117 | try: |
| 118 | pd = ProfileDir.find_profile_dir_by_name(get_ipython_dir(), profile) |
| 119 | except ProfileDirError as e: |
| 120 | # IOError makes more sense when people are expecting a path |
| 121 | raise IOError("Couldn't find profile %r" % profile) from e |
| 122 | return pd.location |
no test coverage detected
searching dependent graphs…