(self, directory)
| 786 | self.logger.error(f"Error saving configuration: {e}") |
| 787 | |
| 788 | def list_files(self, directory): |
| 789 | files = [] |
| 790 | for entry in os.scandir(directory): |
| 791 | if entry.is_dir(): |
| 792 | files.append({ |
| 793 | "name": entry.name, |
| 794 | "is_directory": True, |
| 795 | "children": self.list_files(entry.path) |
| 796 | }) |
| 797 | else: |
| 798 | files.append({ |
| 799 | "name": entry.name, |
| 800 | "is_directory": False, |
| 801 | "path": entry.path |
| 802 | }) |
| 803 | return files |
| 804 | |
| 805 | def list_files_endpoint(self, handler): |
| 806 | try: |
no test coverage detected