rda-python-common 1.0.13__py3-none-any.whl → 1.0.15__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.

Potentially problematic release.


This version of rda-python-common might be problematic. Click here for more details.

@@ -109,6 +109,7 @@ PGLOG = { # more defined in untaint_suid() with environment variables
109
109
  'DSIDCHRS' : "d",
110
110
  'DOSHELL' : False,
111
111
  'NEWDSID' : True,
112
+ 'PUSGDIR' : None,
112
113
  'BCHHOSTS' : "PBS",
113
114
  'HOSTTYPE' : 'dav', # default HOSTTYPE
114
115
  'EMLMAX' : 256, # up limit of email line count
@@ -479,6 +480,13 @@ def get_call_trace(cut = 1):
479
480
 
480
481
  return str + "\n" if str else ""
481
482
 
483
+ #
484
+ # get caller file name
485
+ #
486
+ def get_caller_file(cidx = 0):
487
+
488
+ return traceback.extract_stack()[cidx][0]
489
+
482
490
  #
483
491
  # log message, msg, for degugging processes according to the debug level
484
492
  #
@@ -541,6 +549,13 @@ def pgtrim(line, rmcmt = 1):
541
549
 
542
550
  return line
543
551
 
552
+ #
553
+ # set PGLOG['PUSGDIR'] from the program file with full path
554
+ #
555
+ def set_help_path(progfile):
556
+
557
+ PGLOG['PUSGDIR'] = op.dirname(op.abspath(progfile))
558
+
544
559
  #
545
560
  # Function: show_usage(progname: Perl program name to get file "progname.usg")
546
561
  #
@@ -549,7 +564,9 @@ def pgtrim(line, rmcmt = 1):
549
564
  #
550
565
  def show_usage(progname, opts = None):
551
566
 
552
- usgname = PGLOG['PUSGDIR'] + '/' + progname + '.usg'
567
+ if PGLOG['PUSGDIR'] is None: set_help_path(get_caller_file())
568
+ usgname = join_paths(PGLOG['PUSGDIR'], progname + '.usg')
569
+
553
570
  if opts:
554
571
  # show usage for individual option of dsarch
555
572
  for opt in opts:
@@ -1276,7 +1293,6 @@ def set_common_pglog():
1276
1293
  SETPGLOG("DRDATAEP", "rda-quasar-drdata") # DRDATA Globus Endpoint on Quasar
1277
1294
  SETPGLOG("DBGFILE", "pgdss.dbg") # debug file name
1278
1295
  SETPGLOG("CNFPATH", PGLOG['DSSHOME']+"/config") # path to configuration files
1279
- SETPGLOG("PUSGDIR", PGLOG['DSSDBHM']+"/prog_usage") # path to program usage files
1280
1296
  SETPGLOG("DSSURL", "https://rda.ucar.edu") # current dss web URL
1281
1297
  SETPGLOG("RQSTURL", "/datasets/request") # request URL path
1282
1298
  SETPGLOG("WEBSERVERS", "rda-web-prod01.ucar.edu:rda-web-test01.ucar.edu") # webserver names for Web server
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 1.0.13
3
+ Version: 1.0.15
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
@@ -11,6 +11,7 @@ Classifier: Development Status :: 5 - Production/Stable
11
11
  Requires-Python: >=3.7
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
+ Dynamic: license-file
14
15
 
15
16
  # rda-python-common
16
17
  Python common library codes to be shared by other RDA python utility programs.
@@ -1,15 +1,15 @@
1
1
  rda_python_common/PgCMD.py,sha256=dsFL_hiAHRZ-BwncgZhxQ7p9O10ox9lUSXOIePjZ-PQ,20487
2
2
  rda_python_common/PgDBI.py,sha256=kDawKAKDYr8jLWl1RAS-6fbZOPrLv7SMjvvi4bx_638,74286
3
3
  rda_python_common/PgFile.py,sha256=RSCnABv7jOLmalzkQJnvXe-VgP6OQl3boeL8-Ja9qfY,98379
4
- rda_python_common/PgLOG.py,sha256=dcIu6VTSYL9dvyyQfwuleqp52z6PMc1nEvtko_hSquM,53766
4
+ rda_python_common/PgLOG.py,sha256=5j3vyZNJM3K0kECiJYVs9Y-I9gzoeE28Tlj5F1v7foo,54033
5
5
  rda_python_common/PgLock.py,sha256=12i84nsGBuifSyPnm8IR63LvHvRuVU573D5QKFlHdOI,22623
6
6
  rda_python_common/PgOPT.py,sha256=BAfuNi_1jEK-UyYVfPY_0f4b7KLhpcFM3BDShLRvT7w,55446
7
7
  rda_python_common/PgSIG.py,sha256=oDXcSnnzW6wKm_cSpFxQZWAo2hpPPTcuNDYhPSNQcRc,35607
8
8
  rda_python_common/PgSplit.py,sha256=QKPbF55m8KCTGmwVwL3uG_nuylCC4FSVfLuXeLjJHbE,8816
9
9
  rda_python_common/PgUtil.py,sha256=OpkNDwt694ebttNNUEDrrtDKyITZkx8g3uAI3b_FF4c,48737
10
10
  rda_python_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- rda_python_common-1.0.13.dist-info/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
12
- rda_python_common-1.0.13.dist-info/METADATA,sha256=-zzV2vEzdS5dRXlv_qlDfhIBpV4vBfELW0AfUqu6BME,630
13
- rda_python_common-1.0.13.dist-info/WHEEL,sha256=nn6H5-ilmfVryoAQl3ZQ2l8SH5imPWFpm1A5FgEuFV4,91
14
- rda_python_common-1.0.13.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
15
- rda_python_common-1.0.13.dist-info/RECORD,,
11
+ rda_python_common-1.0.15.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
12
+ rda_python_common-1.0.15.dist-info/METADATA,sha256=pjXuN892u24qa-KwVU46JJJsbRz_n-eDATkYn7JsQC4,652
13
+ rda_python_common-1.0.15.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
14
+ rda_python_common-1.0.15.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
15
+ rda_python_common-1.0.15.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.1)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5