So I\'m toying around with the idea of making myself (and anyone who cares to use it of course) a little boilerplate library in Python for Pygame. I would like a system where se
You could use PyYAML for parsing the files, and then the following function to merge two trees:
def merge(user, default):
if isinstance(user,dict) and isinstance(default,dict):
for k,v in default.iteritems():
if k not in user:
user[k] = v
else:
user[k] = merge(user[k],v)
return user
Optionally, you could do a deep-copy of the user-tree before calling this function.