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

@@ -1664,7 +1664,7 @@ def local_file_stat(file, fstat, opt, logact):
1664
1664
  if opt&8:
1665
1665
  info['gid'] = fstat.st_gid
1666
1666
  info['group'] = grp.getgrgid(info['gid']).gr_name
1667
- if opt&32: info['checksum'] = get_md5sum(file, 0, logact)
1667
+ if opt&32 and info['isfile']: info['checksum'] = get_md5sum(file, 0, logact)
1668
1668
 
1669
1669
  return info
1670
1670
 
@@ -2305,16 +2305,18 @@ def get_md5sum(file, count = 0, logact = 0):
2305
2305
  if count > 0:
2306
2306
  checksum = [None]*count
2307
2307
  for i in range(count):
2308
- chksm = PgLOG.pgsystem(cmd + file[i], logact, 20)
2309
- if chksm:
2310
- ms = re.search(r'(\w{32})', chksm)
2311
- if ms: checksum[i] = ms.group(1)
2308
+ if op.isfile(file[i]):
2309
+ chksm = PgLOG.pgsystem(cmd + file[i], logact, 20)
2310
+ if chksm:
2311
+ ms = re.search(r'(\w{32})', chksm)
2312
+ if ms: checksum[i] = ms.group(1)
2312
2313
  else:
2313
- chksm = PgLOG.pgsystem(cmd + file, logact, 20)
2314
2314
  checksum = None
2315
- if chksm:
2316
- ms = re.search(r'(\w{32})', chksm)
2317
- if ms: checksum = ms.group(1)
2315
+ if op.isfile(file):
2316
+ chksm = PgLOG.pgsystem(cmd + file, logact, 20)
2317
+ if chksm:
2318
+ ms = re.search(r'(\w{32})', chksm)
2319
+ if ms: checksum = ms.group(1)
2318
2320
 
2319
2321
  return checksum
2320
2322
 
@@ -354,9 +354,12 @@ def log_email(emlmsg):
354
354
  if not CPID['PID']: CPID['PID'] = "{}-{}-{}".format(PGLOG['HOSTNAME'], get_command(), PGLOG['CURUID'])
355
355
  cmdstr = "{} {} at {}\n".format(CPID['PID'], break_long_string(CPID['CMD'], 40, "...", 1), current_datetime())
356
356
  fn = "{}/{}".format(PGLOG['LOGPATH'], PGLOG['EMLFILE'])
357
- f = open(fn, 'a')
358
- f.write(cmdstr + emlmsg)
359
- f.close()
357
+ try:
358
+ f = open(fn, 'a')
359
+ f.write(cmdstr + emlmsg)
360
+ f.close()
361
+ except FileNotFoundError as e:
362
+ print(e)
360
363
 
361
364
  #
362
365
  # Function: cmdlog(cmdline)
@@ -474,7 +477,7 @@ def write_message(msg, file, logact):
474
477
  if logact&BRKLIN: OUT.write("\n")
475
478
  if logact&SEPLIN: OUT.write(PGLOG['SEPLINE'])
476
479
  OUT.write(msg)
477
- if errlog and not logact&(EMLALL|SKPTRC): OUT.write(get_call_trace())
480
+ if errlog and file and not logact&(EMLALL|SKPTRC): OUT.write(get_call_trace())
478
481
  if doclose: OUT.close()
479
482
 
480
483
  #
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 1.0.44
3
+ Version: 1.0.46
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
@@ -1,15 +1,15 @@
1
1
  rda_python_common/PgCMD.py,sha256=EYjG2Z4zEnvsXE1z-jt5UaNoEKxnOYYiMMzvW6HrKA4,20597
2
2
  rda_python_common/PgDBI.py,sha256=nAov-B-B9XZ7p7rX1ZU4TcjAItSXVq18yD0Xe80TkwY,74962
3
- rda_python_common/PgFile.py,sha256=yAYpk_U3xGKwrGQXhM7Zy9bvyV-tCwCrYr1OSNcX2Pw,98905
4
- rda_python_common/PgLOG.py,sha256=5Ac9DydzJbZSzoOseQWw4trEUAI4sWXblDpYWCkouPo,55449
3
+ rda_python_common/PgFile.py,sha256=CJqMlUzR47JkTRBsAWwfY-Fl_3IED-u5HuR19EtdDuo,99006
4
+ rda_python_common/PgLOG.py,sha256=KK90AHYssRCeqa2swphhuTdnPeSOMUc8ylwFJe1Bi8c,55525
5
5
  rda_python_common/PgLock.py,sha256=12i84nsGBuifSyPnm8IR63LvHvRuVU573D5QKFlHdOI,22623
6
6
  rda_python_common/PgOPT.py,sha256=Q0e5dhfhOw8ha7y28s3SS8xBk_kdHSWjC8JfC--2rvU,56012
7
7
  rda_python_common/PgSIG.py,sha256=ZVM9Qz6yIFurwIQJtV5-CFbKOTdFsZ-Rs95SEpDFgNk,35795
8
8
  rda_python_common/PgSplit.py,sha256=QKPbF55m8KCTGmwVwL3uG_nuylCC4FSVfLuXeLjJHbE,8816
9
9
  rda_python_common/PgUtil.py,sha256=OqESKCd72b9g8m8jwjPJhXDtPYlW6G8oSOhwChvz2Cg,48600
10
10
  rda_python_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- rda_python_common-1.0.44.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
12
- rda_python_common-1.0.44.dist-info/METADATA,sha256=zPzyedrVtoTcpAxvcDR_znVIZmOk2XK7kKAwSjuR3Nk,716
13
- rda_python_common-1.0.44.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- rda_python_common-1.0.44.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
15
- rda_python_common-1.0.44.dist-info/RECORD,,
11
+ rda_python_common-1.0.46.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
12
+ rda_python_common-1.0.46.dist-info/METADATA,sha256=YCP0-JU_eA01fHYBpWsatyCeOT-T_Sw6wGnoXe9iosY,716
13
+ rda_python_common-1.0.46.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ rda_python_common-1.0.46.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
15
+ rda_python_common-1.0.46.dist-info/RECORD,,