|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import lxml.etree as lxml
|
|
|
|
|
import re
|
|
|
|
|
import pickle
|
|
|
|
|
import importlib_resources as pkg_resources
|
|
|
|
|
from importlib_resources import files
|
|
|
|
|
|
|
|
|
|
from conversion_utils.utils import xpath_find, get_xml_id
|
|
|
|
|
|
|
|
|
@ -241,9 +241,10 @@ class Converter:
|
|
|
|
|
|
|
|
|
|
def __init__(self, xml_file_name=None):
|
|
|
|
|
if (xml_file_name is None):
|
|
|
|
|
if (pkg_resources.is_resource('conversion_utils.resources', JOS_SPECIFICATIONS_PICKLE_RESOURCE)):
|
|
|
|
|
resource = files('conversion_utils.resources').joinpath(JOS_SPECIFICATIONS_PICKLE_RESOURCE)
|
|
|
|
|
if (resource.is_file()):
|
|
|
|
|
try:
|
|
|
|
|
with pkg_resources.open_binary('conversion_utils.resources', JOS_SPECIFICATIONS_PICKLE_RESOURCE) as pickle_file:
|
|
|
|
|
with resource.open('rb') as pickle_file:
|
|
|
|
|
self.specifications = pickle.load(pickle_file)
|
|
|
|
|
except:
|
|
|
|
|
exit('Could not parse specifications pickle file installed.')
|
|
|
|
|