rda-python-common 3.0.23__py3-none-any.whl → 3.0.24__py3-none-any.whl

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.
@@ -22,7 +22,7 @@ object that existing callers expect.
22
22
 
23
23
  from . import PgLOG, PgUtil, PgDBI, PgFile, PgLock, PgCMD, PgSIG, PgOPT, PgSplit
24
24
 
25
- __version__ = "3.0.23"
25
+ __version__ = "3.0.24"
26
26
 
27
27
  __all__ = [
28
28
  "PgLOG",
@@ -878,6 +878,11 @@ class PgFile(PgUtil, PgSIG):
878
878
  objects sharing a key prefix. Each object is downloaded individually and
879
879
  keeps its position relative to the prefix under todir.
880
880
 
881
+ A member already staged under todir at the object's size and no older than
882
+ the object itself is left alone, so a store whose download was cut short
883
+ (by a batch walltime, say) resumes where it stopped instead of starting
884
+ over, and a second copy into the same directory costs nothing.
885
+
881
886
  Args:
882
887
  todir (str): Destination local directory path.
883
888
  fromdir (str): Object key prefix (source path in the bucket).
@@ -890,7 +895,9 @@ class PgFile(PgUtil, PgSIG):
890
895
  if not bucket: bucket = self.PGLOG['OBJCTBKT']
891
896
  ms = re.match(r'^(.+)/$', fromdir)
892
897
  if ms: fromdir = ms.group(1)
893
- flist = self.object_glob(fromdir, bucket, 0, logact)
898
+ # opt 1 adds the LastModified the 'lo' listing already carries; it is only
899
+ # bits 2 and 8 that would cost a metadata call per key
900
+ flist = self.object_glob(fromdir, bucket, 1, logact)
894
901
  if flist == self.FAILURE: return self.FAILURE
895
902
  prefix = fromdir + '/'
896
903
  keys = [key for key in flist if key.startswith(prefix)]
@@ -898,8 +905,14 @@ class PgFile(PgUtil, PgSIG):
898
905
  return self.lmsg(fromdir, "{}-{} to copy to {}".format(self.OHOST, self.PGLOG['MISSFILE'], todir), logact)
899
906
  plen = len(prefix)
900
907
  for key in keys:
908
+ oinfo = flist[key]
901
909
  tofile = "{}/{}".format(todir, key[plen:])
902
- if not self.object_get_local(tofile, key, flist[key]['data_size'], bucket, logact): return self.FAILURE
910
+ linfo = self.check_local_file(tofile, 1, logact)
911
+ # an unparsable LastModified leaves date_modified unset; download again then
912
+ if linfo and 'date_modified' in oinfo and linfo['data_size'] == oinfo['data_size'] and \
913
+ self.cmptime(linfo['date_modified'], linfo['time_modified'],
914
+ oinfo['date_modified'], oinfo['time_modified']) >= 0: continue
915
+ if not self.object_get_local(tofile, key, oinfo['data_size'], bucket, logact): return self.FAILURE
903
916
  return self.SUCCESS
904
917
 
905
918
  # Copy a remote file to object
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 3.0.23
3
+ Version: 3.0.24
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
@@ -189,7 +189,7 @@ PgLOG.pglog("hello", PgLOG.LOGWRN)
189
189
  python -c "import rda_python_common; print(rda_python_common.__version__)"
190
190
  ```
191
191
 
192
- You should see the installed version (currently `3.0.23`). If the import
192
+ You should see the installed version (currently `3.0.24`). If the import
193
193
  fails, double-check that the active Python environment is the one where you
194
194
  ran `pip install`.
195
195
 
@@ -7,10 +7,10 @@ rda_python_common/PgOPT.py,sha256=0nQPF19N-1VWwrjFHEeruVSwVDwvFKd4uowPc8dK7e4,56
7
7
  rda_python_common/PgSIG.py,sha256=0MJPH0fTtSshIsvUXkzQjReHPyCWdzHYOY5LbFSh7-A,34318
8
8
  rda_python_common/PgSplit.py,sha256=En7xcdkE4YNRcMX88qXnrUgUOnQU3Kqh8uxRIdlJhEA,9156
9
9
  rda_python_common/PgUtil.py,sha256=7hXAznAI8tYh-nJRKBIXejNe2ROQ2Wxn28OAndeg0Iw,48433
10
- rda_python_common/__init__.py,sha256=0ZmsVtLVT0eP_PN_utNR7xqFsfgJaLbwF5Rqezog2es,995
10
+ rda_python_common/__init__.py,sha256=hn0mszEAFqVd11CUNXtZOrPGjG5VzqQRIiwAzaWLOO0,995
11
11
  rda_python_common/pg_cmd.py,sha256=MYldUuM8mSUIT34yKQyUd0i4NL4zdSB8C6Jcc28NRxA,33809
12
12
  rda_python_common/pg_dbi.py,sha256=h1snZ8fJwHeBQJmNjsjJoDKkfT4FW9avMvdHgcIc-cA,122328
13
- rda_python_common/pg_file.py,sha256=70Hqy2NiiVA4x5Tl8Emzn2_1bZzPTQ1uI0GTOCQgbbY,169783
13
+ rda_python_common/pg_file.py,sha256=_0JpsDfWYTS-55QkpYv-ecyR-ZgEr8kir1NfVLXrir8,170659
14
14
  rda_python_common/pg_lock.py,sha256=31EaVDjCkcx3-n8-KnzG18R8Pz7Z6KyFsEqcml6Iq5c,32702
15
15
  rda_python_common/pg_log.py,sha256=erQN4YYPwiORa3OE0Jt8s05rlWsjtyIs0fJ_KLbNAQ8,82959
16
16
  rda_python_common/pg_opt.py,sha256=LxVAf47wi2STkVGSXMvV3IZphEJcoO8bvYXy6kQ5ox4,82403
@@ -20,9 +20,9 @@ rda_python_common/pg_split.py,sha256=aAWKUZPmZ-LQ_fJ3DSKzPKxJw0fMDJ2fgP8ZT629M30
20
20
  rda_python_common/pg_util.py,sha256=JL9NoW-VoQvsjXsUr09oBUWYJJNltU4GyQIfWlpkf90,86084
21
21
  rda_python_common/pgpassword.py,sha256=aTQaO59QokWrv2EKom4TvKhNW2Mr6aFMMBVG4DCbcKI,5023
22
22
  rda_python_common/pgpassword.usg,sha256=Wrle6A8sdlMGx3ZEAmE6TNDPOlG84Whe0T3rCNFzPfY,2013
23
- rda_python_common-3.0.23.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
24
- rda_python_common-3.0.23.dist-info/METADATA,sha256=XqOpS77KVBESTSX-Lzp-uJ0KSllqKhQVCbyTtm9zPEE,14530
25
- rda_python_common-3.0.23.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
26
- rda_python_common-3.0.23.dist-info/entry_points.txt,sha256=pZgVNWspcK-F1TbPav7C3C9NdeHDZMm_25fW9weix00,65
27
- rda_python_common-3.0.23.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
28
- rda_python_common-3.0.23.dist-info/RECORD,,
23
+ rda_python_common-3.0.24.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
24
+ rda_python_common-3.0.24.dist-info/METADATA,sha256=DyiVDiGacZIGXMzgH3zfUFYZd96yn94GZohxiCPAxYY,14530
25
+ rda_python_common-3.0.24.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
26
+ rda_python_common-3.0.24.dist-info/entry_points.txt,sha256=pZgVNWspcK-F1TbPav7C3C9NdeHDZMm_25fW9weix00,65
27
+ rda_python_common-3.0.24.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
28
+ rda_python_common-3.0.24.dist-info/RECORD,,