diff --git a/src/ffi/python/client.rs b/src/ffi/python/client.rs index 4d12726..7d63406 100644 --- a/src/ffi/python/client.rs +++ b/src/ffi/python/client.rs @@ -1,5 +1,6 @@ use super::a_sync_allow_threads; use super::Client; +use crate::api::User; use crate::workspace::Workspace; use pyo3::prelude::*; @@ -82,14 +83,9 @@ impl Client { self.active_workspaces() } - #[pyo3(name = "user_id")] - fn pyuser_id(&self) -> String { - self.my_user().id.to_string() - } - - #[pyo3(name = "user_name")] - fn pyuser_name(&self) -> String { - self.my_user().name.clone() + #[pyo3(name = "current_user")] + fn pycurrent_user(&self) -> User { + self.current_user().clone() } #[pyo3(name = "refresh")] diff --git a/src/ffi/python/workspace.rs b/src/ffi/python/workspace.rs index a5c1256..ed914f5 100644 --- a/src/ffi/python/workspace.rs +++ b/src/ffi/python/workspace.rs @@ -1,4 +1,5 @@ use crate::api::controller::AsyncReceiver; +use crate::api::User; use crate::buffer::Controller as BufferController; use crate::cursor::Controller as CursorController; use crate::workspace::Workspace; @@ -25,7 +26,7 @@ impl Workspace { #[pyo3(name = "detach_buffer")] fn pydetach_buffer(&self, path: String) -> bool { - self.detach(path.as_str()) + self.detach_buffer(path.as_str()) } #[pyo3(name = "fetch_buffers")] @@ -63,9 +64,9 @@ impl Workspace { self.cursor() } - #[pyo3(name = "buffer_by_name")] - fn pybuffer_by_name(&self, path: String) -> Option { - self.buffer_by_name(path.as_str()) + #[pyo3(name = "get_buffer")] + fn pyget_buffer(&self, path: String) -> Option { + self.get_buffer(path.as_str()) } #[pyo3(name = "active_buffers")]