MCPcopy Index your code
hub / github.com/ipython/ipython / _location_changed

Method _location_changed

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

Source from the content-addressed store, hash-verified

57 _location_isset = Bool(False) # flag for detecting multiply set location
58 @observe('location')
59 def _location_changed(self, change):
60 if self._location_isset:
61 raise RuntimeError("Cannot set profile location more than once.")
62 self._location_isset = True
63 new = change['new']
64 ensure_dir_exists(new)
65
66 # ensure config files exist:
67 self.security_dir = os.path.join(new, self.security_dir_name)
68 self.log_dir = os.path.join(new, self.log_dir_name)
69 self.startup_dir = os.path.join(new, self.startup_dir_name)
70 self.pid_dir = os.path.join(new, self.pid_dir_name)
71 self.static_dir = os.path.join(new, self.static_dir_name)
72 self.check_dirs()
73
74 def _mkdir(self, path: str, mode: Optional[int] = None) -> bool:
75 """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