docs: def generate_file(fname, ns_func, dest_dir="."):
      """generate a constants file from its template"""
      with open(pjoin(root, 'buildutils', 'templates', '%s' % fname), 'r') as f:
          tpl = f.read()
      out = tpl.format(**ns_func())
      dest = pjoin(dest_dir, fname)
      info("generating %s from template" % dest)
      with open(dest, 'w') as f:
          f.write(out)