Skip to content

Instantly share code, notes, and snippets.

@kergoth
Created September 30, 2020 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kergoth/5f305082ed03953cd56f528f95a3d643 to your computer and use it in GitHub Desktop.
Save kergoth/5f305082ed03953cd56f528f95a3d643 to your computer and use it in GitHub Desktop.
def getvars(d, *vars, expand=True):
return tuple(d.getVar(var, expand) for var in vars)
def getvars_with(d, *vars, update_dict=None):
if update_dict:
d = d.createCopy()
d.update(update_dict)
return tuple(d.get(var) for var in vars)
def getvars_with(d, update_dict, *vars):
l = d.createCopy()
l.update(update_dict)
return tuple(l.getVar(var) for var in vars)
def getvar_with(d, update_dict, var):
return getvars_with(d, update_dict, var)
def expand_with(d, update_dict, string):
l = d.createCopy()
l.update(update_dict)
return l.expand(string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment