From 133d79c7c0b9b167341b52206bc6ff443d4fb649 Mon Sep 17 00:00:00 2001 From: Daniel Kratzert Date: Sun, 10 Sep 2023 15:01:40 +0200 Subject: [PATCH] remove AlertHelpRemote --- finalcif/cif/checkcif/checkcif.py | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/finalcif/cif/checkcif/checkcif.py b/finalcif/cif/checkcif/checkcif.py index 9ecf23f1..59e9374b 100644 --- a/finalcif/cif/checkcif/checkcif.py +++ b/finalcif/cif/checkcif/checkcif.py @@ -15,7 +15,7 @@ from typing import List, Optional, Dict import requests -from PyQt5.QtCore import QUrl, QThread, pyqtSignal +from PyQt5.QtCore import QThread, pyqtSignal from requests.exceptions import MissingSchema from finalcif.cif.cif_file_io import CifContainer @@ -243,32 +243,6 @@ def _parse_checkdef(self, alert: str) -> str: return '' -class AlertHelpRemote(): - def __init__(self, alert: str): - from PyQt5.QtNetwork import QNetworkAccessManager - self.netman = QNetworkAccessManager() - self.helpurl = fr'https://journals.iucr.org/services/cif/checking/{alert}.html' - print('url:', self.helpurl) - self.netman.finished.connect(self._parse_result) - - def get_help(self) -> None: - url = QUrl(self.helpurl) - req = QNetworkRequest(url) - print('doing request') - self.netman.get(req) - - def _parse_result(self, reply: 'QNetworkReply') -> str: - if reply.error(): - print(reply.errorString()) - print('parsing reply') - text = 'no help available' - try: - text = bytes(reply.readAll()).decode('ascii', 'ignore') - except Exception as e: - print(e) - return text - - if __name__ == "__main__": cif = Path('test-data/1000007-finalcif.cif') html = Path(r'tests/examples/work/checkcif-cu_BruecknerJK_153F40_0m-finalcif.html')