diff --git a/README.md b/README.md index c980135..bb76800 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ PgLOG.pglog("hello", PgLOG.LOGWRN) python -c "import rda_python_common; print(rda_python_common.__version__)" ``` -You should see the installed version (currently `3.0.19`). If the import +You should see the installed version (currently `3.0.20`). If the import fails, double-check that the active Python environment is the one where you ran `pip install`. diff --git a/pyproject.toml b/pyproject.toml index 801693c..5e0af89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "rda_python_common" -version = "3.0.19" +version = "3.0.20" authors = [ { name="Zaihua Ji", email="zji@ucar.edu" }, ] diff --git a/src/rda_python_common/__init__.py b/src/rda_python_common/__init__.py index c170f19..28abc0f 100644 --- a/src/rda_python_common/__init__.py +++ b/src/rda_python_common/__init__.py @@ -22,7 +22,7 @@ from . import PgLOG, PgUtil, PgDBI, PgFile, PgLock, PgCMD, PgSIG, PgOPT, PgSplit -__version__ = "3.0.19" +__version__ = "3.0.20" __all__ = [ "PgLOG", diff --git a/src/rda_python_common/pg_file.py b/src/rda_python_common/pg_file.py index a94a811..c3c1eef 100644 --- a/src/rda_python_common/pg_file.py +++ b/src/rda_python_common/pg_file.py @@ -118,7 +118,9 @@ def __init__(self): # record how many errors happen for working with HPSS, local or remote machines self.ECNTS = {'D': 0, 'H': 0, 'L': 0, 'R': 0, 'O': 0, 'B': 0} # up limits for how many continuing errors allowed - self.ELMTS = {'D': 20, 'H': 20, 'L': 20, 'R': 20, 'O': 10, 'B': 10} + # 'B' is 5 because a failed Globus transfer counts once; it used to be logged + # twice per failure, so the old limit of 10 also gave up after 5 failures + self.ELMTS = {'D': 20, 'H': 20, 'L': 20, 'R': 20, 'O': 10, 'B': 5} # down storage hostnames & paths self.DHOSTS = { 'G': self.PGLOG['GPFSNAME'], diff --git a/src/rda_python_common/pg_log.py b/src/rda_python_common/pg_log.py index cbfdac3..7374448 100644 --- a/src/rda_python_common/pg_log.py +++ b/src/rda_python_common/pg_log.py @@ -249,9 +249,13 @@ def set_email(self, msg, logact=0): if self.PGLOG['PRGMSG']: msg = self.PGLOG['PRGMSG'] + "\n" + msg self.PGLOG['PRGMSG'] = "" + # callers usually end the message with their own '!', so do not add a second + # one, and drop it before continuing the sentence with the error count if self.PGLOG['ERRCNT'] == 0: - if not msg.endswith('\n'): msg += "!\n" + if not msg.endswith('\n'): + msg += "\n" if msg.endswith('!') else "!\n" else: + if msg.endswith('!'): msg = msg[:-1] if self.PGLOG['ERRCNT'] == 1: msg += " with 1 Error:\n" else: