add python glue

This commit is contained in:
cschen 2024-09-22 17:04:08 +02:00 committed by alemi.dev
parent 37347311fb
commit 0ffcef360b

View file

@ -132,6 +132,11 @@ impl Driver {
} }
} }
#[pyfunction]
fn version() -> String {
crate::version()
}
#[pyfunction] #[pyfunction]
fn init() -> PyResult<Driver> { fn init() -> PyResult<Driver> {
let (rt_stop_tx, mut rt_stop_rx) = oneshot::channel::<()>(); let (rt_stop_tx, mut rt_stop_rx) = oneshot::channel::<()>();
@ -257,6 +262,7 @@ impl IntoPy<PyObject> for crate::api::User {
#[pymodule] #[pymodule]
fn codemp(m: &Bound<'_, PyModule>) -> PyResult<()> { fn codemp(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(version, m)?)?;
m.add_function(wrap_pyfunction!(init, m)?)?; m.add_function(wrap_pyfunction!(init, m)?)?;
m.add_function(wrap_pyfunction!(get_default_config, m)?)?; m.add_function(wrap_pyfunction!(get_default_config, m)?)?;
m.add_function(wrap_pyfunction!(connect, m)?)?; m.add_function(wrap_pyfunction!(connect, m)?)?;