Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "rda_python_common"
version = "1.0.56"
version = "2.0.0"
authors = [
{ name="Zaihua Ji", email="[email protected]" },
]
Expand Down Expand Up @@ -33,3 +33,4 @@ pythonpath = [

[project.scripts]
pgpassword = "rda_python_common.pgpassword:main"
pg_pass = "rda_python_common.pg_pass:main"
2 changes: 1 addition & 1 deletion src/rda_python_common/PgLOG.py
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ def set_common_pglog():

SETPGLOG("TMPDIR", '')
if not PGLOG['TMPDIR']:
PGLOG['TMPDIR'] = "/lustre/desc1/gdex/scratch/" + PGLOG['CURUID']
PGLOG['TMPDIR'] = "/lustre/desc1/scratch/" + PGLOG['CURUID']
os.environ['TMPDIR'] = PGLOG['TMPDIR']

# empty diretory for HOST-sync
Expand Down
12 changes: 6 additions & 6 deletions src/rda_python_common/PgSIG.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ def check_daemon(aname, uname = None):
if uname:
check_vuser(uname, aname)
pcmd = "ps -u {} -f | grep {} | grep ' 1 '".format(uname, aname)
mp = "^\s*{}\s+(\d+)\s+1\s+".format(uname)
mp = r"^\s*{}\s+(\d+)\s+1\s+".format(uname)
else:
pcmd = "ps -C {} -f | grep ' 1 '".format(aname)
mp = "^\s*\w+\s+(\d+)\s+1\s+"
mp = r"^\s*\w+\s+(\d+)\s+1\s+"

buf = PgLOG.pgsystem(pcmd, PgLOG.LOGWRN, 20+1024)
if buf:
Expand All @@ -220,10 +220,10 @@ def check_application(aname, uname = None, sargv = None):
if uname:
check_vuser(uname, aname)
pcmd = "ps -u {} -f | grep {} | grep -v ' grep '".format(uname, aname)
mp = "^\s*{}\s+(\d+)\s+(\d+)\s+.*{}\S*\s+(.*)$".format(uname, aname)
mp = r"^\s*{}\s+(\d+)\s+(\d+)\s+.*{}\S*\s+(.*)$".format(uname, aname)
else:
pcmd = "ps -C {} -f".format(aname)
mp = "^\s*\w+\s+(\d+)\s+(\d+)\s+.*{}\S*\s+(.*)$".format(aname)
mp = r"^\s*\w+\s+(\d+)\s+(\d+)\s+.*{}\S*\s+(.*)$".format(aname)

buf = PgLOG.pgsystem(pcmd, PgLOG.LOGWRN, 20+1024)
if not buf: return 0
Expand Down Expand Up @@ -293,10 +293,10 @@ def check_multiple_application(aname, uname = None, sargv = None):
if uname:
check_vuser(uname, aname)
pcmd = "ps -u {} -f | grep {} | grep -v ' grep '".format(uname, aname)
mp = "^\s*{}\s+(\d+)\s+(\d+)\s+.*{}\S*\s+(.*)$".format(uname, aname)
mp = r"^\s*{}\s+(\d+)\s+(\d+)\s+.*{}\S*\s+(.*)$".format(uname, aname)
else:
pcmd = "ps -C {} -f".format(aname)
mp = "^\s*\w+\s+(\d+)\s+(\d+)\s+.*{}\S*\s+(.*)$".format(aname)
mp = r"^\s*\w+\s+(\d+)\s+(\d+)\s+.*{}\S*\s+(.*)$".format(aname)

buf = PgLOG.pgsystem(pcmd, PgLOG.LOGWRN, 20+1024)
if not buf: return 0
Expand Down
6 changes: 3 additions & 3 deletions src/rda_python_common/PgSplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# Author : Zaihua Ji, [email protected]
# Date : 09/010/2024
# 2025-01-10 transferred to package rda_python_common from
# https://github.com/NCAR/rda-shared-libraries.git
# Purpose : Python library module to handle query and manipulate table wfile
# https://github.com/NCAR/rßda-shared-libraries.git
# Purpose : Python library module to handle query and manß ipulate table wfile
#
# Github : https://github.com/NCAR/rda-python-common.git
#
Expand Down Expand Up @@ -106,7 +106,7 @@ def trim_wfile_fields(wfrecs):
def get_dsid_condition(dsid, condition):

if condition:
if re.search('(^|.| )(wid|dsid)\s*=', condition):
if re.search(r'(^|.| )(wid|dsid)\s*=', condition):
return condition
else:
dscnd = "wfile.dsid = '{}' ".format(dsid)
Expand Down
Loading