rda-python-common 1.0.35__tar.gz → 1.0.37__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.35 → rda_python_common-1.0.37}/PKG-INFO +1 -1
  2. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/pyproject.toml +1 -1
  3. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common/PgFile.py +16 -16
  4. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common/PgLOG.py +13 -15
  5. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common.egg-info/PKG-INFO +1 -1
  6. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/LICENSE +0 -0
  7. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/README.md +0 -0
  8. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/setup.cfg +0 -0
  9. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common/PgCMD.py +0 -0
  10. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common/PgDBI.py +0 -0
  11. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common/PgLock.py +0 -0
  12. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common/PgOPT.py +0 -0
  13. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common/PgSIG.py +0 -0
  14. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common/PgSplit.py +0 -0
  15. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common/PgUtil.py +0 -0
  16. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common/__init__.py +0 -0
  17. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common.egg-info/SOURCES.txt +0 -0
  18. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common.egg-info/dependency_links.txt +0 -0
  19. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common.egg-info/requires.txt +0 -0
  20. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/src/rda_python_common.egg-info/top_level.txt +0 -0
  21. {rda_python_common-1.0.35 → rda_python_common-1.0.37}/test/test_common.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 1.0.35
3
+ Version: 1.0.37
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.35"
7
+ version = "1.0.37"
8
8
  authors = [
9
9
  { name="Zaihua Ji", email="zji@ucar.edu" },
10
10
  ]
@@ -9,7 +9,7 @@
9
9
  # Purpose : python library module to copy, move and delete data files locally
10
10
  # and remotely
11
11
  #
12
- # Github : https://github.com/NCAR/rda-python_common.git
12
+ # Github : https://github.com/NCAR/rda-python-common.git
13
13
  #
14
14
  ###############################################################################
15
15
  #
@@ -101,21 +101,21 @@ QSTATS = {
101
101
  }
102
102
 
103
103
  QPOINTS = {
104
- 'L' : 'rda-glade',
105
- 'B' : 'rda-quasar',
106
- 'D' : 'rda-quasar-drdata'
104
+ 'L' : 'gdex-glade',
105
+ 'B' : 'gdex-quasar',
106
+ 'D' : 'gdex-quasar-drdata'
107
107
  }
108
108
 
109
109
  QHOSTS = {
110
- 'rda-glade' : LHOST,
111
- 'rda-quasar' : BHOST,
112
- 'rda-quasar-drdata' : DHOST
110
+ 'gdex-glade' : LHOST,
111
+ 'gdex-quasar' : BHOST,
112
+ 'gdex-quasar-drdata' : DHOST
113
113
  }
114
114
 
115
115
  ENDPOINTS = {
116
- 'rda-glade' : "NCAR RDA GLADE",
117
- 'rda-quasar' : "NCAR RDA Quasar",
118
- 'rda-quasar-drdata' : "NCAR RDA Quasar DRDATA"
116
+ 'gdex-glade' : "NCAR RDA GLADE",
117
+ 'gdex-quasar' : "NCAR RDA Quasar",
118
+ 'gdex-quasar-drdata' : "NCAR RDA Quasar DRDATA"
119
119
  }
120
120
 
121
121
  BFILES = {} # cache backup file names and dates for each bid
@@ -332,7 +332,7 @@ def local_copy_object(tofile, fromfile, bucket = None, meta = None, logact = 0):
332
332
  # tofiles - target file name list, echo name leading with /dsnnn.n/ on Quasar and
333
333
  # leading with /data/ or /decsdata/ on local glade disk
334
334
  # fromfiles - source file name list, the same format as the tofiles
335
- # topoint - target endpoint name, 'rda-glade', 'rda-quasar' or 'rda-quasar-drdata'
335
+ # topoint - target endpoint name, 'gdex-glade', 'gdex-quasar' or 'gdex-quasar-drdata'
336
336
  # frompoint - source endpoint name, the same choices as the topoint
337
337
  #
338
338
  def quasar_multiple_trasnfer(tofiles, fromfiles, topoint, frompoint, logact = 0):
@@ -374,7 +374,7 @@ def quasar_multiple_trasnfer(tofiles, fromfiles, topoint, frompoint, logact = 0)
374
374
  # tofile - target file name, leading with /dsnnn.n/ on Quasar and
375
375
  # leading with /data/ or /decsdata/ on local glade disk
376
376
  # fromfile - source file, the same format as the tofile
