Profile Override¶
Override the IPython IPython.core.profiledir.ProfileDir
.
Initially created to implement a repr for the class, it was expanded in order to also modify the behavior that automatically adds the directories.:
PID
security
log
db
It automatically creates them in the current working directory and this behavior was not designed to be modifiable.
As a result, profiles are frequently created in the wrong dir often enough that it should be configurable behavior.
See Also¶
IPython.core.profileapp
How IPython implements the profile originally.
IPython.core.profiledir
The overridden class.
Profile App API¶
-
class
ReprProfileDir
(**kwargs)[source][source]¶ Bases:
IPython.core.profiledir.ProfileDir
An object to manage the profile directory and its resources.
The profile directory is used by all IPython applications, to manage configuration, logging and security.
This object knows how to find, create and manage these directories. This should be used by any code that wants to handle profiles.
Notes
Implements
__fspath__
to implement the pathlib protocol.
-
class
DirectoryChecker
(*args)[source][source]¶ Bases:
object
Checks for the presence of needed directories and creates them.
-
ensure_dir_exists
(path, mode=493)[source][source]¶ Ensure that a directory exists.
If it doesn’t exist, try to create it and protect against a race condition if another process is doing the same.
The default permissions are
0o755
, which differ fromos.makedirs()
default of0o777
.
-