rda-python-dsarch 1.0.31__tar.gz → 2.0.0__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 (22) hide show
  1. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/PKG-INFO +1 -1
  2. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/pyproject.toml +5 -9
  3. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/src/rda_python_dsarch/PgArch.py +4 -3
  4. rda_python_dsarch-1.0.31/src/rda_python_dsarch/dsarch.py → rda_python_dsarch-2.0.0/src/rda_python_dsarch/ds_arch.py +58 -52
  5. rda_python_dsarch-2.0.0/src/rda_python_dsarch/dsarch.py +4664 -0
  6. rda_python_dsarch-2.0.0/src/rda_python_dsarch/pg_arch.py +1463 -0
  7. rda_python_dsarch-2.0.0/src/rda_python_dsarch/pg_meta.py +687 -0
  8. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/src/rda_python_dsarch.egg-info/PKG-INFO +1 -1
  9. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/src/rda_python_dsarch.egg-info/SOURCES.txt +3 -0
  10. rda_python_dsarch-2.0.0/tests/test_dsarch.py +10 -0
  11. rda_python_dsarch-1.0.31/tests/test_dsarch.py +0 -6
  12. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/LICENSE +0 -0
  13. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/MANIFEST.in +0 -0
  14. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/README.md +0 -0
  15. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/setup.cfg +0 -0
  16. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/src/rda_python_dsarch/PgMeta.py +0 -0
  17. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/src/rda_python_dsarch/__init__.py +0 -0
  18. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/src/rda_python_dsarch/dsarch.usg +0 -0
  19. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/src/rda_python_dsarch.egg-info/dependency_links.txt +0 -0
  20. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/src/rda_python_dsarch.egg-info/entry_points.txt +0 -0
  21. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/src/rda_python_dsarch.egg-info/requires.txt +0 -0
  22. {rda_python_dsarch-1.0.31 → rda_python_dsarch-2.0.0}/src/rda_python_dsarch.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_dsarch
3
- Version: 1.0.31
3
+ Version: 2.0.0
4
4
  Summary: RDA Python package for utility program dsarch archive RDA data
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-dsarch
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rda_python_dsarch"
7
- version = "1.0.31"
7
+ version = "2.0.0"
8
8
  authors = [
9
9
  { name="Zaihua Ji", email="zji@ucar.edu" },
10
10
  ]
@@ -22,14 +22,10 @@ dependencies = [
22
22
  "rda_python_setuid",
23
23
  ]
24
24
 
25
- [tool.setuptools]
26
- include-package-data = true
27
-
28
- [tool.setuptools.packages.find]
29
- where = ["src"]
30
-
31
- [tool.setuptools.package-data]
32
- "rda_python_dsarch" = ["dsarch.usg"]
25
+ [tool.pytest.ini_options]
26
+ pythonpath = [
27
+ "src"
28
+ ]
33
29
 
34
30
  [project.urls]
35
31
  "Homepage" = "https://github.com/NCAR/rda-python-dsarch"
@@ -490,7 +490,7 @@ def check_enough_options(cact, acts):
490
490
  "Miss Quasar file types per -QT(-QuasarFileType)",
491
491
  "Miss GDEX Server file names per -WF(-WebFile)",
492
492
  "Miss Saved file types per -ST(-SavedFileType)",
493
- "13",
493
+ "Cannot Cross Copy/Move (-XC/-XM) Saved Files",
494
494
  "14",
495
495
  "Miss Use-RDADB flag, ('Y', 'P', 'W', 'I'), per -UD(-UseRDADB) for ",
496
496
  "16",
@@ -556,8 +556,9 @@ def check_enough_options(cact, acts):
556
556
  elif 'ST' not in PgOPT.params:
557
557
  erridx = 12
558
558
  elif 'XC' in PgOPT.params or 'XM' in PgOPT.params:
