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

@@ -251,7 +251,7 @@ def send_customized_email(logmsg, emlmsg, logact = 0):
251
251
  entries = {
252
252
  'fr' : ["From", 1, None],
253
253
  'to' : ["To", 1, None],
254
- 'cc' : ["Cc", 0, None],
254
+ 'cc' : ["Cc", 0, ''],
255
255
  'sb' : ["Subject", 1, None]
256
256
  }
257
257
 
@@ -293,7 +293,8 @@ def send_email(subject = None, receiver = None, msg = None, sender = None, logac
293
293
  return send_python_email(subject, receiver, msg, sender, None, logact)
294
294
 
295
295
  #
296
- # send an email via python module smtplib; if empty msg send email message saved in PGLOG['EMLMSG'] instead
296
+ # send an email via python module smtplib; if empty msg send email message saved
297
+ # in PGLOG['EMLMSG'] instead. pass cc = '' for skipping 'Cc: '
297
298
  #
298
299
  def send_python_email(subject = None, receiver = None, msg = None, sender = None, cc = None, logact = 0):
299
300
 
@@ -321,7 +322,7 @@ def send_python_email(subject = None, receiver = None, msg = None, sender = None
321
322
  emlmsg['From'] = sender
322
323
  emlmsg['To'] = receiver
323
324
  logmsg = "Email " + receiver
324
- if not cc: cc = PGLOG['CCDADDR']
325
+ if cc == None: cc = PGLOG['CCDADDR']
325
326
  if cc:
326
327
  emlmsg['Cc'] = cc
327
328
  logmsg += " Cc'd " + cc
@@ -402,15 +403,11 @@ def pglog(msg, logact = MSGLOG):
402
403
  if logact&EMLLOG: logact &= ~EMLLOG
403
404
  if not logact&ERRLOG: logact &= ~EMEROL
404
405
 
405
- if msg: msg = msg.lstrip() # remove leading whitespaces for logging message
406
-
406
+ msg = msg.lstrip() if msg else '' # remove leading whitespaces for logging message
407
407
  if logact&EXITLG:
408
408
  ext = "Exit 1 in {}\n".format(os.getcwd())
409
- if not msg:
410
- msg = ext
411
- else:
412
- msg = msg.rstrip()
413
- msg += "; " + ext
409
+ if msg: msg = msg.rstrip() + "; "
410
+ msg += ext
414
411
  else:
415
412
  if msg and not re.search(r'(\n|\r)$', msg): msg += "\n"
416
413
  if logact&RETMSG: retmsg = msg
@@ -418,7 +415,8 @@ def pglog(msg, logact = MSGLOG):
418
415
  if logact&EMLALL:
419
416
  if logact&SNDEML or not msg:
420
417
  title = (msg if msg else "Message from {}-{}".format(PGLOG['HOSTNAME'], get_command()))
421
- msg = send_email(title.rstrip())
418
+ msg = title + '\n' + msg
419
+ send_email(title.rstrip())
422
420
  elif msg:
423
421
  set_email(msg, logact)
424
422
 
@@ -428,7 +426,8 @@ def pglog(msg, logact = MSGLOG):
428
426
  if not logact&EMLALL: set_email(msg, logact)
429
427
  title = "ABORTS {}-{}".format(PGLOG['HOSTNAME'], get_command())
430
428
  set_email((("ABORTS " + CPID['PID']) if CPID['PID'] else title), EMLTOP)
431
- msg += send_email(title)
429
+ msg = title + '\n' + msg
430
+ send_email(title)
432
431
 
433
432
  if logact&LOGERR: # make sure error is always logged
434
433
  msg = break_long_string(msg)
@@ -1682,8 +1682,10 @@ def send_request_email_notice(pgrqst, errmsg, fcount, rstat, readyfile = None, p
1682
1682
  einfo['GLOBUS_TASK_URL'] = "https://app.globus.org/activity/" + pgrqst['task_id']
1683
1683
 
1684
1684
  for ekey in einfo:
1685
- ebuf = re.sub(r'<{}>'.format(ekey), einfo[ekey], ebuf)
1686
-
1685
+ if ekey == 'CCD' and not einfo['CCD']:
1686
+ ebuf = re.sub(r'Cc:\s*<CCD>\s*', '', ebuf)
1687
+ else:
1688
+ ebuf = re.sub(r'<{}>'.format(ekey), einfo[ekey], ebuf)
1687
1689
 
1688
1690
  if PgLOG.PGLOG['DSCHECK'] and not pgpart:
1689
1691
  tbl = "dscheck"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 1.0.36
3
+ Version: 1.0.38
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=12qnRXO7pWv8togtTsOvtVuGtwixnR-s2vLGPpdDfHw,74658
3
3
  rda_python_common/PgFile.py,sha256=gJuzBxLRYo3HQyNW1WNYDsQWRei2cco9bYEb6uOL8Ds,98487
4
- rda_python_common/PgLOG.py,sha256=FhminRf-ER__lOTpcqm1ynQLYFP5RIDUNGO1Mrmwh9Y,55227
4
+ rda_python_common/PgLOG.py,sha256=XYJ4w-CVZrkaK4CMWd6ZjUKWIQSvN9lui4Dtt52VBPI,55277
5
5
  rda_python_common/PgLock.py,sha256=12i84nsGBuifSyPnm8IR63LvHvRuVU573D5QKFlHdOI,22623
6
- rda_python_common/PgOPT.py,sha256=zX8lWFdfV6GxjLKfMc9eM76mjIjss_ulPieerejcmks,55936
6
+ rda_python_common/PgOPT.py,sha256=Sf--l5iKY82xF5NbXxEy8PWip7ACpaa3KLdMac7E-oc,56047
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.36.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
12
- rda_python_common-1.0.36.dist-info/METADATA,sha256=kF8m3xXZgi0fDbMQ8nrhyh-WHlJU8E5MaRtg8JYnfBw,716
13
- rda_python_common-1.0.36.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- rda_python_common-1.0.36.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
15
- rda_python_common-1.0.36.dist-info/RECORD,,
11
+ rda_python_common-1.0.38.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
12
+ rda_python_common-1.0.38.dist-info/METADATA,sha256=nz0V4NcLxfDz9qbXb1vLl5Qx8_IiQtauePj-reMX87I,716
13
+ rda_python_common-1.0.38.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ rda_python_common-1.0.38.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
15
+ rda_python_common-1.0.38.dist-info/RECORD,,