mpvQC.py 文件源码

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

项目:mpvQC 作者: Frechdachs 项目源码 文件源码
def __init__(self, parent):
        super(CheckForUpdatesMessageBox, self).__init__(parent)
        self.setAttribute(Qt.WA_DeleteOnClose, True)
        self.addButton(_("OK"), QMessageBox.AcceptRole)
        try:
            r = requests.get("https://mpvqc.rekt.cc/download/latest.txt", timeout=5)
            if v.split(" ")[-1] != r.text.split("\n")[0].strip():
                self.setText(
                        _("There is a new version of {} available ({}).<br>"
                        "Visit <a href='https://mpvqc.rekt.cc/'>"
                        "https://mpvqc.rekt.cc/</a> to download it.")
                        .format(v.split(" ")[0], r.text.strip())
                        )
            else:
                self.setText(
                            _("You are already using the most "
                            "recent version of {}. {}").format(v.split(" ")[0], "??")
                            )
        except requests.exceptions.ConnectionError:
            self.setText(_("A connection to the server could not be established."))
        except requests.exceptions.Timeout:
            self.setText(_("The server did not respond quickly enough."))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号