docs: python example and type hints

This commit is contained in:
əlemi 2024-10-17 00:03:32 +02:00
parent e5ffc7cac2
commit 66938cbaf0
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 4 additions and 4 deletions

View file

@ -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: ...

View file

@ -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