def _model_envs(environment): envs_array = [] vari = environment.get(tsmacro.Vari, {}) for k in vari: var = models.Variable() var.Key = k var.Value = vari[k] envs_array.append(var) envi = models.Environment() envi.Variables = envs_array return envi
def _model_envs(environment): if environment is None: return None envs_array = [] for k, v in vars(environment).items(): var = models.Variable() var.Key = k var.Value = v envs_array.append(var) envi = models.Environment() envi.Variables = envs_array return envi