Skip to content

Apply EnvironmentDict to another and Rex confusion. #1355

Answered by nerdvegas
herronelou asked this question in Q&A
Discussion options

You must be logged in to vote

It might be possible to take that kind of approach, but honestly I think you're overthinking it! How about -

env_updates = {
    "SOME_PATH": ("append", "foo"),
    "BAR": ("set", "bar")
}

def my_callback(ex):
    for varname, (op, val) in env_update.items():
        if op == "append":
            ex.env[varname].append(val)
        else if ...:
            ...  # and so on

I'm sure we could improve the rex API to support things like playing the actions of one Executor onto another, but tbh this kind of thing is not the primary goal of rez and I don't think we'd benefit from spending resources on that. As its own project though - ie a python-based, shell-agnostic language that can trans…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@herronelou
Comment options

Answer selected by JeanChristopheMorinPerso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants