mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-04-24 05:44:59 +00:00
Add missing var plugin files and update gitignore
- Added var plugin implementation files (get, set, delete, exists) - Updated .gitignore to not ignore backend/autometabuilder/workflow/plugins/var/ - These files were created but not committed due to gitignore pattern Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -19,6 +19,7 @@ lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
!backend/autometabuilder/workflow/plugins/var/
|
||||
wheels/
|
||||
share/python-wheels/
|
||||
*.egg-info/
|
||||
|
||||
1
backend/autometabuilder/workflow/plugins/var/__init__.py
Normal file
1
backend/autometabuilder/workflow/plugins/var/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""Variable management workflow plugins."""
|
||||
15
backend/autometabuilder/workflow/plugins/var/var_delete.py
Normal file
15
backend/autometabuilder/workflow/plugins/var/var_delete.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""Workflow plugin: delete variable from workflow store."""
|
||||
|
||||
|
||||
def run(runtime, inputs):
|
||||
"""Delete variable from workflow store."""
|
||||
key = inputs.get("key")
|
||||
|
||||
if key is None:
|
||||
return {"result": False, "deleted": False, "error": "key is required"}
|
||||
|
||||
if key in runtime.store:
|
||||
del runtime.store[key]
|
||||
return {"result": True, "deleted": True}
|
||||
|
||||
return {"result": False, "deleted": False}
|
||||
13
backend/autometabuilder/workflow/plugins/var/var_exists.py
Normal file
13
backend/autometabuilder/workflow/plugins/var/var_exists.py
Normal file
@@ -0,0 +1,13 @@
|
||||
"""Workflow plugin: check if variable exists in workflow store."""
|
||||
|
||||
|
||||
def run(runtime, inputs):
|
||||
"""Check if variable exists in workflow store."""
|
||||
key = inputs.get("key")
|
||||
|
||||
if key is None:
|
||||
return {"result": False, "error": "key is required"}
|
||||
|
||||
exists = key in runtime.store
|
||||
|
||||
return {"result": exists}
|
||||
15
backend/autometabuilder/workflow/plugins/var/var_get.py
Normal file
15
backend/autometabuilder/workflow/plugins/var/var_get.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""Workflow plugin: get variable from workflow store."""
|
||||
|
||||
|
||||
def run(runtime, inputs):
|
||||
"""Get variable value from workflow store."""
|
||||
key = inputs.get("key")
|
||||
default = inputs.get("default")
|
||||
|
||||
if key is None:
|
||||
return {"result": default, "exists": False, "error": "key is required"}
|
||||
|
||||
exists = key in runtime.store
|
||||
value = runtime.store.get(key, default)
|
||||
|
||||
return {"result": value, "exists": exists}
|
||||
14
backend/autometabuilder/workflow/plugins/var/var_set.py
Normal file
14
backend/autometabuilder/workflow/plugins/var/var_set.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""Workflow plugin: set variable in workflow store."""
|
||||
|
||||
|
||||
def run(runtime, inputs):
|
||||
"""Set variable value in workflow store."""
|
||||
key = inputs.get("key")
|
||||
value = inputs.get("value")
|
||||
|
||||
if key is None:
|
||||
return {"result": None, "key": None, "error": "key is required"}
|
||||
|
||||
runtime.store[key] = value
|
||||
|
||||
return {"result": value, "key": key}
|
||||
Reference in New Issue
Block a user