rda-python-common 3.0.9__tar.gz → 3.0.10__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.9/src/rda_python_common.egg-info → rda_python_common-3.0.10}/PKG-INFO +1 -1
  2. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/pyproject.toml +1 -1
  3. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/pg_file.py +28 -4
  4. {rda_python_common-3.0.9 → rda_python_common-3.0.10/src/rda_python_common.egg-info}/PKG-INFO +1 -1
  5. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/LICENSE +0 -0
  6. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/README.md +0 -0
  7. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/setup.cfg +0 -0
  8. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/PgCMD.py +0 -0
  9. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/PgDBI.py +0 -0
  10. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/PgFile.py +0 -0
  11. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/PgLOG.py +0 -0
  12. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/PgLock.py +0 -0
  13. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/PgOPT.py +0 -0
  14. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/PgSIG.py +0 -0
  15. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/PgSplit.py +0 -0
  16. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/PgUtil.py +0 -0
  17. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/__init__.py +0 -0
  18. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/pg_cmd.py +0 -0
  19. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/pg_dbi.py +0 -0
  20. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/pg_lock.py +0 -0
  21. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/pg_log.py +0 -0
  22. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/pg_opt.py +0 -0
  23. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/pg_password.py +0 -0
  24. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/pg_sig.py +0 -0
  25. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/pg_split.py +0 -0
  26. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/pg_util.py +0 -0
  27. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/pgpassword.py +0 -0
  28. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common/pgpassword.usg +0 -0
  29. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common.egg-info/SOURCES.txt +0 -0
  30. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common.egg-info/dependency_links.txt +0 -0
  31. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common.egg-info/entry_points.txt +0 -0
  32. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common.egg-info/requires.txt +0 -0
  33. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/src/rda_python_common.egg-info/top_level.txt +0 -0
  34. {rda_python_common-3.0.9 → rda_python_common-3.0.10}/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.9
3
+ Version: 3.0.10
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.9"
7
+ version = "3.0.10"
8
8
  authors = [
9
9
  { name="Zaihua Ji", email="zji@ucar.edu" },
10
10
  ]
@@ -233,9 +233,9 @@ class PgFile(PgUtil, PgSIG):
233
233
  if self.pgcmp(thost, self.OHOST, 1) == 0:
234
234
  return self.local_copy_object(tofile, fromfile, None, None, logact)
235
235
  elif self.pgcmp(thost, self.BHOST, 1) == 0:
236
- return self.local_copy_backup(tofile, fromfile, self.QPOINTS['B'], logact)
236
+ return self.wait_copy_backup(tofile, fromfile, self.QPOINTS['B'], logact)
237
237
  elif self.pgcmp(thost, self.DHOST, 1) == 0:
238
- return self.local_copy_backup(tofile, fromfile, self.QPOINTS['D'], logact)
238
+ return self.wait_copy_backup(tofile, fromfile, self.QPOINTS['D'], logact)
239
239
  else:
240
240
  return self.local_copy_remote(tofile, fromfile, tohost, logact)
241
241
  elif self.pgcmp(thost, self.LHOST, 1) == 0:
@@ -664,6 +664,25 @@ class PgFile(PgUtil, PgSIG):
664
664
  if not endpoint: endpoint = self.PGLOG['BACKUPEP']
665
665
  return self.endpoint_copy_endpoint(tofile, fromfile, endpoint, 'gdex-glade', logact)
666
666
 
667
+ # Copy a local file to Quasar backup tape system and wait until the Globus task is done
668
+ # for callers that cannot handle a self.FINISH return
669
+ def wait_copy_backup(self, tofile, fromfile, endpoint = None, logact = 0):
670
+ """Copy a local GLADE file to the Quasar backup endpoint and wait for completion.
671
+
672
+ Args:
673
+ tofile (str): Destination path on the backup endpoint (leading '/dsNNN.N/').
674
+ fromfile (str): Source local path (leading '/data/' or '/decsdata/').
675
+ endpoint (str | None): Globus endpoint name; defaults to PGLOG['BACKUPEP'].
676
+ logact (int): Logging action flags; default 0.
677
+
678
+ Returns:
679
+ int: self.SUCCESS or self.FAILURE.
680
+ """
681
+ if not endpoint: endpoint = self.PGLOG['BACKUPEP']
682
+ ret = self.local_copy_backup(tofile, fromfile, endpoint, logact)
683
+ if ret == self.FINISH: ret = self.check_globus_finished(tofile, endpoint, logact)
684
+ return ret
685
+
667
686
  # Copy a Quasar backup file to local Globus endpoint
668
687
  # tofile - target file name, leading with /data/ or /decsdata/
669
688
  # fromfile - source file name, leading with /dsnnn.n/
@@ -671,6 +690,9 @@ class PgFile(PgUtil, PgSIG):
671
690
  def backup_copy_local(self, tofile, fromfile, endpoint = None, logact = 0):
672
691
  """Copy a file from the Quasar backup endpoint to a local GLADE path via Globus.
673
692
 
693
+ Waits for the Globus task to finish before returning, so the local file is
694
+ complete for the caller.
695
+
674
696
  Args:
675
697
  tofile (str): Destination local path (leading '/data/' or '/decsdata/').
676
698
  fromfile (str): Source backup path (leading '/dsNNN.N/').
@@ -678,10 +700,12 @@ class PgFile(PgUtil, PgSIG):
678
700
  logact (int): Logging action flags; default 0.
679
701
 
680
702
  Returns:
681
- int: self.SUCCESS, self.FAILURE, or self.FINISH.
703
+ int: self.SUCCESS or self.FAILURE.
682
704
  """
683
705
  if not endpoint: endpoint = self.PGLOG['BACKUPEP']
684
- return self.endpoint_copy_endpoint(tofile, fromfile, 'gdex-glade', endpoint, logact)
706
+ ret = self.endpoint_copy_endpoint(tofile, fromfile, 'gdex-glade', endpoint, logact)
707
+ if ret == self.FINISH: ret = self.check_globus_finished(tofile, 'gdex-glade', logact)
708
+ return ret
685
709
 
686
710
  # Copy a remote file to local
687
711
  # tofile - target file name
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 3.0.9
3
+ Version: 3.0.10
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