Find/create a profile dir and return its ProfileDir. This will create the profile directory if it doesn't exist. Parameters ---------- profile_dir : unicode or str The path of the profile directory.
(cls, profile_dir, config=None)
| 208 | |
| 209 | @classmethod |
| 210 | def find_profile_dir(cls, profile_dir, config=None): |
| 211 | """Find/create a profile dir and return its ProfileDir. |
| 212 | |
| 213 | This will create the profile directory if it doesn't exist. |
| 214 | |
| 215 | Parameters |
| 216 | ---------- |
| 217 | profile_dir : unicode or str |
| 218 | The path of the profile directory. |
| 219 | """ |
| 220 | profile_dir = expand_path(profile_dir) |
| 221 | if not os.path.isdir(profile_dir): |
| 222 | raise ProfileDirError('Profile directory not found: %s' % profile_dir) |
| 223 | return cls(location=profile_dir, config=config) |
no test coverage detected