rda-python-common 3.0.1__tar.gz → 3.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. {rda_python_common-3.0.1/src/rda_python_common.egg-info → rda_python_common-3.0.3}/PKG-INFO +1 -1
  2. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/pyproject.toml +1 -1
  3. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/PgDBI.py +0 -19
  4. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/pg_dbi.py +0 -26
  5. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/pg_log.py +6 -5
  6. {rda_python_common-3.0.1 → rda_python_common-3.0.3/src/rda_python_common.egg-info}/PKG-INFO +1 -1
  7. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/LICENSE +0 -0
  8. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/README.md +0 -0
  9. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/setup.cfg +0 -0
  10. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/PgCMD.py +0 -0
  11. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/PgFile.py +0 -0
  12. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/PgLOG.py +0 -0
  13. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/PgLock.py +0 -0
  14. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/PgOPT.py +0 -0
  15. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/PgSIG.py +0 -0
  16. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/PgSplit.py +0 -0
  17. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/PgUtil.py +0 -0
  18. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/__init__.py +0 -0
  19. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/pg_cmd.py +0 -0
  20. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/pg_file.py +0 -0
  21. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/pg_lock.py +0 -0
  22. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/pg_opt.py +0 -0
  23. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/pg_password.py +0 -0
  24. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/pg_sig.py +0 -0
  25. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/pg_split.py +0 -0
  26. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/pg_util.py +0 -0
  27. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/pgpassword.py +0 -0
  28. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common/pgpassword.usg +0 -0
  29. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common.egg-info/SOURCES.txt +0 -0
  30. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common.egg-info/dependency_links.txt +0 -0
  31. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common.egg-info/entry_points.txt +0 -0
  32. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common.egg-info/requires.txt +0 -0
  33. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/src/rda_python_common.egg-info/top_level.txt +0 -0
  34. {rda_python_common-3.0.1 → rda_python_common-3.0.3}/test/test_common.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 3.0.1
3
+ Version: 3.0.3
4
4
  Summary: RDA Python common library codes shared by other RDA python packages
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-common
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rda_python_common"
7
- version = "3.0.1"
7
+ version = "3.0.3"
8
8
  authors = [
9
9
  { name="Zaihua Ji", email="zji@ucar.edu" },
10
10
  ]
@@ -1718,25 +1718,6 @@ def reset_rdadb_version(dsid):
1718
1718
 
1719
1719
  pgexec("UPDATE dataset SET version = version + 1 WHERE dsid = '{}'".format(dsid), PGDBI['ERRLOG'])
1720
1720
 
1721
- #
1722
- # check the use rdadb flag in table dataset for a given dataset and given values
1723
- #
1724
- def use_rdadb(dsid, logact = 0, vals = None):
1725
-
1726
- ret = '' # default to empty in case dataset not in RDADB
1727
- if dsid:
1728
- pgrec = pgget("dataset", "use_rdadb", "dsid = '{}'".format(dsid), PGDBI['EXITLG'])
1729
- if pgrec:
1730
- ret = 'N' # default to 'N' if dataset record in RDADB already
1731
- if pgrec['use_rdadb']:
1732
- if not vals: vals = "IPYMW" # default to Internal; Publishable; Yes RDADB
1733
- if vals.find(pgrec['use_rdadb']) > -1:
1734
- ret = pgrec['use_rdadb']
1735
- elif logact:
1736
- PgLOG.pglog("Dataset '{}' is not in RDADB!".format(dsid), logact)
1737
-
1738
- return ret
1739
-
1740
1721
  #
1741
1722
  # fld: field name for querry condition
1742
1723
  # vals: reference to aaray of values
