MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / check_python

Method check_python

flow-rs/src/loader/mod.rs:87–105  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

85 }
86
87 fn check_python(path: &Path) -> Option<PathBuf> {
88 if path.is_file() {
89 if let Some(ext) = path.extension() {
90 if ext == "py" {
91 return Some(path.to_path_buf());
92 }
93 }
94 None
95 } else {
96 let mut buf = path.to_path_buf();
97 buf.push("__init__.py");
98 if buf.exists() {
99 buf.pop();
100 Some(buf)
101 } else {
102 None
103 }
104 }
105 }
106}

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
popMethod · 0.80

Tested by

no test coverage detected