Skip to content

Commit 36c4892

Browse files
authored
Merge pull request #3 from NCAR/init-with-rda-ispd-python
Init with rda ispd python
2 parents 9fec26f + 568ceca commit 36c4892

File tree

3 files changed

+7
-85
lines changed

3 files changed

+7
-85
lines changed

.github/workflows/python-app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ jobs:
3131
- name: Lint with flake8
3232
run: |
3333
# stop the build if there are Python syntax errors or undefined names
34-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --indent-size=3
3535
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3636
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

scripts/fill_ispddb.py

Lines changed: 0 additions & 80 deletions
This file was deleted.

src/rda_python_common/PgLOG.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,17 +1511,19 @@ def check_process_host(hosts, chost = None, mflag = None, pinfo = None, logact =
15111511
#
15121512
# convert special characters
15131513
#
1514-
def convert_chars(name, default = None):
1514+
def convert_chars(name, default = 'X'):
1515+
1516+
if not name: return default
1517+
if re.match(r'^[a-zA-Z0-9]+$', name): return name # no need convert
15151518

1516-
if not name or re.match(r'^[a-zA-Z0-9]+$', name): return name # no need convert
1517-
15181519
z = ord('z')
15191520
newchrs = ochrs = ''
1520-
if default == None: default = name
15211521
for i in range(len(name)):
15221522
ch = name[i]
15231523
if re.match(r'^[a-zA-Z0-9]$', ch):
15241524
newchrs += ch
1525+
elif (ch == ' ' or ch == '_') and newchrs:
1526+
newchrs += '_'
15251527
elif ord(ch) > z and ochrs != None:
15261528
if not ochrs:
15271529
ochrs = None

0 commit comments

Comments
 (0)