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