mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 16:53:04 +08:00
feat(LocalRunnerClient): support executing origin actions
Context: Origin actions are generated by DynamicActionGenerator and may optionally be persistently serialized. This feature adds the basic execution flow for origin actions within LocalRunnerClient. Notes: The current mapping between action files and their extensions is hardcoded. This should later be replaced with a configurable registry or loaded dynamically during application startup.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import sys
|
||||
|
||||
|
||||
def parse_args(argv):
|
||||
"""
|
||||
将 --key=value 解析成 dict
|
||||
"""
|
||||
params = {}
|
||||
for arg in argv:
|
||||
if arg.startswith("--") and "=" in arg:
|
||||
key, value = arg[2:].split("=", 1)
|
||||
params[key] = value
|
||||
return params
|
||||
|
||||
|
||||
def main():
|
||||
params = parse_args(sys.argv[1:])
|
||||
|
||||
name = params.get("name", "World")
|
||||
print(f"Hello {name}!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user