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