559
- if 'SF' not in PgOPT.params:
560
- erridx = 17
559
+ erridx = 13
560
+ # if 'SF' not in PgOPT.params:
561
+ # erridx = 17
561
562
  elif 'LF' not in PgOPT.params:
562
563
  erridx = 5
563
564
  elif 'DF' not in PgOPT.params:
@@ -31,7 +31,6 @@ from . import PgArch
31
31
 
32
32
  ERRCNT = RETSTAT = ALLCNT = ADDCNT = MODCNT = OVRRIDE = 0
33
33
  TARFILES = {}
34
- DSACTIONS = {}
35
34
  VINDEX = {}
36
35
  CHGGRPS = {}
37
36
  ERRMSG = ''
@@ -340,7 +339,7 @@ def archive_web_files():
340
339
  tname = 'wfile'
341
340
  dftloc = None
342
341
  dsid = PgOPT.params['DS']
343
- bucket = "rda-data" # default object store bucket
342
+ bucket = PgLOG.PGLOG['OBJCTBKT'] # default object store bucket
344
343
  s = 's' if ALLCNT > 1 else ''
345
344
  bidx = chksize = 0
346
345
  dslocflags = set()
@@ -577,7 +576,7 @@ def archive_help_files():
577
576
  global ADDCNT, MODCNT, RETSTAT
578
577
  tname = 'hfile'
579
578
  dsid = PgOPT.params['DS']
580
- bucket = 'rda-data'
579
+ bucket = PgLOG.PGLOG['OBJCTBKT']
581
580
  dcnd = "dsid = '{}'".format(dsid)
582
581
  s = 's' if ALLCNT > 1 else ''
583
582
  bidx = chksize = 0
@@ -789,7 +788,7 @@ def archive_saved_files():
789
788
  s = 's' if ALLCNT > 1 else ''
790
789
  bidx = chksize = 0
791
790
  dflags = {}
792
- bucket = "rda-decsdata" # object store bucket
791
+ bucket = "gdex-decsdata" # object store bucket
793
792
  PgLOG.pglog("Archive {} Saved file{} of {} ...".format(ALLCNT, s, dsid), PgLOG.WARNLG)
794
793
 
795
794
  if 'ZD' in PgOPT.params or 'UZ' in PgOPT.params:
@@ -862,6 +861,7 @@ def archive_saved_files():
862
861
  else:
863
862
  oarch = 0
864
863
  sarch = 1
864
+ if oarch: PgLOG.pglog(lfile + ": Cannot Archive Saved File onto Boreas", PgOPT.PGOPT['extlog'])
865
865
  if not PgOPT.params['MC'][i]: PgOPT.params['MC'][i] = PgFile.get_md5sum(lfile) # re-get MD5 Checksum
866
866
  if not (PgOPT.params['SZ'][i] and PgOPT.params['SZ'][i] == lsize):
867
867
  PgOPT.params['SZ'][i] = lsize
@@ -1012,7 +1012,7 @@ def crosscopy_web_files(aname):
1012
1012
  s = 's' if ALLCNT > 1 else ''
1013
1013
  bidx = chksize = 0
1014
1014
  dflags = {}
1015
- bucket = "rda-data" # object store bucket
1015
+ bucket = PgLOG.PGLOG['OBJCTBKT'] # object store bucket
1016
1016
  PgLOG.pglog("Cross {} {} Web file{} of {} ...".format(aname, ALLCNT, s, dsid), PgLOG.WARNLG)
1017
1017
 
1018
1018
  PgOPT.validate_multiple_values(tname, ALLCNT)
@@ -1174,7 +1174,7 @@ def crosscopy_help_files(aname):
1174
1174
  s = 's' if ALLCNT > 1 else ''
1175
1175
  bidx = chksize = 0
1176
1176
  dflags = {}
1177
- bucket = "rda-data"
1177
+ bucket = PgLOG.PGLOG['OBJCTBKT']
1178
1178
  PgLOG.pglog("Cross {} {} Help file{} of {} ...".format(aname, ALLCNT, s, dsid), PgLOG.WARNLG)
