interpreter: Add a way to copy and environment object

It is really usefull when you have common variables defined
for all tests and then need to set some extra ones for each test
pull/861/head
Thibault Saunier 8 years ago
parent 7e2390f355
commit fcaf319e49
  1. 5
      mesonbuild/interpreter.py

@ -27,6 +27,7 @@ import os, sys, subprocess, shutil, uuid, re
from functools import wraps
import importlib
import copy
run_depr_printed = False
@ -188,6 +189,7 @@ class EnvironmentVariablesHolder(InterpreterObject):
self.methods.update({'set': self.set_method,
'append': self.append_method,
'prepend' : self.prepend_method,
'copy' : self.copy_method,
})
@stringArgs
@ -210,6 +212,9 @@ class EnvironmentVariablesHolder(InterpreterObject):
def prepend_method(self, args, kwargs):
self.add_var(self.held_object.prepend, args, kwargs)
def copy_method(self, args, kwargs):
return copy.deepcopy(self)
class ConfigurationDataHolder(InterpreterObject):
def __init__(self):

Loading…
Cancel
Save