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)
| 229 | |
| 230 | @classmethod |
| 231 | def find_profile_dir(cls, profile_dir, config=None): |
| 232 | """Find/create a profile dir and return its ProfileDir. |
| 233 | |
| 234 | This will create the profile directory if it doesn't exist. |
| 235 | |
| 236 | Parameters |
| 237 | ---------- |
| 238 | profile_dir : unicode or str |
| 239 | The path of the profile directory. |
| 240 | """ |
| 241 | profile_dir = expand_path(profile_dir) |
| 242 | if not os.path.isdir(profile_dir): |
| 243 | raise ProfileDirError('Profile directory not found: %s' % profile_dir) |
| 244 | return cls(location=profile_dir, config=config) |
no test coverage detected