Skip to content

Commit

Permalink
remove AlertHelpRemote
Browse files Browse the repository at this point in the history
  • Loading branch information
dkratzert committed Sep 10, 2023
1 parent 7d6bc54 commit 133d79c
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions finalcif/cif/checkcif/checkcif.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 133d79c

Please sign in to comment.