""" Copyright (c) 2024 zhbaor This file is part of mower-ng (https://git.zhaozuohong.vip/mower-ng/mower-ng). Mower-ng is free software: you may copy, redistribute and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or later. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . """ from mower.data import scene_list scene_class = "class Scene:" scene_comment = "SceneComment = {" for scene, data in scene_list.items(): id = int(scene) label = data["label"] comment = data["comment"] scene_class += f'\n {label} = {id}\n "{comment}"' scene_comment += f'\n {id}: "{comment}",' scene_comment += "\n}" code = scene_class + "\n\n\n" + scene_comment + "\n" with open("./mower/utils/scene.py", "w", encoding="utf-8") as f: f.write(code)