rda-python-dsarch 3.0.3__py3-none-any.whl → 3.0.6__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.
@@ -131,7 +131,6 @@ PgOPT.OPTS = { # (!= 0) - setting actions
131
131
  'ON' : [1, 'OrderNames', 0],
132
132
  'PO' : [1, 'PatternOffset', 16],
133
133
  'QS' : [1, 'QsubOptions', 1],
134
- 'UD' : [1, 'UseDSARCH', 0, 'YNIPW'], # Internal, Public, Web only, Y - ready for dsarch
135
134
  'VS' : [1, 'ValidSize', 17], # default to PgLOG.PGLOG['MINSIZE']
136
135
  'WI' : [1, 'WaitInternval', 1],
137
136
 
@@ -176,7 +175,7 @@ PgOPT.OPTS = { # (!= 0) - setting actions
176
175
  'OG' : [2, 'OriginGroup', 1],
177
176
  'OT' : [2, 'OriginType', 1],
178
177
  'PI' : [2, 'ParentIndex', 17],
179
- 'QF' : [2, 'QuasarFile', 0],
178
+ 'QF' : [2, 'QuasarFile', 0, ''],
180
179
  'QT' : [2, 'QuasarFileType', 129, 'BD'],
181
180
  'RF' : [2, 'OriginFile', 0],
182
181
  'SF' : [2, 'SavedFile', 0],
@@ -257,7 +256,6 @@ PgOPT.ALIAS = {
257
256
  'TS' : ['ToSavedFile', 'MovedToSaved'],
258
257
  'TW' : ['ToWebFile', 'MovedToWeb'],
259
258
  'UC' : ['UpdateCacheNumber'],
260
- 'UD' : ['UseRDADB'],
261
259
  'HD' : ['UpdateHTML', 'GenerateHTML'],
262
260
  'UZ' : ['Uncompress', 'UncompressData', 'Unzip'],
263
261
  'WC' : ['ValidateChecksum', "WithMD5", "ValidateMD5"],
@@ -281,7 +279,6 @@ PgOPT.TBLHASH['dataset'] = { # condition flag, 0-int, 1-string, -1-exclu
281
279
  'H' : ['WH', "webhome", 1],
282
280
  'W' : ['WP', "webpath", 1],
283
281
  'F' : ['DF', "data_format", 1],
284
- 'U' : ['UD', "use_rdadb", 1],
285
282
  'L' : ['LC', "locflag", 1],
286
283
  'Q' : ['BF', "backflag", 1],
287
284
  'A' : ['DA', "accessflag", 1],
@@ -412,7 +409,7 @@ PgOPT.TBLHASH['dsvrsn'] = {
412
409
  # global info to be used by the whole application
413
410
  PgOPT.PGOPT['MSET'] = "SA"
414
411
  #default fields for getting info
415
- PgOPT.PGOPT['dataset'] = "SWFULQA"
412
+ PgOPT.PGOPT['dataset'] = "SWFLQA"
416
413
  PgOPT.PGOPT['dsperiod'] = "GJKXY"
417
414
  PgOPT.PGOPT['dsgroup'] = "IGXTPQASW"
418
415
  PgOPT.PGOPT['wfile'] = "FTIVMNLHPS"
@@ -420,10 +417,9 @@ PgOPT.PGOPT['sfile'] = "FTIVMNLHPS"
420
417
  PgOPT.PGOPT['bfile'] = "FNMTHS"
421
418
  PgOPT.PGOPT['hfile'] = 'FMNLTHPSU'
422
419
  PgOPT.PGOPT['dsvrsn'] = "VIEDSJX"
423
- PgOPT.PGOPT['UACTS'] = (PgOPT.OPTS['AQ'][0]|PgOPT.OPTS['SD'][0]|PgOPT.OPTS['DL'][0])
424
420
 
425
421
  #all fields for getting info
426
- PgOPT.PGOPT['dsall'] = "TSHWFULQAVCBMPIDNGJKXYIJKXY" # include 'pdall'
422
+ PgOPT.PGOPT['dsall'] = "TSHWFLQAVCBMPIDNGJKXYIJKXY" # include 'pdall'
427
423
  PgOPT.PGOPT['pdall'] = "GJKXY"
428
424
  PgOPT.PGOPT['gpall'] = "IGXTRQAPSWMDN"
429
425
  PgOPT.PGOPT['wfall'] = "FTCIXVMNOBQLHPSJKAED"
@@ -492,7 +488,7 @@ def check_enough_options(cact, acts):
492
488
  "Miss Saved file types per -ST(-SavedFileType)",
493
489
  "Cannot Cross Copy/Move (-XC/-XM) Saved Files",
494
490
  "14",
495
- "Miss Use-RDADB flag, ('Y', 'P', 'W', 'I'), per -UD(-UseRDADB) for ",
491
+ "15",
496
492
  "16",
497
493
  "miss Saved file names per -SF(-SavedFile)",
498
494
  "Miss Version Control Index per -VI(-VersionIndex)",
@@ -675,14 +671,8 @@ def check_enough_options(cact, acts):
675
671
  elif acts == PgOPT.OPTS['UC'][0] or acts == PgOPT.OPTS['UW'][0]:
676
672
  if 'DS' not in PgOPT.params: erridx = 4
677
673
 
678
- if erridx < 0:
679
- if(PgOPT.OPTS[cact][2] > 0 and acts&PgOPT.PGOPT['UACTS'] == 0 and
680
- PgDBI.use_rdadb(PgOPT.params['DS'], PgOPT.PGOPT['extlog']) == 'N' and
681
- ('UD' not in PgOPT.params or PgOPT.params['UD'] == 'N')):
682
- erridx = 15
683
- errmsg[erridx] += PgOPT.params['DS']
684
-
685
674
  if erridx >= 0: PgOPT.action_error(errmsg[erridx], cact)
675
+ PgOPT.validate_dataset() # error out if the dataset does not exist in RDADB
686
676
 
687
677
  PgOPT.set_uid("dsarch") # set uid before any action
688
678
  if 'VS' in PgOPT.params: PgLOG.PGLOG['MINSIZE'] = PgOPT.params['VS'] # minimal size for a file to be valid for archive
@@ -20,7 +20,7 @@ object that existing callers expect.
20
20
 
21
21
  from . import PgArch, PgMeta
22
22
 
23
- __version__ = "2.0.21"
23
+ __version__ = "2.0.22"
24
24
 
25
25
  __all__ = [
26
26
  "PgArch",
@@ -2264,37 +2264,26 @@ def set_dataset_info(include = None):
2264
2264
  dcnd = "dsid = '{}'".format(dsid)
2265
2265
  PgLOG.pglog("Set {} info of {} ...".format(tname, dsid), PgLOG.WARNLG)
2266
2266
 
2267
- mcnt = acnt = pcnt = kcnt = 0
2267
+ mcnt = pcnt = kcnt = 0
2268
2268
  fnames = PgOPT.get_field_keys(tname, include)
2269
- if fnames: # set dataset record
2269
+ if fnames: # set dataset record; new datasets are created via the Metadata Manager, not dsarch
2270
2270
  pgrec = PgDBI.pgget(tname, PgOPT.get_string_fields(fnames, tname), dcnd, PgLOG.LGEREX)
2271
2271
  record = PgOPT.build_record(fnames, pgrec, tname, 0)
2272
- if record:
2272
+ if record and pgrec:
2273
2273
  if 'backflag' in record and record['backflag'] == 'P': record['backflag'] = 'N'
2274
2274
  if 'locflag' in record and record['locflag'] in 'BR': record['locflag'] = 'G'
2275
- if pgrec:
2276
- record['date_change'] = PgUtil.curdate()
2277
- if PgDBI.pgupdt(tname, record, dcnd, PgLOG.LGEREX):
2278
- mcnt += 1
2279
- if 'use_rdadb' in record and re.search(r'^[PYW]$', record['use_rdadb']):
2280
- PgOPT.params['WN'] = 6
2281
- else:
2282
- record['dsid'] = dsid
2283
- record['date_change'] = record['date_create'] = PgUtil.curdate()
2284
- if not record['use_rdadb']: record['use_rdadb'] = 'Y'
2285
- acnt += PgDBI.pgadd(tname, record, PgLOG.LGEREX)
2275
+ record['date_change'] = PgUtil.curdate()
2276
+ if PgDBI.pgupdt(tname, record, dcnd, PgLOG.LGEREX):
2277
+ mcnt += 1
2286
2278
 
2287
- if acnt == 0: pcnt = set_period_info(dcnd) # set dsperiod record
2279
+ pcnt = set_period_info(dcnd) # set dsperiod record
2288
2280
  kvalues = PgOPT.params['KV'] if 'KV' in PgOPT.params else []
2289
2281
  kcnt = set_keyvalues(dsid, kvalues)
2290
2282
 
2291
- if (pcnt + kcnt + mcnt + acnt) == 0:
2292
- if not include: PgLOG.pglog("No change of dataset record for {}!".format(dsid), PgLOG.LOGWRN)
2283
+ if (pcnt + kcnt + mcnt) == 0:
2284
+ if not include: PgLOG.pglog("No change of dataset record for {}!".format(dsid), PgLOG.LOGWRN)
2293
2285
  else:
2294
- if acnt:
2295
- PgLOG.pglog("Dataset record added for {}!".format(dsid), PgLOG.LOGWRN)
2296
- else:
2297
- PgLOG.pglog("Dataset record modified for {}!".format(dsid), PgLOG.LOGWRN)
2286
+ PgLOG.pglog("Dataset record modified for {}!".format(dsid), PgLOG.LOGWRN)
2298
2287
  if pcnt + mcnt:
2299
2288
  PgDBI.reset_rdadb_version(dsid)
2300
2289
 
@@ -3846,6 +3835,7 @@ def delete_web_files():
3846
3835
  reorder = metatotal = metacnt = dcnt = mcnt = ocnt = wcnt = 0
3847
3836
  PgArch.cache_group_info(ALLCNT, 0)
3848
3837
  PgOPT.validate_multiple_options(ALLCNT, ["WT", 'VI', 'QF', 'LC'])
3838
+ if 'QF' in PgOPT.params: PgOPT.params['QF'] = PgArch.get_bid_numbers(PgOPT.params['QF'])
3849
3839
 
3850
3840
  if PgLOG.PGLOG['DSCHECK']:
3851
3841
  bidx = PgCMD.set_dscheck_fcount(ALLCNT, PgOPT.PGOPT['extlog'])
@@ -3898,7 +3888,7 @@ def delete_web_files():
3898
3888
  continue
3899
3889
  bid = PgOPT.params['QF'][i] if 'QF' in PgOPT.params else pgrec['bid']
3900
3890
  if bid:
3901
- PgLOG.pglog(wfile + ": Web file is Quasar backed up, add option -qf '' to force delete", PgOPT.PGOPT['errlog'])
3891
+ PgLOG.pglog(wfile + ": Web file is Quasar backed up, add option -qf 0 to force delete", PgOPT.PGOPT['errlog'])
3902
3892
  continue
3903
3893
  if PgOPT.PGOPT['GXTYP'].find(type) > -1 and ('DX' in PgOPT.params or pgrec and pgrec['meta_link'] and pgrec['meta_link'] != 'N'):
3904
3894
  metacnt += PgMeta.record_meta_delete('W', dsid, wfile)
@@ -4498,6 +4488,7 @@ def delete_saved_files():
4498
4488
  bidx = chksize = reorder = scnt = ocnt = dcnt = 0
4499
4489
  PgArch.cache_group_info(ALLCNT, 0)
4500
4490
  PgOPT.validate_multiple_options(ALLCNT, ["ST", 'VI', 'QF', 'LC'])
4491
+ if 'QF' in PgOPT.params: PgOPT.params['QF'] = PgArch.get_bid_numbers(PgOPT.params['QF'])
4501
4492
 
4502
4493
  if PgLOG.PGLOG['DSCHECK']:
4503
4494
  bidx = PgCMD.set_dscheck_fcount(ALLCNT, PgOPT.PGOPT['extlog'])
@@ -4550,7 +4541,7 @@ def delete_saved_files():
4550
4541
  continue
4551
4542
  bid = PgOPT.params['QF'][i] if 'QF' in PgOPT.params else pgrec['bid']
4552
4543
  if bid:
4553
- PgLOG.pglog(sfile + ": Saved file is Quasar backed up, add option -qf '' to force delete", PgOPT.PGOPT['errlog'])
4544
+ PgLOG.pglog(sfile + ": Saved file is Quasar backed up, add option -qf 0 to force delete", PgOPT.PGOPT['errlog'])
4554
4545
  continue
4555
4546
 
4556
4547
  if sdel:
@@ -2058,11 +2058,12 @@ class DsArch(PgArch, PgMeta):
2058
2058
 
2059
2059
  def set_dataset_info(self, include=None):
2060
2060
  """
2061
- Insert or update the dataset record in RDADB.
2061
+ Update an existing dataset record in RDADB.
2062
2062
 
2063
- Reads dataset fields from params, builds an update/insert record, and
2064
- calls the appropriate database function. When *include* is 'P', only
2065
- period-related fields are updated.
2063
+ Reads dataset fields from params, builds an update record, and updates
2064
+ the existing dataset record. New datasets are created via the Metadata
2065
+ Manager, not dsarch, so a missing dataset record is left unchanged.
2066
+ When *include* is 'P', only period-related fields are updated.
2066
2067
 
2067
2068
  Args:
2068
2069
  include -- field subset selector string, or None for all fields
@@ -2071,35 +2072,24 @@ class DsArch(PgArch, PgMeta):
2071
2072
  dsid = self.params['DS']
2072
2073
  dcnd = "dsid = '{}'".format(dsid)
2073
2074
  self.pglog("Set {} info of {} ...".format(tname, dsid), self.WARNLG)
2074
- mcnt = acnt = pcnt = kcnt = 0
2075
+ mcnt = pcnt = kcnt = 0
2075
2076
  fnames = self.get_field_keys(tname, include)
2076
- if fnames: # set dataset record
2077
+ if fnames: # set dataset record; new datasets are created via the Metadata Manager, not dsarch
2077
2078
  pgrec = self.pgget(tname, self.get_string_fields(fnames, tname), dcnd, self.LGEREX)
2078
2079
  record = self.build_record(fnames, pgrec, tname, 0)
2079
- if record:
2080
+ if record and pgrec:
2080
2081
  if 'backflag' in record and record['backflag'] == 'P': record['backflag'] = 'N'
2081
2082
  if 'locflag' in record and record['locflag'] in 'BR': record['locflag'] = 'G'
2082
- if pgrec:
2083
- record['date_change'] = self.curdate()
2084
- if self.pgupdt(tname, record, dcnd, self.LGEREX):
2085
- mcnt += 1
2086
- if 'use_rdadb' in record and re.search(r'^[PYW]$', record['use_rdadb']):
2087
- self.params['WN'] = 6
2088
- else:
2089
- record['dsid'] = dsid
2090
- record['date_change'] = record['date_create'] = self.curdate()
2091
- if not record['use_rdadb']: record['use_rdadb'] = 'Y'
2092
- acnt += self.pgadd(tname, record, self.LGEREX)
2093
- if acnt == 0: pcnt = self.set_period_info(dcnd) # set dsperiod record
2083
+ record['date_change'] = self.curdate()
2084
+ if self.pgupdt(tname, record, dcnd, self.LGEREX):
2085
+ mcnt += 1
2086
+ pcnt = self.set_period_info(dcnd) # set dsperiod record
2094
2087
  kvalues = self.params['KV'] if 'KV' in self.params else []
2095
2088
  kcnt = self.set_keyvalues(dsid, kvalues)
2096
- if (pcnt + kcnt + mcnt + acnt) == 0:
2089
+ if (pcnt + kcnt + mcnt) == 0:
2097
2090
  if not include: self.pglog("No change of dataset record for {}!".format(dsid), self.LOGWRN)
2098
2091
  else:
2099
- if acnt:
2100
- self.pglog("Dataset record added for {}!".format(dsid), self.LOGWRN)
2101
- else:
2102
- self.pglog("Dataset record modified for {}!".format(dsid), self.LOGWRN)
2092
+ self.pglog("Dataset record modified for {}!".format(dsid), self.LOGWRN)
2103
2093
  if pcnt + mcnt:
2104
2094
  self.reset_rdadb_version(dsid)
2105
2095
 
@@ -3634,6 +3624,7 @@ class DsArch(PgArch, PgMeta):
3634
3624
  reorder = metatotal = metacnt = dcnt = mcnt = ocnt = wcnt = 0
3635
3625
  self.cache_group_info(self.ALLCNT, 0)
3636
3626
  self.validate_multiple_options(self.ALLCNT, ["WT", 'VI', 'QF', 'LC'])
3627
+ if 'QF' in self.params: self.params['QF'] = self.get_bid_numbers(self.params['QF'])
3637
3628
  if self.PGLOG['DSCHECK']:
3638
3629
  bidx = self.set_dscheck_fcount(self.ALLCNT, self.PGOPT['extlog'])
3639
3630
  if bidx > 0:
@@ -3681,7 +3672,7 @@ class DsArch(PgArch, PgMeta):
3681
3672
  continue
3682
3673
  bid = self.params['QF'][i] if 'QF' in self.params else pgrec['bid']
3683
3674
  if bid:
3684
- self.pglog(wfile + ": Web file is Quasar backed up, add option -qf '' to force delete", self.PGOPT['errlog'])
3675
+ self.pglog(wfile + ": Web file is Quasar backed up, add option -qf 0 to force delete", self.PGOPT['errlog'])
3685
3676
  continue
3686
3677
  if self.PGOPT['GXTYP'].find(type) > -1 and ('DX' in self.params or pgrec and pgrec['meta_link'] and pgrec['meta_link'] != 'N'):
3687
3678
  metacnt += self.record_meta_delete('W', dsid, wfile)
@@ -4224,6 +4215,7 @@ class DsArch(PgArch, PgMeta):
4224
4215
  bidx = chksize = reorder = scnt = dcnt = 0
4225
4216
  self.cache_group_info(self.ALLCNT, 0)
4226
4217
  self.validate_multiple_options(self.ALLCNT, ["ST", 'VI', 'QF', 'LC'])
4218
+ if 'QF' in self.params: self.params['QF'] = self.get_bid_numbers(self.params['QF'])
4227
4219
  if self.PGLOG['DSCHECK']:
4228
4220
  bidx = self.set_dscheck_fcount(self.ALLCNT, self.PGOPT['extlog'])
4229
4221
  if bidx > 0:
@@ -4260,7 +4252,7 @@ class DsArch(PgArch, PgMeta):
4260
4252
  continue
4261
4253
  bid = self.params['QF'][i] if 'QF' in self.params else pgrec['bid']
4262
4254
  if bid:
4263
- self.pglog(sfile + ": Saved file is Quasar backed up, add option -qf '' to force delete", self.PGOPT['errlog'])
4255
+ self.pglog(sfile + ": Saved file is Quasar backed up, add option -qf 0 to force delete", self.PGOPT['errlog'])
4264
4256
  continue
4265
4257
  if sdel:
4266
4258
  afile = self.get_saved_path(i, self.params['SF'][i], 1, type)
@@ -53,13 +53,6 @@ perform the following major functions:
53
53
  GDEXDB
54
54
  - Regenerate filelist and main webpages on demand after dataset changes
55
55
 
56
- The dataset flag -UD (-UseDSARCH) must be set to at least 'Y' before
57
- 'dsarch' can archive files or write to GDEXDB. This flag also controls
58
- file list publication: setting it to 'P' or 'W' publishes file lists for
59
- GDEX Server data files, making them visible in the dataset's user
60
- interface on the GDEX Web Server. See the -SD (-SetDataset) action and
61
- the -UD (-UseDSARCH) option for details.
62
-
63
56
  When a file is moved and its name or path changes, 'dsarch' records the
64
57
  new name as the primary entry in GDEXDB and retains the original as a
65
58
  linked alias. Both names resolve to the same file for usage tracking.
@@ -108,9 +101,12 @@ publishes the user guide as the 'latest' version at
108
101
  https://gdex-docs-dsarch.readthedocs.io, and creating a GitHub release
109
102
  there publishes it as the 'stable' version.
110
103
 
111
- This document first covers general 'dsarch' usage, then describes each
112
- Action option in detail, followed by Mode and Information (Info for
113
- short) options. Examples are provided throughout each section.
104
+ The remainder of this document is organized as follows. Section 2 covers
105
+ general usage and conventions. Section 3 describes Action options grouped
106
+ by what they manipulate (dataset records, DOI/Version controls, groups,
107
+ files, all-information, and webpages). Section 4 lists Mode options that
108
+ modify how an action behaves. Section 5 lists Information options that
109
+ pass values into an action.
114
110
 
115
111
 
116
112
  2 GENERAL DSARCH USAGE
@@ -119,59 +115,82 @@ short) options. Examples are provided throughout each section.
119
115
  or
120
116
  dsarch [-(IF|InputFile)] InputFileNames
121
117
 
122
- Brackets [] indicate optional elements. A pipe '|' within parentheses,
123
- as in (A|B), means either A or B may be used. Options fall into three
124
- categories:
125
- Action options - specify the task to execute
126
- Mode options - modify how an action behaves
127
- Info options - supply values to the action
128
-
129
- Options may be given in short or long form (e.g., -DS or -Dataset). Some
130
- options have alias names; for example, -UseRDADB is an alias for -UD
131
- (-UseDSARCH). Option names are case-insensitive, but values following
132
- Info options are case-sensitive.
133
-
134
- Option -DS specifies the dataset number. It is listed separately because
135
- most actions require it. When -DS is the first argument after 'dsarch',
136
- the option name itself may be omitted — just supply the dataset number
137
- directly.
138
-
139
- Specify exactly one Action option per 'dsarch' invocation. Each action
140
- has its own set of required and optional Info options, and may accept
141
- specific Mode options that adjust its behavior.
142
-
143
- All options except -IF (-InputFile) may be given either on the command
144
- line or in input files. Input file names are specified via -IF and can
145
- only be supplied on the command line. See the -IF option description for
146
- details on how to format options in input files. One or more input files
147
- may be combined with command-line options. The -IF option name itself
148
- may be omitted when a single input file is given on the command line and
149
- all action and option information is contained within that file.
150
-
151
- Info options used with GET actions serve as query filters. Four special
152
- characters enable more precise filtering — they must be quoted or
153
- escaped on the command line to prevent shell interpretation:
154
- '!' - exclude matches; must appear immediately after the option name
155
- (may need escaping as '\!' in some shells due to history
156
- expansion)
157
- '<' - less-than comparison on the following value
158
- '>' - greater-than comparison on the following value
159
- '<>' - range between two values
160
-
161
- Combining '!' and '<' as "'!' '<' OptionValue" expresses a 'greater than
162
- or equal to OptionValue' condition.
163
-
164
- The description of an individual option is shown when 'dsarch' is run as
118
+ Notation:
119
+ [] - the enclosed element is optional.
120
+ (A|B) - either A or B may be used (a short form and a long form).
121
+ -<OPT> - OPT is an option name. Names are case-insensitive; values are not.
122
+
123
+ Every dsarch invocation has at most one Action option, which selects the
124
+ task to perform. Mode options change how the chosen action behaves. Info
125
+ options carry the data the action needs (file names, group indices, dates,
126
+ etc.). Each action documents which Info options are required and which are
127
+ optional.
128
+
129
+ Option -DS (-Dataset) supplies the dataset number. It is listed separately
130
+ because most actions require it. When -DS is the first argument after
131
+ 'dsarch', the option name itself may be omitted — just supply the dataset
132
+ number directly.
133
+
134
+ Many options have an alias for convenience; for example, -Compress is an
135
+ alias for -ZD (-ZipData). Both short and long forms are accepted, and
136
+ aliases are noted with each option.
137
+
138
+ 2.1 Quick Start
139
+
140
+ Show the full document, paged through 'more':
141
+ dsarch
142
+
143
+ Show the description of a single option:
144
+ dsarch -h -AW
145
+
146
+ Retrieve a dataset record from GDEXDB:
147
+ dsarch d260001 -GD
148
+
149
+ Archive a local file as a Web file:
150
+ dsarch d260001 -AW -LF data.nc
151
+
152
+ Retrieve the Web file records for a dataset:
153
+ dsarch d260001 -GW
154
+
155
+ 2.2 Filters and Special Characters in Queries
156
+
157
+ For Get-style actions (-GD, -GV, -GG, -GS, -GW, -GH, -GQ), Info options are
158
+ interpreted as query filters. Four characters refine those filters; quote or
159
+ escape them on the command line so the shell does not consume them:
160
+
161
+ '!' - negate the match. Must appear immediately after the option name
162
+ (may need escaping as '\!' in some shells due to history expansion).
163
+ '<' - less-than comparison against the next value.
164
+ '>' - greater-than comparison against the next value.
165
+ '<>' - range between the next two values (inclusive).
166
+
167
+ The combination "'!' '<' value" expresses 'greater than or equal to value'.
168
+
169
+ 2.3 Input Files
170
+
171
+ Every option except -IF (-InputFile) may be supplied either on the command
172
+ line or in an input file. -IF is itself only valid on the command line. A
173
+ single dsarch invocation may combine command-line options with one or more
174
+ input files. If the only options are inside a single input file, the -IF
175
+ prefix may be omitted. See the description of -IF in Section 5.2 for the
176
+ input-file format (comments, action/mode markers, single-value assignments,
177
+ and tabular multi-value assignments, including delimiter overrides).
178
+
179
+ As a safeguard against operating on the wrong dataset, input file names must
180
+ begin with the dataset number in the format 'dNNNNNN.*', where '*' matches
181
+ one or more valid filename characters.
182
+
183
+ 2.4 Getting Help
165
184
 
166
185
  dsarch [Option] -(h|help) [Option]
167
186
 
168
- The description is shown for the option placed either before or after
169
- -(h|help). If no option is given, or 'dsarch' is run without arguments,
170
- the full document is displayed using the UNIX 'more' utility. A hard
171
- copy of this document can be printed from the saved file, dsarch.usg,
172
- in the rda_python_dsarch Python package.
187
+ The description of a single option is shown when -h (-help) is given with
188
+ that option, placed either before or after -h. With no option, or when
189
+ 'dsarch' is run without arguments, the full document is displayed through
190
+ the UNIX 'more' utility. A printable copy of this document is the file
191
+ dsarch.usg installed under the python package rda_python_dsarch.
173
192
 
174
- #The online version of this document is available at
193
+ #The online HTML version of this document is available at
175
194
  #https://gdex-docs-dsarch.readthedocs.io
176
195
 
177
196
 
@@ -182,10 +201,6 @@ actions perform a single task; others bundle multiple tasks together and
182
201
  may trigger additional steps when certain Mode options are present. Only
183
202
  one Action option may be specified per execution.
184
203
 
185
- Write actions require the -UD (-UseDSARCH) flag to be set to 'Y', 'I',
186
- 'P', or 'W' for the target dataset before they can modify GDEXDB. Read
187
- actions have no such requirement.
188
-
189
204
  Actions are grouped into seven categories based on the information they
190
205
  handle:
191
206
  Dataset Actions - create, modify and retrieve dataset information
@@ -219,7 +234,6 @@ handle:
219
234
  periods.
220
235
 
221
236
  dsarch [-(DS|Dataset)] dNNNNNN [-](SD|SetDataset) [Mode Options]
222
- [-(UD|UseDSARCH) UseDSARCHFlag] # Y, P, W, I, or N
223
237
  [-(LC|Location) AccessLocationFlag] # C - CGD, G - Glade, O - bOreas
224
238
  [-(BF|BackupFlag) QuasarBackupFlag] # B - Backup, D - Backup & Drdata
225
239
  [-(DA|AccessFlag) DataAccessFlags] # B - Both, C - Complete, F - Faceted, or N - No
@@ -257,20 +271,21 @@ handle:
257
271
  dataset level
258
272
  -(WN|WithFileNumber) - re-evaluates and resets file counts
259
273
 
260
- Dataset numbers are normally created via the Metadata Manager. Action
261
- -SD modifies the dataset record and any associated group data
262
- periods. Data periods for groups can be modified in 'dsarch', but
263
- must be created or removed through Metadata Manager.
274
+ Dataset numbers are created via the Metadata Manager, not 'dsarch'.
275
+ Action -SD only modifies an existing dataset record and its associated
276
+ group data periods; if no dataset record exists, -SD makes no change to
277
+ it. Data periods for groups can be modified in 'dsarch', but the groups
278
+ themselves must be created or removed through the Metadata Manager.
264
279
 
265
280
  The web file access location flag is set via -LC (-Location). The
266
281
  default is 'G' (Glade Disk) when any web data files exist. The default
267
282
  becomes 'O' if all web files reside on bOreas, or 'C' if all are at
268
283
  the CGD data path.
269
284
 
270
- For example, to set the UseDSARCH flag, reset file counts and data
271
- size, and set the beginning data date for dataset d744004:
285
+ For example, to reset file counts and data size, and set the
286
+ beginning data date for dataset d744004:
272
287
 
273
- dsarch d744004 SD -WN -UD Y -BD 1999-07-01
288
+ dsarch d744004 SD -WN -BD 1999-07-01
274
289
 
275
290
  3.1.2 Get Dataset Information
276
291
  -GD or -GetDataset, reads and displays dataset record fields from
@@ -289,7 +304,7 @@ handle:
289
304
  -(WN|WithFileNumber) - gathers and displays Saved/Web file counts
290
305
 
291
306
  Use -FN (-FieldNames) to select which dataset fields to include.
292
- Defaults to 'SWFULQ'. Use -FN ALL to retrieve every available field.
307
+ Defaults to 'SWFLQA'. Use -FN ALL to retrieve every available field.
293
308
 
294
309
  Valid dataset field names and their corresponding Info options:
295
310
 
@@ -299,7 +314,6 @@ handle:
299
314
  H -(WH|WebHome) path for the web data home directory
300
315
  W -(WP|WebPath) path relative to web home directory
301
316
  F -(DF|DataFormat) default data content format
302
- U -(UD|UseDSARCH) use DSARCH flag
303
317
  L -(LC|Location) Online web file access location flags
304
318
  Q -(BF|BackupFlag) Quasar Backup flags
305
319
  A -(DA|DataAccessFlag) dataset data file list access flags
@@ -331,7 +345,6 @@ SavedPath<=>
331
345
  WebPath<=>
332
346
  Location<=>G
333
347
  DataFormat<=>
334
- UseDSARCH<=>P
335
348
  GroupLevel<=>3
336
349
  FileLimit<=>500
337
350
  ButtonLimit<=>2
@@ -2008,18 +2021,6 @@ They come in two forms:
2008
2021
  when running 'dsarch' as a PBS batch job. Quote the value on the
2009
2022
  command line, e.g., -QS '-l walltime=12:00:00'.
2010
2023
 
2011
- -UD or -UseDSARCH (Alias: -UseGDEXDB), the gating flag that
2012
- controls 'dsarch' access to a dataset. Set via -SD (-SetDataset).
2013
- Values:
2014
- 'N' - disabled (default; blocks all 'dsarch' writes)
2015
- 'Y' - enabled for modification
2016
- 'I' - enabled for internal users only
2017
- 'P' - enabled and file lists are published publicly
2018
- 'W' - file list publication only
2019
-
2020
- Any value except 'N' must be set before 'dsarch' can write to
2021
- GDEXDB.
2022
-
2023
2024
  -VS or -ValidSize, the minimum acceptable file size (in bytes) for
2024
2025
  archiving. Files smaller than this threshold are rejected.
2025
2026
  Defaults to 100.
@@ -2260,7 +2261,9 @@ They come in two forms:
2260
2261
  parent group for a subgroup. Groups can be nested to any depth.
2261
2262
 
2262
2263
  -QF or -QuasarFile, the name of the Quasar backup (tar) file,
2263
- required for -AQ (-ArchiveQuasarFile).
2264
+ required for -AQ (-ArchiveQuasarFile). Give -QF 0 with -DL
2265
+ (-DeleteFile) to force delete a Web or Saved file that is Quasar
2266
+ backed up.
2264
2267
 
2265
2268
  -QT or -QuasarFileType (Alias: -QuasarType|-BackupType), the
2266
2269
  backup scope: 'B' (backup only) or 'D' (backup plus disaster
@@ -148,7 +148,6 @@ class PgArch(PgOPT, PgCMD, PgSplit):
148
148
  'ON' : [1, 'OrderNames', 0],
149
149
  'PO' : [1, 'PatternOffset', 16],
150
150
  'QS' : [1, 'QsubOptions', 1],
151
- 'UD' : [1, 'UseDSARCH', 0, 'YNIPW'], # Internal, Public, Web only, Y - ready for dsarch
152
151
  'VS' : [1, 'ValidSize', 17], # default to self.PGLOG['MINSIZE']
153
152
  'WI' : [1, 'WaitInternval', 1],
154
153
  'AF' : [2, 'ArchiveFormat', 1],
@@ -192,7 +191,7 @@ class PgArch(PgOPT, PgCMD, PgSplit):
192
191
  'OG' : [2, 'OriginGroup', 1],
193
192
  'OT' : [2, 'OriginType', 1],
194
193
  'PI' : [2, 'ParentIndex', 17],
195
- 'QF' : [2, 'QuasarFile', 0],
194
+ 'QF' : [2, 'QuasarFile', 0, ''],
196
195
  'QT' : [2, 'QuasarFileType', 129, 'BD'],
197
196
  'RF' : [2, 'OriginFile', 0],
198
197
  'SF' : [2, 'SavedFile', 0],
@@ -272,7 +271,6 @@ class PgArch(PgOPT, PgCMD, PgSplit):
272
271
  'TS' : ['ToSavedFile', 'MovedToSaved'],
273
272
  'TW' : ['ToWebFile', 'MovedToWeb'],
274
273
  'UC' : ['UpdateCacheNumber'],
275
- 'UD' : ['UseRDADB'],
276
274
  'HD' : ['UpdateHTML', 'GenerateHTML'],
277
275
  'UZ' : ['Uncompress', 'UncompressData', 'Unzip'],
278
276
  'WC' : ['ValidateChecksum', "WithMD5", "ValidateMD5"],
@@ -293,7 +291,6 @@ class PgArch(PgOPT, PgCMD, PgSplit):
293
291
  'H' : ['WH', "webhome", 1],
294
292
  'W' : ['WP', "webpath", 1],
295
293
  'F' : ['DF', "data_format", 1],
296
- 'U' : ['UD', "use_rdadb", 1],
297
294
  'L' : ['LC', "locflag", 1],
298
295
  'Q' : ['BF', "backflag", 1],
299
296
  'A' : ['DA', "accessflag", 1],
@@ -416,7 +413,7 @@ class PgArch(PgOPT, PgCMD, PgSplit):
416
413
  # global info to be used by the whole application
417
414
  self.PGOPT['MSET'] = "SA"
418
415
  #default fields for getting info
419
- self.PGOPT['dataset'] = "SWFULQA"
416
+ self.PGOPT['dataset'] = "SWFLQA"
420
417
  self.PGOPT['dsperiod'] = "GJKXY"
421
418
  self.PGOPT['dsgroup'] = "IGXTPQASW"
422
419
  self.PGOPT['wfile'] = "FTIVMNLHPS"
@@ -424,10 +421,9 @@ class PgArch(PgOPT, PgCMD, PgSplit):
424
421
  self.PGOPT['bfile'] = "FNMTHS"
425
422
  self.PGOPT['hfile'] = 'FMNLTHPSU'
426
423
  self.PGOPT['dsvrsn'] = "VIEDSJX"
427
- self.PGOPT['UACTS'] = (self.OPTS['AQ'][0]|self.OPTS['SD'][0]|self.OPTS['DL'][0])
428
-
424
+
429
425
  #all fields for getting info
430
- self.PGOPT['dsall'] = "TSHWFULQAVCBMPIDNGJKXYIJKXY" # include 'pdall'
426
+ self.PGOPT['dsall'] = "TSHWFLQAVCBMPIDNGJKXYIJKXY" # include 'pdall'
431
427
  self.PGOPT['pdall'] = "GJKXY"
432
428
  self.PGOPT['gpall'] = "IGXTRQAPSWMDN"
433
429
  self.PGOPT['wfall'] = "FTCIXVMNOBQLHPSJKAED"
@@ -506,7 +502,7 @@ class PgArch(PgOPT, PgCMD, PgSplit):
506
502
  "Miss Saved file types per -ST(-SavedFileType)",
507
503
  "Cannot Cross Copy/Move (-XC/-XM) Saved Files",
508
504
  "14",
509
- "Miss Use-RDADB flag, ('Y', 'P', 'W', 'I'), per -UD(-UseRDADB) for ",
505
+ "15",
510
506
  "16",
511
507
  "miss Saved file names per -SF(-SavedFile)",
512
508
  "Miss Version Control Index per -VI(-VersionIndex)",
@@ -684,13 +680,8 @@ class PgArch(PgOPT, PgCMD, PgSplit):
684
680
  self.validate_versions()
685
681
  elif acts == self.OPTS['UC'][0] or acts == self.OPTS['UW'][0]:
686
682
  if 'DS' not in self.params: erridx = 4
687
- if erridx < 0:
688
- if(self.OPTS[cact][2] > 0 and acts&self.PGOPT['UACTS'] == 0 and
689
- self.use_rdadb(self.params['DS'], self.PGOPT['extlog']) == 'N' and
690
- ('UD' not in self.params or self.params['UD'] == 'N')):
691
- erridx = 15
692
- errmsg[erridx] += self.params['DS']
693
683
  if erridx >= 0: self.action_error(errmsg[erridx], cact)
684
+ self.validate_dataset() # error out if the dataset does not exist in RDADB
694
685
  self.set_uid("dsarch") # set uid before any action
695
686
  if 'VS' in self.params: self.PGLOG['MINSIZE'] = self.params['VS'] # minimal size for a file to be valid for archive
696
687
  self.PGLOG['RSOptions'] = " -R -S" if 'RS' in self.params else ''
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_dsarch
3
- Version: 3.0.3
3
+ Version: 3.0.6
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
@@ -0,0 +1,14 @@
1
+ rda_python_dsarch/PgArch.py,sha256=_hfBFyft9rSC35QBIbtQRkF3TQE7tuT7Dz-B-KmVsVU,58922
2
+ rda_python_dsarch/PgMeta.py,sha256=FV4GytgnJK00FUlyM6iHqpNd7-XTVHO1j5tZtcLTWgY,26845
3
+ rda_python_dsarch/__init__.py,sha256=-ympZMoYfvP0lxSq06GWQemQlj4HwV9tm1JNxKpSU90,812
4
+ rda_python_dsarch/ds_arch.py,sha256=n8fYdSy9cTqzPwJuHt8haIPAFD_n76GB20AApGWTkDY,233513
5
+ rda_python_dsarch/dsarch.py,sha256=PWwe76cb8iOQci8LO0tpNQ0wtULxawsPV7-JkY98Mtw,254884
6
+ rda_python_dsarch/dsarch.usg,sha256=LpteXfUe9RBSbmM3HputbtZjEEyUSKnYvOfphH0UQrA,106590
7
+ rda_python_dsarch/pg_arch.py,sha256=-HD-CynFzvcBsL9w6EN-4O5RqdXvspbRUbNzs6njSaQ,80494
8
+ rda_python_dsarch/pg_meta.py,sha256=FFEkphGAT--66zvMNDPfiFG4nZQpXed_yVGMARdZb-o,46981
9
+ rda_python_dsarch-3.0.6.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
10
+ rda_python_dsarch-3.0.6.dist-info/METADATA,sha256=6mQmnKFsQ0dRC2dcdaSQNtGP8fyLrTDp2nL5J1HEiI0,7165
11
+ rda_python_dsarch-3.0.6.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
12
+ rda_python_dsarch-3.0.6.dist-info/entry_points.txt,sha256=BA1iRAFIZExG0656Ri9f-_OKlSK31CuABWPQSsA9MsI,64
13
+ rda_python_dsarch-3.0.6.dist-info/top_level.txt,sha256=-vwcMgUXbBdHscvAKB3De9zKac3m_s_FaKIdApP1FGY,18
14
+ rda_python_dsarch-3.0.6.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (82.0.1)
2
+ Generator: setuptools (83.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,14 +0,0 @@
1
- rda_python_dsarch/PgArch.py,sha256=d1Y87MT49tgQygLAffNff9Qs4c12KXspYyDG8liSnpQ,59452
2
- rda_python_dsarch/PgMeta.py,sha256=FV4GytgnJK00FUlyM6iHqpNd7-XTVHO1j5tZtcLTWgY,26845
3
- rda_python_dsarch/__init__.py,sha256=Y-s3WV6vKvLYuMy6oy0FB9DYNVaiEaSjZVJYBMVlD_8,812
4
- rda_python_dsarch/ds_arch.py,sha256=6bR0y6_rhIXyvbuYd-oZfL1YcaHhWBkojjzYz1yCrVg,233810
5
- rda_python_dsarch/dsarch.py,sha256=wQZS-mI4vyc7GDKOMl--_wQejx4_Wa77hegF_9deZX8,255105
6
- rda_python_dsarch/dsarch.usg,sha256=GBjaGaXFislaJO-s8lxcNdddJ7A5NUNreT2xgiP-Emg,106789
7
- rda_python_dsarch/pg_arch.py,sha256=0mZGlQT9ecJr-92dloXDNtwF8EnPnY76IGLksqYsyYo,81057
8
- rda_python_dsarch/pg_meta.py,sha256=FFEkphGAT--66zvMNDPfiFG4nZQpXed_yVGMARdZb-o,46981
9
- rda_python_dsarch-3.0.3.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
10
- rda_python_dsarch-3.0.3.dist-info/METADATA,sha256=eXobD0DFxXfPHuneCSPb_uEKSJZYzZUMPtnbyKMdwtY,7165
11
- rda_python_dsarch-3.0.3.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
12
- rda_python_dsarch-3.0.3.dist-info/entry_points.txt,sha256=BA1iRAFIZExG0656Ri9f-_OKlSK31CuABWPQSsA9MsI,64
13
- rda_python_dsarch-3.0.3.dist-info/top_level.txt,sha256=-vwcMgUXbBdHscvAKB3De9zKac3m_s_FaKIdApP1FGY,18
14
- rda_python_dsarch-3.0.3.dist-info/RECORD,,