From 66938cbaf00b76e66a4737bf6186624c61204ce6 Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 17 Oct 2024 00:03:32 +0200 Subject: [PATCH] docs: python example and type hints --- dist/py/src/codemp/codemp.pyi | 2 +- src/ffi/mod.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/py/src/codemp/codemp.pyi b/dist/py/src/codemp/codemp.pyi index 5b09cb5..73bfa0b 100644 --- a/dist/py/src/codemp/codemp.pyi +++ b/dist/py/src/codemp/codemp.pyi @@ -24,7 +24,7 @@ class Config: port: Optional[int] tls: Optional[bool] - def __new__(cls, username: str, password: str, **kwargs) -> Config: ... + def __new__(cls, *, username: str, password: str, **kwargs) -> Config: ... def init() -> Driver: ... def set_logger(logger_cb: Callable[[str], None], debug: bool) -> bool: ... diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs index b7040d1..ce2f0f3 100644 --- a/src/ffi/mod.rs +++ b/src/ffi/mod.rs @@ -83,8 +83,8 @@ //! //! # connect first, api.code.mp is managed by hexed.technology //! client = codemp.connect(codemp.Config( -//! username='mail@example.net', -//! password='dont-use-this-password' +//! username = "mail@example.net", +//! password = "dont-use-this-password" //! )).wait() //! //! # create and join a workspace @@ -92,7 +92,7 @@ //! workspace = client.attach_workspace("some-workspace").wait() //! //! # create a new buffer in this workspace and attach to it -//! workspace.create("/my/file.txt").wait() +//! workspace.create_buffer("/my/file.txt").wait() //! buffer = workspace.attach_buffer("/my/file.txt").wait() //! //! # write `hello!` at the beginning of this buffer