merging v0.8.0 branch

- finally using libxml2 parser in beautifulsoup/lxml
- minor bug in parsing the CCC field (qrz.com)
- fixed VK9XX fixture (lat/long)
- added support for python 3.10 and 3.11, pypy3.7-3.9
- removed support for python 3.4
- fixed escapings in regular expressions
- replaced exefile from past.buildins with custom function
This commit is contained in:
Tobias Wellnitz, DH1TW 2022-12-05 01:01:45 +01:00
parent ebdf0c9707
commit b1ef2a6d93
13 changed files with 153 additions and 123 deletions

17
test/execfile.py Normal file
View file

@ -0,0 +1,17 @@
# In Python3 the function 'execfile' has been deprecated. The alternative is 'exec'.
# While the package 'past.builtins' provide a python2 / python3 compatible version of 'execfile',
# the import of 'past.builtins' keeps on throwing a deprecation warning about 'imp'.
# Therefore the version of 'execfile' from 'past/builtins' has been replaced by this alternative
# version, found on: https://stackoverflow.com/a/41658338/2292376
# When support of Python2 is finally dropped, this function can be removed
def execfile(filepath, globals=None, locals=None):
if globals is None:
globals = {}
globals.update({
"__file__": filepath,
"__name__": "__main__",
})
with open(filepath, 'rb') as file:
exec(compile(file.read(), filepath, 'exec'), globals, locals)

View file

@ -1,4 +1,4 @@
from past.builtins import execfile
from .execfile import execfile
import os
import sys
import datetime

View file

@ -46,8 +46,8 @@ response_Exception_VK9XX_with_end_date = {
'adif': 35,
'country': u'CHRISTMAS ISLAND',
'continent': u'OC',
'latitude': -10.44,
'longitude': 105.71,
'latitude': -10.52,
'longitude': 105.54,
'cqz': 29,
}

View file

@ -2,10 +2,21 @@ import os
import sys
import datetime
from past.builtins import execfile
from .execfile import execfile
from future.utils import iteritems
import pytest
def execfile(filepath, globals=None, locals=None):
if globals is None:
globals = {}
globals.update({
"__file__": filepath,
"__name__": "__main__",
})
with open(filepath, 'rb') as file:
exec(compile(file.read(), filepath, 'exec'), globals, locals)
from pyhamtools.qsl import get_lotw_users
if sys.version_info.major == 3: