From: Jacob Lifshay Date: Wed, 1 Sep 2021 02:59:41 +0000 (-0700) Subject: add correct __all__ to module X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=241b586b5a4fc1224d055870bd326e25b0a3c028;p=power-instruction-analyzer.git add correct __all__ to module --- diff --git a/src/python.rs b/src/python.rs index b12af3c..452ae0e 100644 --- a/src/python.rs +++ b/src/python.rs @@ -424,5 +424,15 @@ fn power_instruction_analyzer(_py: Python, m: &PyModule) -> PyResult<()> { )?; wrap_all_instr_fns!(m); + + let mut all = Vec::new(); + for (k, _) in m.dict() { + let k = k.extract::()?; + if !k.starts_with('_') { + all.push(k); + } + } + m.setattr("__all__", all)?; + Ok(()) }