Sha256: 6b8a210c655d4a341c5ac634d2c6ba99e1a048ad9824453c744602fadad3773e

Contents?: true

Size: 848 Bytes

Versions: 17

Compression:

Stored size: 848 Bytes

Contents

# Stash API is useful for storing simple key/value pairs
# to preserve state between script runs
stash_set("key1", "val1")
stash_set("key2", "val2")
check_expression(f"'{stash_get('key1')}' == 'val1'")
check_expression(f"'{stash_get('key2')}' == 'val2'")
check_expression(f"{stash_keys()} == ['key1', 'key2']")
stash_set("key1", 1)
stash_set("key2", 2)
check_expression(f"{stash_all()} == {{'key1':1, 'key2':2}}")
stash_delete("key2")
check_expression(f"{stash_get('key2')} == None")
stash_delete("key1")
data = [1, 2, [3, 4]]
stash_set("ary", data)
check_expression(f"{stash_get('ary')} == {data}")
stash_delete("ary")
# Note: hashes with symbol keys works but get converted to string keys on stash_get
hash = {"one": 1, "two": 2, "string": "string"}
stash_set("hash", hash)
check_expression(f"{stash_get('hash')} == {hash}")
stash_delete("hash")

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
openc3-cosmos-demo-6.0.2 targets/INST2/procedures/stash.py
openc3-cosmos-demo-6.0.1 targets/INST2/procedures/stash.py
openc3-cosmos-demo-6.0.0 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.20.0 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.19.0 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.18.0 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.17.1 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.17.0 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.16.0 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.15.2 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.15.1 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.15.0 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.14.2 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.14.1 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.14.0 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.13.0 targets/INST2/procedures/stash.py
openc3-cosmos-demo-5.12.0 targets/INST2/procedures/stash.py