diff options
| author | 2024-06-17 00:22:18 +0800 | |
|---|---|---|
| committer | 2024-06-17 00:22:18 +0800 | |
| commit | ea840bbc63843bd605a00da31f80241a4f2a9746 (patch) | |
| tree | 4fe1ecc8b1361b6bd23808c2d62d51c5024dffb4 | |
| parent | 09413f06949b421a1c5b0cc05d70d84b184d3397 (diff) | |
| download | HydroRollCore-ea840bbc63843bd605a00da31f80241a4f2a9746.tar.gz HydroRollCore-ea840bbc63843bd605a00da31f80241a4f2a9746.zip | |
chore(deps|rust): add clap dependencies
| -rw-r--r-- | Cargo.toml | 5 | ||||
| -rw-r--r-- | hydro_roll_core/libcore.pyi | 6 | ||||
| -rw-r--r-- | src/main.rs | 13 | ||||
| -rw-r--r-- | tests/test_corelib.py | 3 |
4 files changed, 9 insertions, 18 deletions
@@ -1,6 +1,6 @@ [package] -name = "hydro_roll_core" -version = "0.0.1-alpha.1" +name = "hydro-roll-core" +version = "0.0.2-alpha.1" edition = "2021" description = "Core Lib for HydroRoll System." license = "MIT" @@ -15,4 +15,5 @@ crate-type = ["cdylib"] [dependencies] pyo3 = { version = "0.19.2", features = ["abi3-py39"] } +clap = { version = "4.0", features = ["derive"] } rand = "0.8.5" diff --git a/hydro_roll_core/libcore.pyi b/hydro_roll_core/libcore.pyi index 6364ca4..d852171 100644 --- a/hydro_roll_core/libcore.pyi +++ b/hydro_roll_core/libcore.pyi @@ -1,7 +1,7 @@ -class libcore: +class libcore(object): """Core library for hydro roll""" - def __init__(self): ... + def __init__(self, name: str = ""): ... - def process_rule_pack(rule_pack: str) -> str: + def process_rule_pack(self, rule_pack: str) -> str: ... diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index a855efc..0000000 --- a/src/main.rs +++ /dev/null @@ -1,13 +0,0 @@ -use lib::process_rule_pack; - -fn main() { - let args: Vec<String> = std::env::args().collect(); - if args.len() < 2 { - eprintln!("Usage: {} <rule_pack>", args[0]); - std::process::exit(1); - } - match process_rule_pack(&args[1]) { - Ok(result) => println!("Result: {}", result), - Err(e) => eprintln!("Error: {}", e), - } -}
\ No newline at end of file diff --git a/tests/test_corelib.py b/tests/test_corelib.py index a0a3424..4a21e29 100644 --- a/tests/test_corelib.py +++ b/tests/test_corelib.py @@ -6,6 +6,9 @@ def main(): rule_pack = "example_rule_pack" result = cb.process_rule_pack(rule_pack) print(result) + print(cb.name) + cb.name = "a" + print(cb.name) if __name__ == "__main__": main()
\ No newline at end of file |
