def METHOD_NAME(self, filename, data):
    target = self.tree_path(filename)
    dirname = os.path.dirname(target)
    os.makedirs(dirname, exist_ok=True)
    print(f"append '{target}' '{data}'")
    with open(target, "a", encoding="utf8") as f:
        f.write(bytes(data, "utf8").decode("unicode_escape"))
        f.write("\n")