diff --git a/src/rda_python_common/PgCMD.py b/src/rda_python_common/PgCMD.py index 9b678cc..c9b6e4c 100644 --- a/src/rda_python_common/PgCMD.py +++ b/src/rda_python_common/PgCMD.py @@ -4,11 +4,12 @@ # Title : PgCMD.py # Author : Zaihua Ji, zji@ucar.edu # Date : 08/25/2020 +# 2025-01-10 transferred to package rda_python_common from +# https://github.com/NCAR/rda-shared-libraries.git # Purpose : python library module for functions to record commands for delayed # mode or command recovery # -# Work File : $DSSHOME/lib/python/PgCMD.py -# Github : https://github.com/NCAR/rda-shared-libraries.git +# Github : https://github.com/NCAR/rda-python-common.git # ############################################################################### # @@ -16,11 +17,11 @@ import re import sys import time -import PgLOG -import PgSIG -import PgUtil -import PgLock -import PgDBI +from . import PgLOG +from . import PgSIG +from . import PgUtil +from . import PgLock +from . import PgDBI # cached dscheck info DSCHK = {} diff --git a/src/rda_python_common/PgDBI.py b/src/rda_python_common/PgDBI.py index a0bf759..840abd5 100644 --- a/src/rda_python_common/PgDBI.py +++ b/src/rda_python_common/PgDBI.py @@ -4,10 +4,11 @@ # Title : PgDBI.py -- PostgreSQL DataBase Interface # Author : Zaihua Ji, zji@ucar.edu # Date : 06/07/2022 +# 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 PostgreSQL database # -# Work File : $DSSHOME/lib/python/PgDBI.py -# Github : https://github.com/NCAR/rda-shared-libraries.git +# Github : https://github.com/NCAR/rda-python-common.git # ############################################################################### @@ -19,7 +20,7 @@ from psycopg2.extras import execute_values from psycopg2.extras import execute_batch from os import path as op -import PgLOG +from . import PgLOG pgdb = None # reference to a connected database object curtran = 0 # 0 - no transaction, 1 - in transaction diff --git a/src/rda_python_common/PgFile.py b/src/rda_python_common/PgFile.py index b7b01d0..49bf4ae 100644 --- a/src/rda_python_common/PgFile.py +++ b/src/rda_python_common/PgFile.py @@ -4,11 +4,12 @@ # Title : PgFile.py # Author : Zaihua Ji, zji@ucar.edu # Date : 08/05/2020 +# 2025-01-10 transferred to package rda_python_common from +# https://github.com/NCAR/rda-shared-libraries.git # Purpose : python library module to copy, move and delete data files locally # and remotely # -# Work File : $DSSHOME/lib/python/PgFile.py -# Github : https://github.com/NCAR/rda-shared-libraries.git +# Github : https://github.com/NCAR/rda-python_common.git # ############################################################################### # @@ -22,10 +23,10 @@ import time import glob import json -import PgLOG -import PgUtil -import PgSIG -import PgDBI +from . import PgLOG +from . import PgUtil +from . import PgSIG +from . import PgDBI CMDBTH = (0x0033) # return both stdout and stderr, 16 + 32 + 2 + 1 RETBTH = (0x0030) # return both stdout and stderr, 16 + 32 diff --git a/src/rda_python_common/PgGLBS.py b/src/rda_python_common/PgGLBS.py index 70a9fc0..1df96f4 100644 --- a/src/rda_python_common/PgGLBS.py +++ b/src/rda_python_common/PgGLBS.py @@ -4,21 +4,23 @@ # Title : PgGLBS.py # Author : Thomas Cram, tcram@ucar.edu # Date : 12/10/2014 -# Purpose : python library module for Globus functions and utilities -# Changes : 10/10/2020, Zaihua Ji, zji@ucar.edu: +# 10/10/2020, Zaihua Ji, zji@ucar.edu: # converted from perl package to python module +# 2025-01-10, Zaihua Ji, zji@ucar.edu: +# transferred to package rda_python_common from +# https://github.com/NCAR/rda-shared-libraries.git +# Purpose : python library module for Globus functions and utilities # -# Work File : $DSSHOME/lib/python/PgGLBS.py -# Github : https://github.com/NCAR/rda-shared-libraries.git +# Github : https://github.com/NCAR/rda-python-common.git # ############################################################################### # import os import re -import PgLOG -import PgUtil +from . import PgLOG +from . import PgUtil from MyGlobus import MyGlobus, MyEndpoints, GLOBUS_REQUEST_DOMAIN -import PgDBI +from . import PgDBI try: from urllib.parse import urlencode diff --git a/src/rda_python_common/PgLOG.py b/src/rda_python_common/PgLOG.py index 7d3b81f..a69d29d 100644 --- a/src/rda_python_common/PgLOG.py +++ b/src/rda_python_common/PgLOG.py @@ -4,12 +4,13 @@ # Title : PgLOG.py -- Module for logging messages. # Author : Zaihua Ji, zji@ucar.edu # Date : 03/02/2016 +# 2025-01-10 transferred to package rda_python_common from +# https://github.com/NCAR/rda-shared-libraries.git # Purpose : Python library module to log message and also do other things # according to the value of logact, like display the error # message on screen and exit script # -# Work File : $DSSHOME/lib/python/PgLOG.py -# Github : https://github.com/NCAR/rda-shared-libraries.git +# Github : https://github.com/NCAR/rda-python-common.git # ############################################################################### diff --git a/src/rda_python_common/PgLock.py b/src/rda_python_common/PgLock.py index 319e2dc..57d1cc0 100644 --- a/src/rda_python_common/PgLock.py +++ b/src/rda_python_common/PgLock.py @@ -4,20 +4,21 @@ # Title : PgLock.py # Author : Zaihua Ji, zji@ucar.edu # Date : 08/118/2020 +# 2025-01-10 transferred to package rda_python_common from +# https://github.com/NCAR/rda-shared-libraries.git # Purpose : python library module for functions to lock RDADB records # -# Work File : $DSSHOME/lib/python/PgLock.py -# Github : https://github.com/NCAR/rda-shared-libraries.git +# Github : https://github.com/NCAR/rda-python-common.git # ############################################################################### # import re import time -import PgLOG -import PgSIG -import PgUtil -import PgFile -import PgDBI +from . import PgLOG +from . import PgSIG +from . import PgUtil +from . import PgFile +from . import PgDBI DOLOCKS = {-2 : 'Force Unlock', -1 : 'Unlock', 0 : 'Unlock', 1 : 'Relock', 2 : 'Force Relock'} diff --git a/src/rda_python_common/PgOPT.py b/src/rda_python_common/PgOPT.py index 666db57..b60cddd 100644 --- a/src/rda_python_common/PgOPT.py +++ b/src/rda_python_common/PgOPT.py @@ -5,11 +5,12 @@ # # Author : Zaihua Ji, zji@ucar.edu # Date : 08/26/2020 +# 2025-01-10 transferred to package rda_python_common from +# https://github.com/NCAR/rda-shared-libraries.git # Purpose : python library module for holding global varaibles # functions for processing options and other global functions # -# Work File : $DSSHOME/lib/python/PgOPT.py -# Github : https://github.com/NCAR/rda-shared-libraries.git +# Github : https://github.com/NCAR/rda-pyhon-common.git # ############################################################################### # @@ -18,10 +19,10 @@ import re import time from os import path as op -import PgLOG -import PgUtil -import PgFile -import PgDBI +from . import PgLOG +from . import PgUtil +from . import PgFile +from . import PgDBI OUTPUT = None CMDOPTS = {} diff --git a/src/rda_python_common/PgPGS.py b/src/rda_python_common/PgPGS.py index f6eb607..1104ad7 100644 --- a/src/rda_python_common/PgPGS.py +++ b/src/rda_python_common/PgPGS.py @@ -4,17 +4,18 @@ # Title : PgPGS.py -- PostgreSQL Interface for CDP DataBase Per psql # Author : Zaihua Ji, zji@ucar.edu # Date : 08/31/2020 +# 2025-01-10 transferred to package rda_python_common from +# https://github.com/NCAR/rda-shared-libraries.git # Purpose : python library module to handle sql scripts to retrieve info # from cdp database per psql # -# Work File : $DSSHOME/lib/python/PgPGS.py -# Github : https://github.com/NCAR/rda-shared-libraries.git +# Github : https://github.com/NCAR/rda-python-common.git # ############################################################################### # -import PgLOG import os import re +from . import PgLOG PGPGS = {} PGPGS["PGSSERV"] = PgLOG.get_environment("PGSSERV", '-h vetsdbprod -p 5432 -U acadmin access_control'); diff --git a/src/rda_python_common/PgSIG.py b/src/rda_python_common/PgSIG.py index 3b366f0..121a420 100644 --- a/src/rda_python_common/PgSIG.py +++ b/src/rda_python_common/PgSIG.py @@ -5,10 +5,11 @@ # # Author : Zaihua Ji, zji@ucar.edu # Date : 08/05/2020 +# 2025-01-10 transferred to package rda_python_common from +# https://github.com/NCAR/rda-shared-libraries.git # Purpose : python library module for start and control daemon process # -# Work File : $DSSHOME/lib/python/PgSIG.py -# Github : https://github.com/NCAR/rda-shared-libraries.git +# Github : https://github.com/NCAR/rda-python-common.git # ############################################################################### # @@ -19,8 +20,8 @@ import signal import time from contextlib import contextmanager -import PgLOG -import PgDBI +from . import PgLOG +from . import PgDBI VUSERS = [] # allow users to start this daemon CPIDS = {} # allow upto 'mproc' processes at one time for daemon diff --git a/src/rda_python_common/PgSplit.py b/src/rda_python_common/PgSplit.py index 333a83c..2f19297 100644 --- a/src/rda_python_common/PgSplit.py +++ b/src/rda_python_common/PgSplit.py @@ -4,19 +4,20 @@ # Title : PgSplit.py -- PostgreSQL DataBase Interface foe table wfile # Author : Zaihua Ji, zji@ucar.edu # 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 # -# Work File : $DSSHOME/lib/python/PgSplit.py -# Github : https://github.com/NCAR/rda-shared-libraries.git +# Github : https://github.com/NCAR/rda-python-common.git # ############################################################################### import os import re from os import path as op -import PgLOG -import PgDBI -import PgUtil +from . import PgLOG +from . import PgDBI +from . import PgUtil # # compare wfile records between tables wfile and wfile_dNNNNNN, diff --git a/src/rda_python_common/PgUtil.py b/src/rda_python_common/PgUtil.py index 3b2b7fa..fc0ab28 100644 --- a/src/rda_python_common/PgUtil.py +++ b/src/rda_python_common/PgUtil.py @@ -4,10 +4,11 @@ # Title : PgUtil.py -- module for misc utilities. # Author : Zaihua Ji, zji@ucar.edu # Date : 07/27/2020 +# 2025-01-10 transferred to package rda_python_common from +# https://github.com/NCAR/rda-shared-libraries.git # Purpose : python library module for global misc utilities # -# Work File : $DSSHOME/lib/python/PgUtil.py -# Github : https://github.com/NCAR/rda-shared-libraries.git +# Github : https://github.com/NCAR/rda-python-common.git # ############################################################################### #