diff options
| author | Nikita Slyusarev <[email protected]> | 2022-02-10 16:46:53 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:46:53 +0300 |
| commit | 469afdc4e2587bf62ecdd096b75a0baa444c4012 (patch) | |
| tree | 49e222ea1c5804306084bb3ae065bb702625360f /contrib/python/ipython/py2/IPython/core/profiledir.py | |
| parent | cd77cecfc03a3eaf87816af28a33067c4f0cdb59 (diff) | |
Restoring authorship annotation for Nikita Slyusarev <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/ipython/py2/IPython/core/profiledir.py')
| -rw-r--r-- | contrib/python/ipython/py2/IPython/core/profiledir.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/contrib/python/ipython/py2/IPython/core/profiledir.py b/contrib/python/ipython/py2/IPython/core/profiledir.py index e0e754a78fe..b777f13da0d 100644 --- a/contrib/python/ipython/py2/IPython/core/profiledir.py +++ b/contrib/python/ipython/py2/IPython/core/profiledir.py @@ -12,7 +12,7 @@ from traitlets.config.configurable import LoggingConfigurable from IPython.paths import get_ipython_package_dir from IPython.utils.path import expand_path, ensure_dir_exists from IPython.utils import py3compat -from traitlets import Unicode, Bool, observe +from traitlets import Unicode, Bool, observe #----------------------------------------------------------------------------- # Module errors @@ -47,18 +47,18 @@ class ProfileDir(LoggingConfigurable): pid_dir = Unicode(u'') static_dir = Unicode(u'') - location = Unicode(u'', + location = Unicode(u'', help="""Set the profile location directly. This overrides the logic used by the `profile` option.""", - ).tag(config=True) + ).tag(config=True) _location_isset = Bool(False) # flag for detecting multiply set location - @observe('location') - def _location_changed(self, change): + @observe('location') + def _location_changed(self, change): if self._location_isset: raise RuntimeError("Cannot set profile location more than once.") self._location_isset = True - new = change['new'] + new = change['new'] ensure_dir_exists(new) # ensure config files exist: @@ -68,7 +68,7 @@ class ProfileDir(LoggingConfigurable): self.pid_dir = os.path.join(new, self.pid_dir_name) self.static_dir = os.path.join(new, self.static_dir_name) self.check_dirs() - + def _mkdir(self, path, mode=None): """ensure a directory exists at a given path @@ -102,13 +102,13 @@ class ProfileDir(LoggingConfigurable): raise return True - - @observe('log_dir') - def check_log_dir(self, change=None): + + @observe('log_dir') + def check_log_dir(self, change=None): self._mkdir(self.log_dir) - - @observe('startup_dir') - def check_startup_dir(self, change=None): + + @observe('startup_dir') + def check_startup_dir(self, change=None): self._mkdir(self.startup_dir) readme = os.path.join(self.startup_dir, 'README') @@ -118,12 +118,12 @@ class ProfileDir(LoggingConfigurable): with open(readme, 'wb') as f: f.write(pkgutil.get_data(__name__, 'profile/README_STARTUP')) - @observe('security_dir') - def check_security_dir(self, change=None): + @observe('security_dir') + def check_security_dir(self, change=None): self._mkdir(self.security_dir, 0o40700) - @observe('pid_dir') - def check_pid_dir(self, change=None): + @observe('pid_dir') + def check_pid_dir(self, change=None): self._mkdir(self.pid_dir, 0o40700) def check_dirs(self): |
