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."))
评论列表
文章目录