(self, change)
| 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 |
nothing calls this directly
no test coverage detected