MCPcopy Create free account
hub / github.com/ipython/ipython / _location_changed

Method _location_changed

IPython/core/profiledir.py:56–69  ·  view source on GitHub ↗
(self, change)

Source from the content-addressed store, hash-verified

54 _location_isset = Bool(False) # flag for detecting multiply set location
55 @observe('location')
56 def _location_changed(self, change):
57 if self._location_isset:
58 raise RuntimeError("Cannot set profile location more than once.")
59 self._location_isset = True
60 new = change['new']
61 ensure_dir_exists(new)
62
63 # ensure config files exist:
64 self.security_dir = os.path.join(new, self.security_dir_name)
65 self.log_dir = os.path.join(new, self.log_dir_name)
66 self.startup_dir = os.path.join(new, self.startup_dir_name)
67 self.pid_dir = os.path.join(new, self.pid_dir_name)
68 self.static_dir = os.path.join(new, self.static_dir_name)
69 self.check_dirs()
70
71 def _mkdir(self, path, mode=None):
72 """ensure a directory exists at a given path

Callers

nothing calls this directly

Calls 2

check_dirsMethod · 0.95
ensure_dir_existsFunction · 0.85

Tested by

no test coverage detected