1179
1179
 
1180
1180
  PgOPT.validate_multiple_values(tname, ALLCNT)
@@ -1333,7 +1333,7 @@ def crosscopy_saved_files(aname):
1333
1333
  s = 's' if ALLCNT > 1 else ''
1334
1334
  bidx = chksize = 0
1335
1335
  dflags = {}
1336
- bucket = "rda-decsdata"
1336
+ bucket = "gdex-decsdata"
1337
1337
  PgLOG.pglog("Cross {} {} Saved file{} of {} ...".format(aname, ALLCNT, s, dsid), PgLOG.WARNLG)
1338
1338
 
1339
1339
  PgOPT.validate_multiple_values(tname, ALLCNT)
@@ -1668,7 +1668,7 @@ def tar_backup_savedfiles(tarfile, tinfo, ccnt, chkstat):
1668
1668
  tardir = tarhome
1669
1669
  savedfile = "{}/{}".format(tardir, sfile)
1670
1670
  ofile = PgLOG.join_paths(dsid, sfile)
1671
- PgFile.object_copy_local(savedfile, ofile, 'rda-decsdata', PgOPT.PGOPT['wrnlog'])
1671
+ PgFile.object_copy_local(savedfile, ofile, 'gdex-decsdata', PgOPT.PGOPT['wrnlog'])
1672
1672
  tmpfiles[i] = savedfile
1673
1673
  else:
1674
1674
  tardir = "{}/{}".format(dshome, stype)
@@ -1756,7 +1756,7 @@ def tar_backup_webfiles(tarfile, tinfo, ccnt, chkstat):
1756
1756
  tardir = tarhome
1757
1757
  webfile = "{}/{}".format(tardir, wfile)
1758
1758
  ofile = PgLOG.join_paths(dsid, wfile)
1759
- PgFile.object_copy_local(webfile, ofile, 'rda-data', PgOPT.PGOPT['wrnlog'])
1759
+ PgFile.object_copy_local(webfile, ofile, PgLOG.PGLOG['OBJCTBKT'], PgOPT.PGOPT['wrnlog'])
1760
1760
  tmpfiles[i] = webfile
1761
1761
  else:
1762
1762
  tardir = dshome
@@ -1864,7 +1864,7 @@ def restore_backup_webfiles():
1864
1864
 
1865
1865
  tname = 'wfile'
1866
1866
  dsid = PgOPT.params['DS']
1867
- bucket = "rda-data" # default object store bucket
1867
+ bucket = PgLOG.PGLOG['OBJCTBKT'] # default object store bucket
1868
1868
  s = 's' if ALLCNT > 1 else ''
1869
1869
  wcnt = ocnt = bidx = chksize = 0
1870
1870
  dflags = {}
@@ -1968,7 +1968,7 @@ def restore_backup_savedfiles():
1968
1968
  tname = 'sfile'
1969
1969
  dsid = PgOPT.params['DS']
1970
1970
  dcnd = "dsid = '{}'".format(dsid)
1971
- bucket = "rda-decsdata" # default object store bucket
1971
+ bucket = "gdex-decsdata" # default object store bucket
1972
1972
  s = 's' if ALLCNT > 1 else ''
1973
1973
  scnt = ocnt = bidx = chksize = 0
1974
1974
  dflags = {}
@@ -2797,7 +2797,7 @@ def set_webfile_info(include = None):
2797
2797
  if pgrec and pgrec['type'] and deftype and type != pgrec['type']: type = pgrec['type']
2798
2798
  info = None
2799
2799
  if locflag == 'O' and not pgrec:
2800
- info = PgFile.check_object_file(PgLOG.join_paths(dsid, file), 'rda-data', 1, PgOPT.PGOPT['emlerr'])
2800
+ info = PgFile.check_object_file(PgLOG.join_paths(dsid, file), PgLOG.PGLOG['OBJCTBKT'], 1, PgOPT.PGOPT['emlerr'])
2801
2801
  wid = set_one_webfile(i, pgrec, file, fnames, type, info)
2802
2802
  if not wid: continue
2803
2803
  wfile = PgArch.get_web_path(i, PgOPT.params['WF'][i], 0, type)
@@ -3157,7 +3157,7 @@ def set_savedfile_info():
3157
3157
  if pgrec and PgOPT.params['SF'][i] != file: PgOPT.params['SF'][i] = file
3158
3158
  info = None
3159
3159
  if locflag == 'O' and not pgrec:
3160
- info = PgFile.check_object_file(PgLOG.join_paths(dsid, file), 'rda-decsdata', 1, PgOPT.PGOPT['emlerr'])
3160
+ info = PgFile.check_object_file(PgLOG.join_paths(dsid, file), 'gdex-decsdata', 1, PgOPT.PGOPT['emlerr'])
3161
3161
  set_one_savedfile(i, pgrec, file, fnames, type, info)
3162
3162
 
3163
3163
  PgLOG.pglog("{}/{} of {} Saved file record{} added/modified for {}!".format(ADDCNT, MODCNT, ALLCNT, s, dsid), PgOPT.PGOPT['emllog'])
@@ -3378,7 +3378,7 @@ def move_web_files():
3378
3378
  dcnd = "dsid = '{}'".format(dsid)
3379
3379
  tmpds = tmpgs = None
3380
3380
  bidx = chksize = 0
3381
- bucket = "rda-data"
3381
+ bucket = PgLOG.PGLOG['OBJCTBKT']
3382
3382
  rcnt = len(PgLOG.PGLOG['WEBHOSTS'])
3383
3383
  s = 's' if ALLCNT > 1 else ''
3384
3384
 
@@ -3493,7 +3493,7 @@ def move_web_files():
3493
3493
  set_web_move(pgrec)
3494
3494
 
3495
3495
  if omove and oolds[i] != onews[i]:
3496
- if not PgFile.move_object_file(onews[i], oolds[i], bucket, bucket, PgOPT.PGOPT['emerol']|OVERRIDE):
3496
+ if not PgFile.move_object_file(onews[i], oolds[i], bucket, bucket, PgOPT.PGOPT['emerol']|OVERRIDE):
3497
3497
  RETSTAT = 1
3498
3498
  continue
3499
3499
  if PgLOG.PGLOG['DSCHECK']: chksize += pgrec['data_size']
@@ -3533,7 +3533,7 @@ def move_help_files():
3533
3533
  dcnd = "dsid = '{}'".format(dsid)
3534
3534
  tmpds = None
3535
3535
  bidx = chksize = 0
3536
- bucket = "rda-data"
3536
+ bucket = PgLOG.PGLOG['OBJCTBKT']
3537
3537
  rcnt = len(PgLOG.PGLOG['WEBHOSTS'])
3538
3538
  s = 's' if ALLCNT > 1 else ''
3539
3539
 
@@ -3647,8 +3647,8 @@ def saved_to_web_files():
3647
3647
  tname = 'wfile'
3648
3648
  dsid = PgOPT.params['DS']
3649
3649
  dcnd = "dsid = '{}'".format(dsid)
3650
- frombucket = "rda-decsdata"
3651
- tobucket = "rda-data"
3650
+ frombucket = "gdex-decsdata"
3651
+ tobucket = PgLOG.PGLOG['OBJCTBKT']
3652
3652
  s = 's' if ALLCNT > 1 else ''
3653
3653
  bidx = chksize = 0
3654
3654
  dslocflags = set()
@@ -3754,12 +3754,14 @@ def saved_to_web_files():
3754
3754
  not PgDBI.pgget("dsgroup", "", "{} and gindex = {}".format(dcnd, pgrec['gindex']), PgOPT.PGOPT['extlog'])):
3755
3755
  PgLOG.pglog("Group Index {} is not in RDADB for {}\n".format(pgrec['gindex'], dsid) +
3756
3756
  "Specify Original/New group index via options -OG/-GI", PgOPT.PGOPT['extlog'])
3757
- ofrom = sfrom = omove = wmove = 1
3758
- locflag = pgrec['locflag']
3759
- if locflag == 'O':
3760
- sfrom = 0
3761
- elif locflag == 'G':
3762
- ofrom = 0
3757
+ sfrom = omove = wmove = 1
3758
+ ofrom = 0
3759
+ locflag = 'G'
3760
+ # locflag = pgrec['locflag']
3761
+ # if locflag == 'O':
3762
+ # sfrom = 0
3763
+ # elif locflag == 'G':
3764
+ # ofrom = 0
3763
3765
  if not PgOPT.params['LC'][i] or PgOPT.params['LC'][i] == 'R':
3764
3766
  PgOPT.params['LC'][i] = locflag
3765
3767
  else:
@@ -3835,7 +3837,7 @@ def delete_web_files():
3835
3837
 
3836
3838
  tname = 'wfile'
3837
3839
  dsid = PgOPT.params['DS']
3838
- bucket = "rda-data"
3840
+ bucket = PgLOG.PGLOG['OBJCTBKT']
3839
3841
  s = 's' if ALLCNT > 1 else ''
3840
3842
  bidx = chksize = 0
3841
3843
  rcnt = len(PgLOG.PGLOG['WEBHOSTS'])
@@ -3948,7 +3950,7 @@ def delete_help_files():
3948
3950
 
3949
3951
  tname = 'hfile'
3950
3952
  dsid = PgOPT.params['DS']
3951
- bucket = "rda-data"
3953
+ bucket = PgLOG.PGLOG['OBJCTBKT']
3952
3954
  dcnd = "dsid = '{}'".format(dsid)
3953
3955
  s = 's' if ALLCNT > 1 else ''
3954
3956
  bidx = chksize = 0
@@ -4044,7 +4046,7 @@ def move_saved_files():
4044
4046
  tname = 'sfile'
4045
4047
  dsid = PgOPT.params['DS']
4046
4048
  dcnd = "dsid = '{}'".format(dsid)
4047
- bucket = "rda-decsdata"
4049
+ bucket = "gdex-decsdata"
4048
4050
  s = 's' if ALLCNT > 1 else ''
4049
4051
  bidx = chksize = 0
4050
4052
 
@@ -4140,11 +4142,12 @@ def move_saved_files():
4140
4142
  not PgDBI.pgget("dsgroup", "", "{} and gindex = {}".format(dcnd, pgrec['gindex']), PgOPT.PGOPT['extlog'])):
4141
4143
  PgLOG.pglog("Group Index {} is not in RDADB for {}\n".format(pgrec['gindex'], dsid) +
4142
4144
  "Specify Original/New group index via options -OG/-GI", PgOPT.PGOPT['extlog'])
4143
- omove = smove = 1
4144
- if pgrec['locflag'] == 'O':
4145
- smove = 0
4146
- elif pgrec['locflag'] == 'G':
4147
- omove = 0
4145
+ omove = 0
4146
+ smove = 1
4147
+ # if pgrec['locflag'] == 'O':
4148
+ # smove = 0
4149
+ # elif pgrec['locflag'] == 'G':
4150
+ # omove = 0
4148
4151
  if smove and aolds[i] != anews[i]:
4149
4152
  if not PgFile.move_local_file(anews[i], aolds[i], PgOPT.PGOPT['emerol']|OVERRIDE):
4150
4153
  RETSTAT = 1
@@ -4287,8 +4290,8 @@ def web_to_saved_files():
4287
4290
  tname = 'sfile'
4288
4291
  dsid = PgOPT.params['DS']
4289
4292
  dcnd = "dsid = '{}'".format(dsid)