@@ -1994,32 +1994,6 @@ class PgDBI(PgLOG):
1994
1994
  """
1995
1995
  self.pgexec("UPDATE dataset SET version = version + 1 WHERE dsid = '{}'".format(dsid), self.PGDBI['ERRLOG'])
1996
1996
 
1997
- def use_rdadb(self, dsid, logact = 0, vals = None):
1998
- """Return the use_rdadb flag for a dataset if it matches an allowed set.
1999
-
2000
- Args:
2001
- dsid (str | None): Dataset ID to query.
2002
- logact (int): Logging action flags for missing-dataset warnings; default 0.
2003
- vals (str | None): Accepted flag characters; defaults to 'IPYMW' when None.
2004
-
2005
- Returns:
2006
- str: The use_rdadb flag character when found and in vals; 'N' when the
2007
- dataset exists but the flag is not in vals; '' when dsid is falsy
2008
- or the dataset is not in RDADB.
2009
- """
2010
- ret = '' # default to empty in case dataset not in RDADB
2011
- if dsid:
2012
- pgrec = self.pgget("dataset", "use_rdadb", "dsid = '{}'".format(dsid), self.PGDBI['EXITLG'])
2013
- if pgrec:
2014
- ret = 'N' # default to 'N' if dataset record in RDADB already
2015
- if pgrec['use_rdadb']:
2016
- if not vals: vals = "IPYMW" # default to Internal; Publishable; Yes RDADB
2017
- if vals.find(pgrec['use_rdadb']) > -1:
2018
- ret = pgrec['use_rdadb']
2019
- elif logact:
2020
- self.pglog("Dataset '{}' is not in RDADB!".format(dsid), logact)
2021
- return ret
2022
-
2023
1997
  def get_field_condition(self, fld, vals, isstr = 0, noand = 0):
2024
1998
  """Build a SQL condition fragment for a field given a list of values.
2025
1999
 
@@ -262,22 +262,23 @@ class PgLOG:
262
262
  msg += " with 1 Error:\n"
263
263
  else:
264
264
  msg += " with {} Errors:\n".format(self.PGLOG['ERRCNT'])
265
+ msg += "\nERROR MESSAGE:\n"
265
266
  msg += self.break_long_string(self.PGLOG['ERRMSG'], 512, None, self.PGLOG['EMLMAX']/2, None, 50, 25)
266
267
  self.PGLOG['ERRCNT'] = 0
267
268
  self.PGLOG['ERRMSG'] = ''
268
269
  if self.PGLOG['SUMMSG']:
269
- msg += self.PGLOG['SEPLINE']
270
- if self.PGLOG['SUMMSG']: msg += "Summary:\n"
270
+ msg += "\nSUMMARY:\n"
271
271
  msg += self.break_long_string(self.PGLOG['SUMMSG'], 512, None, self.PGLOG['EMLMAX']/2, None, 50, 25)
272
272
  if self.PGLOG['EMLMSG']:
273
- msg += self.PGLOG['SEPLINE']
274
- if self.PGLOG['SUMMSG']: msg += "Detail Information:\n"
273
+ msg += "\nDETAIL INFORMATION:\n"
275
274
  self.PGLOG['EMLMSG'] = msg + self.break_long_string(self.PGLOG['EMLMSG'], 512, None, self.PGLOG['EMLMAX'], None, 50, 40)
276
275
  self.PGLOG['SUMMSG'] = "" # in case not
277
276
  else:
278
277
  if logact&self.ERRLOG: # record error for email summary
279
278
  self.PGLOG['ERRCNT'] += 1
280
- if logact&self.BRKLIN: self.PGLOG['ERRMSG'] += "\n"
279
+ if self.PGLOG['ERRMSG']: # blank line between consecutive errors
280
+ if not self.PGLOG['ERRMSG'].endswith('\n'): self.PGLOG['ERRMSG'] += "\n"
281
+ self.PGLOG['ERRMSG'] += "\n"
281
282
  self.PGLOG['ERRMSG'] += "{}. {}".format(self.PGLOG['ERRCNT'], msg)
282
283
  elif logact&self.EMLSUM:
283
284
  if self.PGLOG['SUMMSG']:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 3.0.1
3
+ Version: 3.0.3
4
4
  Summary: RDA Python common library codes shared by other RDA python packages
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-common