(content)
| 7296 | return |
| 7297 | if route == '/api/fs/read': |
| 7298 | path = safe_realpath(payload.get('path'), must_exist=True) |
| 7299 | if os.path.isdir(path): |
| 7300 | raise IsADirectoryError('Cannot read a directory.') |
| 7301 | if not is_text_file(path): |
| 7302 | raise ValueError('Only text files can be opened in the editor.') |
| 7303 | send_json(self, 200, {'ok': True, 'path': path, 'content': read_text_file(path)}) |
| 7304 | return |
| 7305 | if route == '/api/fs/write': |
| 7306 | path = safe_realpath(payload.get('path'), must_exist=True) |
no outgoing calls
no test coverage detected