Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions NDATools/Configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import time

import yaml
from pkg_resources import resource_filename
from importlib.resources import files

import NDATools
from NDATools import NDA_TOOLS_LOGGING_YML_FILE
Expand Down Expand Up @@ -135,7 +135,7 @@ def _is_vtcmd(self):

def _check_and_fix_missing_options(self):
default_config = configparser.ConfigParser()
default_file_path = resource_filename(__name__, 'clientscripts/config/settings.cfg')
default_file_path = files(__name__) / 'clientscripts/config/settings.cfg'
default_config.read(default_file_path)
change_detected = False
for section in default_config.sections():
Expand Down
6 changes: 3 additions & 3 deletions NDATools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import threading

from pkg_resources import resource_filename
from importlib.resources import files

from typing import Tuple

Expand Down Expand Up @@ -105,11 +105,11 @@ def _create_if_not_exists(path):
_create_if_not_exists(NDA_TOOLS_SETTINGS_FOLDER)

if not pathlib.Path(NDA_TOOLS_LOGGING_YML_FILE).is_file():
shutil.copyfile(resource_filename(__name__, 'clientscripts/config/logging.yml'),
shutil.copyfile(files(__name__) / 'clientscripts/config/logging.yml',
NDA_TOOLS_LOGGING_YML_FILE)

if not pathlib.Path(NDA_TOOLS_SETTINGS_CFG_FILE).is_file():
shutil.copyfile(resource_filename(__name__, 'clientscripts/config/settings.cfg'),
shutil.copyfile(files(__name__) / 'clientscripts/config/settings.cfg',
NDA_TOOLS_SETTINGS_CFG_FILE)
# MAC users sometimes see output from python warnings module. Suppress these msgs
os.environ['PYTHONWARNINGS'] = 'ignore'
Expand Down