Blame util.py

b838e2
b838e2
# this file may be used from any of other project files
b838e2
# so don't import any project files here to avoid recursive imports
b838e2
b838e2
b838e2
def mergedict(dest, src, prefix = None, allow_collisions = False, overwrite = True):
b838e2
  for k, v in src.items():
b838e2
    kk = k if prefix is None else prefix + k
b838e2
    assert allow_collisions or kk not in dest
b838e2
    if overwrite or kk not in dest:
b838e2
      dest[kk] = v
b838e2