( self, dest_path: Path, password: str | None = None, )
| 426 | target.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP) |
| 427 | |
| 428 | def save_user_creds( |
| 429 | self, |
| 430 | dest_path: Path, |
| 431 | password: str | None = None, |
| 432 | ) -> None: |
| 433 | if not is_valid_path(dest_path): |
| 434 | error(f'Invalid path {dest_path}. User credentials could not be saved.') |
| 435 | return |
| 436 | |
| 437 | data = self.user_credentials_to_json() |
| 438 | |
| 439 | if password: |
| 440 | data = encrypt(password, data) |
| 441 | |
| 442 | target = dest_path / USER_CREDS_FILE |
| 443 | target.write_text(data) |
| 444 | target.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP) |
| 445 | |
| 446 | def as_summary(self) -> str: |
| 447 | """ |
no test coverage detected