rda-python-common 1.0.5__tar.gz → 1.0.7__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.

Potentially problematic release.


This version of rda-python-common might be problematic. Click here for more details.

Files changed (21) hide show
  1. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/PKG-INFO +1 -1
  2. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/pyproject.toml +1 -1
  3. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common/PgDBI.py +11 -7
  4. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common.egg-info/PKG-INFO +1 -1
  5. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/LICENSE +0 -0
  6. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/README.md +0 -0
  7. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/setup.cfg +0 -0
  8. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common/PgCMD.py +0 -0
  9. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common/PgFile.py +0 -0
  10. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common/PgGLBS.py +0 -0
  11. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common/PgLOG.py +0 -0
  12. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common/PgLock.py +0 -0
  13. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common/PgOPT.py +0 -0
  14. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common/PgPGS.py +0 -0
  15. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common/PgSIG.py +0 -0
  16. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common/PgSplit.py +0 -0
  17. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common/PgUtil.py +0 -0
  18. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common/__init__.py +0 -0
  19. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common.egg-info/SOURCES.txt +0 -0
  20. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common.egg-info/dependency_links.txt +0 -0
  21. {rda_python_common-1.0.5 → rda_python_common-1.0.7}/src/rda_python_common.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rda_python_common
3
- Version: 1.0.5
3
+ Version: 1.0.7
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 = "1.0.5"
7
+ version = "1.0.7"
8
8
 
9
9
  authors = [
10
10
  { name="Zaihua Ji", email="zji@ucar.edu" },
@@ -37,7 +37,7 @@ CHCODE = 1042
37
37
 
38
38
  # hard coded db ports for dbnames
39
39
  DBPORTS = {
40
- 'default' : 5432
40
+ 'default' : 0
41
41
  }
42
42
 
43
43
  DBPASS = {}
@@ -517,9 +517,9 @@ def pgconnect(reconnect = 0, pgcnt = 0, autocommit = True):
517
517
  config['host'] = PGDBI['DBHOST'] if PGDBI['DBHOST'] else PGDBI['DEFHOST']
518
518
  if not PGDBI['DBPORT']: PGDBI['DBPORT'] = get_dbport(PGDBI['DBNAME'])
519
519
  if PGDBI['DBPORT']: config['port'] = PGDBI['DBPORT']
520
- config['password'] = get_pgpass_password()
521
-
520
+ config['password'] = '***'
522
521
  sqlstr = "psycopg2.connect(**{})".format(config)
522
+ config['password'] = get_pgpass_password()
523
523
  if PgLOG.PGLOG['DBGLEVEL']: PgLOG.pgdbg(1000, sqlstr)
524
524
  try:
525
525
  PgLOG.PGLOG['PGDBBUF'] = pgdb = PgSQL.connect(**config)
@@ -2221,8 +2221,12 @@ def pgname(str, sign = None):
2221
2221
  def get_pgpass_password():
2222
2222
 
2223
2223
  if PGDBI['PWNAME']: return PGDBI['PWNAME']
2224
- if not DBPASS: read_pgpass()
2225
- return DBPASS.get((PGDBI['DBSHOST'], PGDBI['DBPORT'], PGDBI['DBNAME'], PGDBI['LNNAME']))
2224
+ if not DBPASS: read_pgpass()
2225
+ dbport = str(PGDBI['DBPORT']) if PGDBI['DBPORT'] else '5432'
2226
+ pwname = DBPASS.get((PGDBI['DBSHOST'], dbport, PGDBI['DBNAME'], PGDBI['LNNAME']))
2227
+ if not pwname: pwname = DBPASS.get((PGDBI['DBHOST'], dbport, PGDBI['DBNAME'], PGDBI['LNNAME']))
2228
+
2229
+ return pwname
2226
2230
 
2227
2231
  #
2228
2232
  # Reads the .pgpass file and returns a dictionary of credentials.
@@ -2234,7 +2238,7 @@ def read_pgpass():
2234
2238
  for line in f:
2235
2239
  line = line.strip()
2236
2240
  if not line or line.startswith("#"): continue
2237
- dbhost, dbport, dbname, usname, pwname = line.split(":")
2238
- DBPASS[(dbhost, dbport, dbname, usname)] = pwname
2241
+ dbhost, dbport, dbname, lnname, pwname = line.split(":")
2242
+ DBPASS[(dbhost, dbport, dbname, lnname)] = pwname
2239
2243
  except FileNotFoundError:
2240
2244
  pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rda_python_common
3
- Version: 1.0.5
3
+ Version: 1.0.7
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