(self)
| 14 | |
| 15 | class CreateSetting: |
| 16 | def create(self): |
| 17 | if os.path.exists("setting.py"): |
| 18 | confirm = input("配置文件已存在 是否覆盖 (y/n). ") |
| 19 | if confirm != "y": |
| 20 | print("取消覆盖 退出") |
| 21 | return |
| 22 | |
| 23 | template_file_path = os.path.abspath( |
| 24 | os.path.join(__file__, "../../../templates/project_template/setting.py") |
| 25 | ) |
| 26 | shutil.copy(template_file_path, "./", follow_symlinks=False) |
| 27 | print("配置文件生成成功") |