Skip to content
Merged
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
2 changes: 1 addition & 1 deletion genologics/descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def __setitem__(self, key, value):
value = str(value)
else:
raise NotImplementedError(
f"Cannot handle value of type '{type(value)}'" " for UDF"
f"Cannot handle value of type '{type(value)}' for UDF"
)
if self._udt:
root = self.rootnode.find(nsmap("udf:type"))
Expand Down
16 changes: 6 additions & 10 deletions genologics/epp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
import logging
import os
import sys
from importlib.metadata import PackageNotFoundError, version
from logging.handlers import RotatingFileHandler
from shutil import copy
from time import localtime, strftime

import pkg_resources
from pkg_resources import DistributionNotFound
from requests import HTTPError

from genologics.config import MAIN_LOG
Expand Down Expand Up @@ -83,13 +82,10 @@ def __enter__(self):
logging.info(f"Executing file: {sys.argv[0]}")
logging.info(f"with parameters: {sys.argv[1:]}")
try:
logging.info(
f"Version of {self.PACKAGE}: "
+ pkg_resources.require(self.PACKAGE)[0].version
)
except DistributionNotFound as e:
logging.info(f"Version of {self.PACKAGE}: {version(self.PACKAGE)}")
except PackageNotFoundError as e:
logging.error(e)
logging.error(f"Make sure you have the {self.PACKAGE} " "package installed")
logging.error(f"Make sure you have the {self.PACKAGE} package installed")
sys.exit(-1)
return self

Expand Down Expand Up @@ -182,7 +178,7 @@ def prepend_old_log(self, external_log_file=None):
f.write("=" * 80 + "\n")
except HTTPError: # Probably no artifact found, skip prepending
print(
("No log file artifact found " f"for id: {log_file_name}"),
(f"No log file artifact found for id: {log_file_name}"),
file=sys.stderr,
)
except OSError as e: # Probably some path was wrong in copy
Expand Down Expand Up @@ -414,7 +410,7 @@ def _log_after_change(self):
}

logging.info(
"Updated {d_elt_type} udf: {d_udf}, from {su} to " "{nv}.".format(**d)
"Updated {d_elt_type} udf: {d_udf}, from {su} to {nv}.".format(**d)
)

def copy_udf(self, changelog_f=None):
Expand Down