-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Comment hook function while running the rules packages
TODO: builtin hook function in every rules packages.
- Loading branch information
1 parent
0f39a9d
commit 14368e5
Showing
3 changed files
with
42 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
use clap::builder::FalseyValueParser; | ||
use pyo3::exceptions; | ||
use pyo3::prelude::*; | ||
use pyo3::wrap_pyfunction; | ||
|
||
#[pyfunction] | ||
fn process_rule_pack(rule_pack: &str) -> PyResult<String> { | ||
// 处理规则包的逻辑 | ||
Ok(format!("Processed rule pack: {}", rule_pack)) | ||
} | ||
|
||
#[pymodule] | ||
#[pyo3(name = "LibCore")] | ||
fn libcore(_py: Python, m: &PyModule) -> PyResult<()> { | ||
let py_log = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/hrc/log.py")); | ||
let py_event = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/hrc/event.py")); | ||
let py_core = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/hrc/core.py")); | ||
let py_const = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/hrc/const.py")); | ||
|
||
m.add_function(wrap_pyfunction!(process_rule_pack, m)?)?; | ||
Ok(()) | ||
} |