def METHOD_NAME(env_file):
    width = height = legfile = None
    fd = open(env_file, "r")
    if fd is None:
        grass.fatal("Unable to open file '{0}'".format(env_file))
    lines = fd.readlines()
    for line in lines:
        if line.startswith("#"):
            continue
        k, v = line.rstrip("\n").split("#", 1)[0].strip().split("=", 1)
        os.environ[k] = v
        if width is None and k == "GRASS_RENDER_WIDTH":
            width = int(v)
        if height is None and k == "GRASS_RENDER_HEIGHT":
            height = int(v)
        if legfile is None and k == "GRASS_LEGEND_FILE":
            legfile = v
    fd.close()
    if width is None or height is None:
        grass.fatal("Unknown monitor size")
    return width, height, legfile