From 3dc900f2a66b76fc783ca1cffce8a12b2699899d Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Fri, 11 Nov 2022 13:42:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=85=8D=E7=BD=AE=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E6=94=AF=E6=8C=81=E6=98=BE=E7=A4=BA=E7=BD=91=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AutoConfig.py | 26 ++++++++++++------ .../ConfigLanguareRunner.cpython-37.pyc | Bin 17556 -> 17556 bytes 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/AutoConfig.py b/AutoConfig.py index f0f3313..b438e76 100755 --- a/AutoConfig.py +++ b/AutoConfig.py @@ -118,11 +118,13 @@ class InformationWindow(): if i[0] == choose: fileName = i[1] break + aboutHtml = "" try: get = requests.get(f"{urlSources}/information/{fileName}.txt") if get.status_code / 100 != 2 and get.status_code / 100 != 3: int("Bad") about = get.text + aboutHtml = str(about) if not "<" in about: # 非 Html 标签 for i in about.splitlines(): @@ -174,15 +176,21 @@ class InformationWindow(): messageLayout = QtWidgets.QVBoxLayout() if webeng: informationText = QtWebEngineWidgets.QWebEngineView() - #informationText.linkClicked.connect(lambda: print("a")) - '''try: - with open("/tmp/deepin-wine-runner-information.html", "w") as file: - file.write(about) - informationText.setUrl(QtCore.QUrl("file:///tmp/deepin-wine-runner-information.html")) - except: - traceback.print_exc()''' - informationText.setHtml(about) - #informationText.urlChanged.connect(lambda: informationText.setUrl(QtCore.QUrl("https://gfdgd-xi.github.io"))) + print(aboutHtml) + if aboutHtml[:7] == "Visit: ": + url = aboutHtml[7:].splitlines()[0] + print(url) + informationText.setUrl(QtCore.QUrl(url.strip())) + else: + #informationText.linkClicked.connect(lambda: print("a")) + try: + with open("/tmp/deepin-wine-runner-information.html", "w") as file: + file.write(about) + informationText.setUrl(QtCore.QUrl("file:///tmp/deepin-wine-runner-information.html")) + except: + traceback.print_exc() + informationText.setHtml(about) + #informationText.urlChanged.connect(lambda: informationText.setUrl(QtCore.QUrl("https://gfdgd-xi.github.io"))) else: informationText = QtWidgets.QTextBrowser() informationText.setHtml(about) diff --git a/__pycache__/ConfigLanguareRunner.cpython-37.pyc b/__pycache__/ConfigLanguareRunner.cpython-37.pyc index 81b25d5f8089deff2f10686d38bc9aa409b80815..17d0b46d781f60275d37f76ebc3a740accfeffb9 100644 GIT binary patch delta 22 ccmbQz$vCBxk=u!vmx}=iHh<39$ld7z07M}MNdN!< delta 22 ccmbQz$vCBxk=u!vmx}=iA`8+ta(B7_06u^PX8-^I