4290
- frombucket = "rda-data"
4291
- tobucket = "rda-decsdata"
4293
+ frombucket = PgLOG.PGLOG['OBJCTBKT']
4294
+ tobucket = "gdex-decsdata"
4292
4295
  bidx = chksize = 0
4293
4296
 
4294
4297
  tmpds = tmpgs = None
@@ -4394,20 +4397,21 @@ def web_to_saved_files():
4394
4397
  not PgDBI.pgget("dsgroup", "", "{} and gindex = {}".format(dcnd, pgrec['gindex']), PgOPT.PGOPT['extlog'])):
4395
4398
  PgLOG.pglog("Group Index {} is not in RDADB for {}\n".format(pgrec['gindex'], dsid) +
4396
4399
  "Specify Original/New group index via options -OG/-GI", PgOPT.PGOPT['extlog'])
4397
- ofrom = wfrom = omove = smove = 1
4400
+ ofrom = wfrom = smove = 1
4401
+ omove = 0
4398
4402
  locflag = pgrec['locflag']
4399
4403
  if locflag == 'O':
4400
4404
  wfrom = 0
4401
4405
  elif locflag == 'G':
4402
4406
  ofrom = 0
4403
- if not PgOPT.params['LC'][i] or PgOPT.params['LC'][i] == 'R':
4404
- PgOPT.params['LC'][i] = locflag
4405
- else:
4406
- locflag = PgOPT.params['LC'][i]
4407
- if locflag == 'O':
4408
- smove = 0
4409
- elif locflag == 'G':
4410
- omove = 0
4407
+ # if not PgOPT.params['LC'][i] or PgOPT.params['LC'][i] == 'R':
4408
+ # PgOPT.params['LC'][i] = locflag
4409
+ # else:
4410
+ # locflag = PgOPT.params['LC'][i]
4411
+ # if locflag == 'O':
4412
+ # smove = 0
4413
+ # elif locflag == 'G':
4414
+ # omove = 0
4411
4415
  if smove:
4412
4416
  if wfrom:
4413
4417
  stat = PgFile.move_local_file(anews[i], aolds[i], PgOPT.PGOPT['emerol']|OVERRIDE)
@@ -4487,7 +4491,7 @@ def delete_saved_files():
4487
4491
  tname = 'sfile'
4488
4492
  dsid = PgOPT.params['DS']
4489
4493
  dcnd = "dsid = '{}'".format(dsid)
4490
- bucket = "rda-decsdata"
4494
+ bucket = "gdex-decsdata"
4491
4495
  s = 's' if ALLCNT > 1 else ''
4492
4496
  PgLOG.pglog("Delete {} Saved file{} from {} ...".format(ALLCNT, s, dsid), PgLOG.WARNLG)
4493
4497
 
@@ -4522,14 +4526,16 @@ def delete_saved_files():
4522
4526
  PgLOG.pglog("{}-{}: Type '{}' Saved file is not in RDADB".format(dsid, sfile, type), PgOPT.PGOPT['errlog'])
4523
4527
  continue
4524
4528
 
4525
- odel = sdel = oflag = sflag = 1
4526
- locflag = pgrec['locflag']
4527
- if locflag == 'O':
4528
- sflag = 0
4529
- elif locflag == 'G':
4530
- oflag = 0
4531
- elif locflag == 'C':
4532
- sflag = oflag = 0
4529
+ sdel = oflag = sflag = 1
4530
+ odel = 0
4531
+ locflag = 'G'
4532
+ # locflag = pgrec['locflag']
4533
+ # if locflag == 'O':
4534
+ # sflag = 0
4535
+ # elif locflag == 'G':
4536
+ # oflag = 0
4537
+ # elif locflag == 'C':
4538
+ # sflag = oflag = 0
4533
4539
  if 'LC' in PgOPT.params and PgOPT.params['LC'][i]: locflag = PgOPT.params['LC'][i]
4534
4540
  if locflag == 'O':
4535
4541
  sdel = 0