377
- # topoint - target endpoint name, 'rda-glade', 'rda-quasar' or 'rda-quasar-drdata'
377
+ # topoint - target endpoint name, 'gdex-glade', 'gdex-quasar' or 'gdex-quasar-drdata'
378
378
  # frompoint - source endpoint name, the same choices as the topoint
379
379
  #
380
380
  def endpoint_copy_endpoint(tofile, fromfile, topoint, frompoint, logact = 0):
@@ -532,7 +532,7 @@ def check_globus_finished(tofile, topoint, logact = 0):
532
532
  def local_copy_backup(tofile, fromfile, endpoint = None, logact = 0):
533
533
 
534
534
  if not endpoint: endpoint = PgLOG.PGLOG['BACKUPEP']
535
- return endpoint_copy_endpoint(tofile, fromfile, endpoint, 'rda-glade', logact)
535
+ return endpoint_copy_endpoint(tofile, fromfile, endpoint, 'gdex-glade', logact)
536
536
 
537
537
  #
538
538
  # Copy a Quasar backup file to local Globus endpoint
@@ -544,7 +544,7 @@ def local_copy_backup(tofile, fromfile, endpoint = None, logact = 0):
544
544
  def backup_copy_local(tofile, fromfile, endpoint = None, logact = 0):
545
545
 
546
546
  if not endpoint: endpoint = PgLOG.PGLOG['BACKUPEP']
547
- return endpoint_copy_endpoint(tofile, fromfile, 'rda-glade', endpoint, logact)
547
+ return endpoint_copy_endpoint(tofile, fromfile, 'gdex-glade', endpoint, logact)
548
548
 
549
549
  #
550
550
  # Copy a remote file to local
@@ -1484,7 +1484,7 @@ def local_host_action(host, action, info, logact = 0):
1484
1484
  if host == "partition":
1485
1485
  msg = "for individual partition"
1486
1486
  elif host == "rda_config":
1487
- msg = "via https://rda.ucar.edu/internal/rda_pg_config"
1487
+ msg = "via https://gdex.ucar.edu/internal/rda_pg_config"
1488
1488
  elif host in PgLOG.BCHCMDS:
1489
1489
  msg = "on a {} Node".format(host)
1490
1490
  else:
@@ -1577,7 +1577,7 @@ def check_rda_file(file, host = LHOST, opt = 0, logact = 0):
1577
1577
  def check_globus_file(file, endpoint = None, opt = 0, logact = 0):
1578
1578
 
1579
1579
  if not endpoint: endpoint = PgLOG.PGLOG['BACKUPEP']
1580
- if endpoint == 'rda-glade':
1580
+ if endpoint == 'gdex-glade':
1581
1581
  if re.match(r'^/(data|decsdata)/', file): file = PgLOG.PGLOG['DSSDATA'] + file
1582
1582
  return check_local_file(file, opt, logact)
1583
1583
  else:
@@ -402,15 +402,11 @@ def pglog(msg, logact = MSGLOG):
402
402
  if logact&EMLLOG: logact &= ~EMLLOG
403
403
  if not logact&ERRLOG: logact &= ~EMEROL
404
404
 
405
- if msg: msg = msg.lstrip() # remove leading whitespaces for logging message
406
-
405
+ msg = msg.lstrip() if msg else '' # remove leading whitespaces for logging message
407
406
  if logact&EXITLG:
408
407
  ext = "Exit 1 in {}\n".format(os.getcwd())
409
- if not msg:
410
- msg = ext
411
- else:
412
- msg = msg.rstrip()
413
- msg += "; " + ext
408
+ if msg: msg = msg.rstrip() + "; "
409
+ msg += ext
414
410
  else:
415
411
  if msg and not re.search(r'(\n|\r)$', msg): msg += "\n"
416
412
  if logact&RETMSG: retmsg = msg
@@ -418,7 +414,8 @@ def pglog(msg, logact = MSGLOG):
418
414
  if logact&EMLALL:
419
415
  if logact&SNDEML or not msg:
420
416
  title = (msg if msg else "Message from {}-{}".format(PGLOG['HOSTNAME'], get_command()))
421
- msg = send_email(title.rstrip())
417
+ msg = title + '\n' + msg
418
+ send_email(title.rstrip())
422
419
  elif msg:
423
420
  set_email(msg, logact)
424
421
 
@@ -428,7 +425,8 @@ def pglog(msg, logact = MSGLOG):
428
425
  if not logact&EMLALL: set_email(msg, logact)
