Skip to content

Commit

Permalink
Merge pull request #3 from NCAR/init-with-rda-ispd-python
Browse files Browse the repository at this point in the history
Init with rda ispd python
  • Loading branch information
zaihuaji authored Jan 14, 2025
2 parents 9fec26f + 568ceca commit 36c4892
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ jobs:
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --indent-size=3
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
80 changes: 0 additions & 80 deletions scripts/fill_ispddb.py

This file was deleted.

10 changes: 6 additions & 4 deletions src/rda_python_common/PgLOG.py
Original file line number Diff line number Diff line change
Expand Up @@ -1511,17 +1511,19 @@ def check_process_host(hosts, chost = None, mflag = None, pinfo = None, logact =
#
# convert special characters
#
def convert_chars(name, default = None):
def convert_chars(name, default = 'X'):

if not name: return default
if re.match(r'^[a-zA-Z0-9]+$', name): return name # no need convert

if not name or re.match(r'^[a-zA-Z0-9]+$', name): return name # no need convert

z = ord('z')
newchrs = ochrs = ''
if default == None: default = name
for i in range(len(name)):
ch = name[i]
if re.match(r'^[a-zA-Z0-9]$', ch):
newchrs += ch
elif (ch == ' ' or ch == '_') and newchrs:
newchrs += '_'
elif ord(ch) > z and ochrs != None:
if not ochrs:
ochrs = None
Expand Down

0 comments on commit 36c4892

Please sign in to comment.