continue-custom/server/src/lib.rs
2023-12-02 12:41:48 -08:00

25 lines
580 B
Rust

use pyo3::{exceptions, prelude::*};
use std::path::Path;
mod gitignore;
mod sync;
mod utils;
#[pyfunction]
fn sync_results(
dir: String,
branch: String,
) -> PyResult<(
Vec<(String, String)>,
Vec<(String, String)>,
Vec<(String, String)>,
Vec<(String, String)>,
)> {
return sync::sync(Path::new(&dir), Some(&branch))
.map_err(|err| PyErr::new::<exceptions::PyException, _>(format!("{}", err)));
}
#[pymodule]
fn continuedev(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
m.add_function(wrap_pyfunction!(sync_results, m)?)?;
Ok(())
}