429
426
  title = "ABORTS {}-{}".format(PGLOG['HOSTNAME'], get_command())
430
427
  set_email((("ABORTS " + CPID['PID']) if CPID['PID'] else title), EMLTOP)
431
- msg += send_email(title)
428
+ msg = title + '\n' + msg
429
+ send_email(title)
432
430
 
433
431
  if logact&LOGERR: # make sure error is always logged
434
432
  msg = break_long_string(msg)
@@ -1315,11 +1313,11 @@ def set_common_pglog():
1315
1313
  SETPGLOG("DBGLEVEL", '') # debug level
1316
1314
  SETPGLOG("DBGPATH", PGLOG['DSSDBHM']+"/log") # path to debug log file
1317
1315
  SETPGLOG("OBJCTBKT", "rda-data") # default Bucket on Object Store
1318
- SETPGLOG("BACKUPEP", "rda-quasar") # default Globus Endpoint on Quasar
1319
- SETPGLOG("DRDATAEP", "rda-quasar-drdata") # DRDATA Globus Endpoint on Quasar
1316
+ SETPGLOG("BACKUPEP", "gdex-quasar") # default Globus Endpoint on Quasar
1317
+ SETPGLOG("DRDATAEP", "gdex-quasar-drdata") # DRDATA Globus Endpoint on Quasar
1320
1318
  SETPGLOG("DBGFILE", "pgdss.dbg") # debug file name
1321
1319
  SETPGLOG("CNFPATH", PGLOG['DSSHOME']+"/config") # path to configuration files
1322
- SETPGLOG("DSSURL", "https://rda.ucar.edu") # current dss web URL
1320
+ SETPGLOG("DSSURL", "https://gdex.ucar.edu") # current dss web URL
1323
1321
  SETPGLOG("RQSTURL", "/datasets/request") # request URL path
1324
1322
  SETPGLOG("WEBSERVERS", "rda-web-prod01.ucar.edu:rda-web-test01.ucar.edu") # webserver names for Web server
1325
1323
  PGLOG['WEBHOSTS'] = PGLOG['WEBSERVERS'].split(':') if PGLOG['WEBSERVERS'] else []
@@ -1330,7 +1328,7 @@ def set_common_pglog():
1330
1328
  SETPGLOG("DSSWEB", PGLOG['LOCDATA']+"/web")
1331
1329
  SETPGLOG("DSWHOME", PGLOG['DSSWEB']+"/datasets") # datast web root path
1332
1330
  PGLOG['HOMEROOTS'] = "{}|{}".format(PGLOG['DSSHOME'], PGLOG['DSWHOME'])
1333
- SETPGLOG("DSSDATA", "/glade/campaign/collections/rda") # dss data root path
1331
+ SETPGLOG("DSSDATA", "/glade/campaign/collections/gdex") # dss data root path
1334
1332
  SETPGLOG("DSDHOME", PGLOG['DSSDATA']+"/data") # dataset data root path
1335
1333
  SETPGLOG("DECSHOME", PGLOG['DSSDATA']+"/decsdata") # dataset decsdata root path
1336
1334
  SETPGLOG("DSHHOME", PGLOG['DECSHOME']+"/helpfiles") # dataset help root path
@@ -1354,12 +1352,12 @@ def set_common_pglog():
1354
1352
  os.environ['history'] = '0'
1355
1353
 
1356
1354
  # set tmp dir
1357
- SETPGLOG("TMPPATH", "/glade/campaign/collections/rda/work/ptmp")
1355
+ SETPGLOG("TMPPATH", "/glade/campaign/collections/gdex/work/ptmp")
1358
1356
  if not PGLOG['TMPPATH']: PGLOG['TMPPATH'] = "/data/ptmp"
1359
1357
 
1360
1358
  SETPGLOG("TMPDIR", '')
1361
1359
  if not PGLOG['TMPDIR']:
1362
- PGLOG['TMPDIR'] = "/glade/campaign/collections/rda/scratch/" + PGLOG['CURUID']
1360
+ PGLOG['TMPDIR'] = "/glade/campaign/collections/gdex/scratch/" + PGLOG['CURUID']
1363
1361
  os.environ['TMPDIR'] = PGLOG['TMPDIR']
1364
1362
 
1365
1363
  # empty diretory for HOST-sync
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 1.0.35
3
+ Version: 1.0.37
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