Red-GUI.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:Red-GUI 作者: ScarletRav3n 项目源码 文件源码
def run(self):
        if self.reqs:
            try:
                shutil.rmtree(REQS_DIR, onerror=remove_readonly)
                print("Installed local packages have been wiped.")
            except FileNotFoundError:
                pass
            except Exception as e:
                print("An error occurred when trying to remove installed "
                      "requirements: {}".format(e))
        if self.data:
            try:
                shutil.rmtree("data", onerror=remove_readonly)
                print("'data' folder has been wiped.")
            except FileNotFoundError:
                pass
            except Exception as e:
                print("An error occurred when trying to remove the 'data' folder: "
                      "{}".format(e))

        if self.cogs:
            try:
                shutil.rmtree("cogs", onerror=remove_readonly)
                print("'cogs' folder has been wiped.")
            except FileNotFoundError:
                pass
            except Exception as e:
                print("An error occurred when trying to remove the 'cogs' folder: "
                      "{}".format(e))

        if self.git_reset:
            code = subprocess.call(("git", "reset", "--hard"),
                                   creationflags=subprocess.CREATE_NEW_CONSOLE, shell=False)
            if code == 0:
                print("Red has been restored to the last local commit.")
            else:
                print("The repair has failed.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号