MCPcopy Create free account
hub / github.com/AdrianEddy/telemetry-parser / new

Method new

bin/python-module/python-module.rs:24–35  ·  view source on GitHub ↗
(path: &str)

Source from the content-addressed store, hash-verified

22impl Parser {
23 #[new]
24 fn new(path: &str) -> PyResult<Self> {
25 let mut stream = std::fs::File::open(&path)?;
26 let filesize = stream.metadata()?.len();
27
28 let input = Input::from_stream(&mut stream, filesize, &path, |_|(), Arc::new(AtomicBool::new(false)))?;
29
30 Ok(Self {
31 camera: Some(input.camera_type()),
32 model: input.camera_model().map(String::clone),
33 input: Mutex::new(input),
34 })
35 }
36
37 #[pyo3(signature = (human_readable=None))]
38 fn telemetry<'py>(&self, py: Python<'py>, human_readable: Option<bool>) -> PyResult<Bound<'py, PyAny>> {

Callers

nothing calls this directly

Calls 2

openFunction · 0.85
camera_typeMethod · 0.45

Tested by

no test coverage detected