MCPcopy Create free account
hub / github.com/archlinux/alpm / source_info_from_file

Function source_info_from_file

python-alpm/src/srcinfo/source_info/mod.rs:34–41  ·  view source on GitHub ↗
(
    path: std::path::PathBuf,
    schema: Option<SourceInfoSchema>,
)

Source from the content-addressed store, hash-verified

32#[pyfunction]
33#[pyo3(signature = (path, schema = None))]
34pub fn source_info_from_file(
35 path: std::path::PathBuf,
36 schema: Option<SourceInfoSchema>,
37) -> Result<SourceInfo, crate::srcinfo::error::Error> {
38 let schema: Option<alpm_srcinfo::SourceInfoSchema> = schema.map(From::from);
39 let inner = alpm_srcinfo::SourceInfo::from_file_with_schema(&path, schema)?;
40 Ok(inner.into())
41}
42
43#[pymodule(gil_used = false, name = "source_info", submodule)]
44pub mod py_source_info {

Callers 4

test_from_file_validFunction · 0.85
test_from_file_invalidFunction · 0.85

Calls

no outgoing calls

Tested by 4

test_from_file_validFunction · 0.68
test_from_file_invalidFunction · 0.68