From a22d8ff6e100bae17a6cbe51a4eda21a0e711f45 Mon Sep 17 00:00:00 2001 From: Camillo Schenone Date: Fri, 24 Nov 2023 11:31:00 +0100 Subject: [PATCH] version bump to 0.3.0, supporting codemp 0.5, fixed content function, new bindings Former-commit-id: 14b565f48f493c4c731a00e9511ef5af65332264 --- Cargo.toml | 4 ++-- bindings/codemp_client.cpython-38-darwin.so.REMOVED.git-id | 2 +- src/lib.rs | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 381a926..7f14dd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "CodempClient-Sublime" -version = "0.2.0" +version = "0.3.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -9,7 +9,7 @@ name = "codemp_client" crate-type = ["cdylib"] [dependencies] -codemp = { git = "ssh://git@github.com/codewithotherpeopleandchangenamelater/codemp.git", branch = "woot"} +codemp = { git = "ssh://git@github.com/codewithotherpeopleandchangenamelater/codemp.git", tag="v0.5.0"} pyo3 = { version = "0.20", features = ["extension-module"] } pyo3-asyncio = { version = "0.20", features = ["tokio-runtime"] } tokio = "1.29.1" diff --git a/bindings/codemp_client.cpython-38-darwin.so.REMOVED.git-id b/bindings/codemp_client.cpython-38-darwin.so.REMOVED.git-id index e589d5b..5d349f5 100644 --- a/bindings/codemp_client.cpython-38-darwin.so.REMOVED.git-id +++ b/bindings/codemp_client.cpython-38-darwin.so.REMOVED.git-id @@ -1 +1 @@ -b7e89a844729eeabc833622b3e3f12bc3fd53273 \ No newline at end of file +c89068ebc710e18686da3486ffb87421db21e058 \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 457ccf7..8bf7e05 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,8 @@ use codemp::errors::Error as CodempError; use pyo3::{ prelude::*, - exceptions::{PyConnectionError, PyRuntimeError, PyBaseException} + exceptions::{PyConnectionError, PyRuntimeError, PyBaseException}, + types::PyString, }; struct PyCodempError(CodempError); @@ -243,8 +244,8 @@ impl From::> for PyBufferController { #[pymethods] impl PyBufferController { - fn content(&self) -> PyString { - self.0.content() + fn content<'a>(&self, py: Python<'a>) -> &'a PyString { + PyString::new(py, self.0.content().as_str()) } fn send(&self, start: usize, end: usize, txt: String) -> PyResult<()>{