rda-python-common 1.0.47__py3-none-any.whl → 1.0.49__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.
- rda_python_common/PgLOG.py +9 -25
- {rda_python_common-1.0.47.dist-info → rda_python_common-1.0.49.dist-info}/METADATA +1 -1
- {rda_python_common-1.0.47.dist-info → rda_python_common-1.0.49.dist-info}/RECORD +6 -6
- {rda_python_common-1.0.47.dist-info → rda_python_common-1.0.49.dist-info}/WHEEL +0 -0
- {rda_python_common-1.0.47.dist-info → rda_python_common-1.0.49.dist-info}/licenses/LICENSE +0 -0
- {rda_python_common-1.0.47.dist-info → rda_python_common-1.0.49.dist-info}/top_level.txt +0 -0
rda_python_common/PgLOG.py
CHANGED
|
@@ -28,6 +28,7 @@ import time
|
|
|
28
28
|
import socket
|
|
29
29
|
import shutil
|
|
30
30
|
import traceback
|
|
31
|
+
from unidecode import unidecode
|
|
31
32
|
|
|
32
33
|
# define some constants for logging actions
|
|
33
34
|
MSGLOG = (0x00001) # logging message
|
|
@@ -335,7 +336,7 @@ def send_python_email(subject = None, receiver = None, msg = None, sender = None
|
|
|
335
336
|
emlmsg['Cc'] = cc
|
|
336
337
|
logmsg += " Cc'd " + cc
|
|
337
338
|
if not subject: subject = "Message from {}-{}".format(PGLOG['HOSTNAME'], get_command())
|
|
338
|
-
if not re.search(r'!$', subject): subject += '!'
|
|
339
|
+
# if not re.search(r'!$', subject): subject += '!'
|
|
339
340
|
emlmsg['Subject'] = subject
|
|
340
341
|
if CPID['CPID']: logmsg += " in " + CPID['CPID']
|
|
341
342
|
logmsg += ", Subject: {}\n".format(subject)
|
|
@@ -1579,33 +1580,16 @@ def check_process_host(hosts, chost = None, mflag = None, pinfo = None, logact =
|
|
|
1579
1580
|
return ret
|
|
1580
1581
|
|
|
1581
1582
|
#
|
|
1582
|
-
# convert special characters
|
|
1583
|
+
# convert special foreign characters into ascii characters
|
|
1583
1584
|
#
|
|
1584
1585
|
def convert_chars(name, default = 'X'):
|
|
1585
|
-
|
|
1586
1586
|
if not name: return default
|
|
1587
|
-
if re.match(r'^[a-zA-Z0-9]+$', name): return name #
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
if re.match(r'^[a-zA-Z0-9]$', ch):
|
|
1594
|
-
newchrs += ch
|
|
1595
|
-
elif (ch == ' ' or ch == '_') and newchrs:
|
|
1596
|
-
newchrs += '_'
|
|
1597
|
-
elif ord(ch) > z and ochrs != None:
|
|
1598
|
-
if not ochrs:
|
|
1599
|
-
ochrs = None
|
|
1600
|
-
with open(PGLOG['DSSHOME'] + "/lib/ExtChrs.txt", "r") as CHR:
|
|
1601
|
-
ochrs = CHR.readline()
|
|
1602
|
-
nchrs = CHR.readline()
|
|
1603
|
-
if ochrs is None: continue
|
|
1604
|
-
idx = ochrs.find(ch)
|
|
1605
|
-
if idx >= 0: newchrs += nchrs[idx]
|
|
1606
|
-
|
|
1607
|
-
if newchrs:
|
|
1608
|
-
return newchrs
|
|
1587
|
+
if re.match(r'^[a-zA-Z0-9]+$', name): return name # conversion not needed
|
|
1588
|
+
decoded_name = unidecode(name).strip()
|
|
1589
|
+
# remove any non-alphanumeric and non-underscore characters
|
|
1590
|
+
cleaned_name = re.sub(r'[^a-zA-Z0-9_]', '', decoded_name)
|
|
1591
|
+
if cleaned_name:
|
|
1592
|
+
return cleaned_name
|
|
1609
1593
|
else:
|
|
1610
1594
|
return default
|
|
1611
1595
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rda_python_common
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.49
|
|
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
3
|
rda_python_common/PgFile.py,sha256=obl9Pj3yFnjrOJUTFiEHK7ZbG2Ic_m3dT0NqO7rGvOs,99370
|
|
4
|
-
rda_python_common/PgLOG.py,sha256=
|
|
4
|
+
rda_python_common/PgLOG.py,sha256=RLcsUzHjPqkaoT_jJStG6PoUJzUe5i3NJ8T_bmFhAZA,55387
|
|
5
5
|
rda_python_common/PgLock.py,sha256=12i84nsGBuifSyPnm8IR63LvHvRuVU573D5QKFlHdOI,22623
|
|
6
6
|
rda_python_common/PgOPT.py,sha256=7eqERFMz2gkKIgHucjwxgBFE9mQ_mUsy_OlUqHyAHrw,56014
|
|
7
7
|
rda_python_common/PgSIG.py,sha256=t0yF2vnLgb6TKEBwIp7pEemvp-N29tjkLMoPETKgiZo,35797
|
|
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.
|
|
12
|
-
rda_python_common-1.0.
|
|
13
|
-
rda_python_common-1.0.
|
|
14
|
-
rda_python_common-1.0.
|
|
15
|
-
rda_python_common-1.0.
|
|
11
|
+
rda_python_common-1.0.49.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
|
|
12
|
+
rda_python_common-1.0.49.dist-info/METADATA,sha256=buXrFXMfaOMJ0eOCoJfNPzDLtVCPYinPU5F2uMn9avo,716
|
|
13
|
+
rda_python_common-1.0.49.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
rda_python_common-1.0.49.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
|
|
15
|
+
rda_python_common-1.0.49.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|