487 dirs.append(py, path.into_object()) |
487 dirs.append(py, path.into_object()) |
488 } |
488 } |
489 Ok(dirs) |
489 Ok(dirs) |
490 } |
490 } |
491 |
491 |
|
492 def setparents_fixup(&self) -> PyResult<PyDict> { |
|
493 let dict = PyDict::new(py); |
|
494 let copies = self.inner(py).borrow_mut().setparents_fixup(); |
|
495 for (key, value) in copies.map_err(|e| v2_error(py, e))? { |
|
496 dict.set_item( |
|
497 py, |
|
498 PyBytes::new(py, key.as_bytes()), |
|
499 PyBytes::new(py, value.as_bytes()), |
|
500 )?; |
|
501 } |
|
502 Ok(dict) |
|
503 } |
|
504 |
492 def debug_iter(&self, all: bool) -> PyResult<PyList> { |
505 def debug_iter(&self, all: bool) -> PyResult<PyList> { |
493 let dirs = PyList::new(py, &[]); |
506 let dirs = PyList::new(py, &[]); |
494 for item in self.inner(py).borrow().debug_iter(all) { |
507 for item in self.inner(py).borrow().debug_iter(all) { |
495 let (path, (state, mode, size, mtime)) = |
508 let (path, (state, mode, size, mtime)) = |
496 item.map_err(|e| v2_error(py, e))?; |
509 item.map_err(|e| v2_error(py, e))?; |