nyx_space/io/python.rs
1use super::ExportCfg;
2use pyo3::prelude::*;
3
4#[pymethods]
5impl ExportCfg {
6 /// Create a new export configuration.
7 ///
8 /// :type timestamped: bool
9 #[pyo3(signature=(timestamped = false))]
10 #[new]
11 fn py_new(timestamped: bool) -> Self {
12 if timestamped {
13 Self::timestamped()
14 } else {
15 Self::default()
16 }
17 }
18
19 fn __str__(&self) -> String {
20 format!("{self:?}")
21 }
22
23 fn __repr__(&self) -> String {
24 format!("{self:?} @ {self:p}")
25 }
26}