initial commit of PropMap

This commit is contained in:
Rowan Cockett
2015-05-31 10:43:23 -07:00
parent 401336f412
commit a953a52ccc
3 changed files with 182 additions and 3 deletions
+3 -1
View File
@@ -58,9 +58,11 @@ def hook(obj, method, name=None, overwrite=False, silent=False):
print 'Method '+name+' was not overwritten.'
def setKwargs(obj, **kwargs):
def setKwargs(obj, ignore=[], **kwargs):
"""Sets key word arguments (kwargs) that are present in the object, throw an error if they don't exist."""
for attr in kwargs:
if attr in ignore:
continue
if hasattr(obj, attr):
setattr(obj, attr, kwargs[attr])
else: