Skip to content

Commit 9e66994

Browse files
author
zaihuaji
committed
add from . to import local modile
1 parent 4abfc19 commit 9e66994

File tree

11 files changed

+64
-52
lines changed

11 files changed

+64
-52
lines changed

src/rda_python_common/PgCMD.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,24 @@
44
# Title : PgCMD.py
55
# Author : Zaihua Ji, zji@ucar.edu
66
# Date : 08/25/2020
7+
# 2025-01-10 transferred to package rda_python_common from
8+
# https://github.com/NCAR/rda-shared-libraries.git
79
# Purpose : python library module for functions to record commands for delayed
810
# mode or command recovery
911
#
10-
# Work File : $DSSHOME/lib/python/PgCMD.py
11-
# Github : https://github.com/NCAR/rda-shared-libraries.git
12+
# Github : https://github.com/NCAR/rda-python-common.git
1213
#
1314
###############################################################################
1415
#
1516
import os
1617
import re
1718
import sys
1819
import time
19-
import PgLOG
20-
import PgSIG
21-
import PgUtil
22-
import PgLock
23-
import PgDBI
20+
from . import PgLOG
21+
from . import PgSIG
22+
from . import PgUtil
23+
from . import PgLock
24+
from . import PgDBI
2425

2526
# cached dscheck info
2627
DSCHK = {}

src/rda_python_common/PgDBI.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
# Title : PgDBI.py -- PostgreSQL DataBase Interface
55
# Author : Zaihua Ji, zji@ucar.edu
66
# Date : 06/07/2022
7+
# 2025-01-10 transferred to package rda_python_common from
8+
# https://github.com/NCAR/rda-shared-libraries.git
79
# Purpose : Python library module to handle query and manipulate PostgreSQL database
810
#
9-
# Work File : $DSSHOME/lib/python/PgDBI.py
10-
# Github : https://github.com/NCAR/rda-shared-libraries.git
11+
# Github : https://github.com/NCAR/rda-python-common.git
1112
#
1213
###############################################################################
1314

@@ -19,7 +20,7 @@
1920
from psycopg2.extras import execute_values
2021
from psycopg2.extras import execute_batch
2122
from os import path as op
22-
import PgLOG
23+
from . import PgLOG
2324

2425
pgdb = None # reference to a connected database object
2526
curtran = 0 # 0 - no transaction, 1 - in transaction

src/rda_python_common/PgFile.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
# Title : PgFile.py
55
# Author : Zaihua Ji, zji@ucar.edu
66
# Date : 08/05/2020
7+
# 2025-01-10 transferred to package rda_python_common from
8+
# https://github.com/NCAR/rda-shared-libraries.git
79
# Purpose : python library module to copy, move and delete data files locally
810
# and remotely
911
#
10-
# Work File : $DSSHOME/lib/python/PgFile.py
11-
# Github : https://github.com/NCAR/rda-shared-libraries.git
12+
# Github : https://github.com/NCAR/rda-python_common.git
1213
#
1314
###############################################################################
1415
#
@@ -22,10 +23,10 @@
2223
import time
2324
import glob
2425
import json
25-
import PgLOG
26-
import PgUtil
27-
import PgSIG
28-
import PgDBI
26+
from . import PgLOG
27+
from . import PgUtil
28+
from . import PgSIG
29+
from . import PgDBI
2930

3031
CMDBTH = (0x0033) # return both stdout and stderr, 16 + 32 + 2 + 1
3132
RETBTH = (0x0030) # return both stdout and stderr, 16 + 32

src/rda_python_common/PgGLBS.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,23 @@
44
# Title : PgGLBS.py
55
# Author : Thomas Cram, tcram@ucar.edu
66
# Date : 12/10/2014
7-
# Purpose : python library module for Globus functions and utilities
8-
# Changes : 10/10/2020, Zaihua Ji, zji@ucar.edu:
7+
# 10/10/2020, Zaihua Ji, zji@ucar.edu:
98
# converted from perl package to python module
9+
# 2025-01-10, Zaihua Ji, zji@ucar.edu:
10+
# transferred to package rda_python_common from
11+
# https://github.com/NCAR/rda-shared-libraries.git
12+
# Purpose : python library module for Globus functions and utilities
1013
#
11-
# Work File : $DSSHOME/lib/python/PgGLBS.py
12-
# Github : https://github.com/NCAR/rda-shared-libraries.git
14+
# Github : https://github.com/NCAR/rda-python-common.git
1315
#
1416
###############################################################################
1517
#
1618
import os
1719
import re
18-
import PgLOG
19-
import PgUtil
20+
from . import PgLOG
21+
from . import PgUtil
2022
from MyGlobus import MyGlobus, MyEndpoints, GLOBUS_REQUEST_DOMAIN
21-
import PgDBI
23+
from . import PgDBI
2224

2325
try:
2426
from urllib.parse import urlencode

src/rda_python_common/PgLOG.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
# Title : PgLOG.py -- Module for logging messages.
55
# Author : Zaihua Ji, zji@ucar.edu
66
# Date : 03/02/2016
7+
# 2025-01-10 transferred to package rda_python_common from
8+
# https://github.com/NCAR/rda-shared-libraries.git
79
# Purpose : Python library module to log message and also do other things
810
# according to the value of logact, like display the error
911
# message on screen and exit script
1012
#
11-
# Work File : $DSSHOME/lib/python/PgLOG.py
12-
# Github : https://github.com/NCAR/rda-shared-libraries.git
13+
# Github : https://github.com/NCAR/rda-python-common.git
1314
#
1415
###############################################################################
1516

src/rda_python_common/PgLock.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@
44
# Title : PgLock.py
55
# Author : Zaihua Ji, zji@ucar.edu
66
# Date : 08/118/2020
7+
# 2025-01-10 transferred to package rda_python_common from
8+
# https://github.com/NCAR/rda-shared-libraries.git
79
# Purpose : python library module for functions to lock RDADB records
810
#
9-
# Work File : $DSSHOME/lib/python/PgLock.py
10-
# Github : https://github.com/NCAR/rda-shared-libraries.git
11+
# Github : https://github.com/NCAR/rda-python-common.git
1112
#
1213
###############################################################################
1314
#
1415
import re
1516
import time
16-
import PgLOG
17-
import PgSIG
18-
import PgUtil
19-
import PgFile
20-
import PgDBI
17+
from . import PgLOG
18+
from . import PgSIG
19+
from . import PgUtil
20+
from . import PgFile
21+
from . import PgDBI
2122

2223
DOLOCKS = {-2 : 'Force Unlock', -1 : 'Unlock', 0 : 'Unlock', 1 : 'Relock', 2 : 'Force Relock'}
2324

src/rda_python_common/PgOPT.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
#
66
# Author : Zaihua Ji, zji@ucar.edu
77
# Date : 08/26/2020
8+
# 2025-01-10 transferred to package rda_python_common from
9+
# https://github.com/NCAR/rda-shared-libraries.git
810
# Purpose : python library module for holding global varaibles
911
# functions for processing options and other global functions
1012
#
11-
# Work File : $DSSHOME/lib/python/PgOPT.py
12-
# Github : https://github.com/NCAR/rda-shared-libraries.git
13+
# Github : https://github.com/NCAR/rda-pyhon-common.git
1314
#
1415
###############################################################################
1516
#
@@ -18,10 +19,10 @@
1819
import re
1920
import time
2021
from os import path as op
21-
import PgLOG
22-
import PgUtil
23-
import PgFile
24-
import PgDBI
22+
from . import PgLOG
23+
from . import PgUtil
24+
from . import PgFile
25+
from . import PgDBI
2526

2627
OUTPUT = None
2728
CMDOPTS = {}

src/rda_python_common/PgPGS.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
# Title : PgPGS.py -- PostgreSQL Interface for CDP DataBase Per psql
55
# Author : Zaihua Ji, zji@ucar.edu
66
# Date : 08/31/2020
7+
# 2025-01-10 transferred to package rda_python_common from
8+
# https://github.com/NCAR/rda-shared-libraries.git
79
# Purpose : python library module to handle sql scripts to retrieve info
810
# from cdp database per psql
911
#
10-
# Work File : $DSSHOME/lib/python/PgPGS.py
11-
# Github : https://github.com/NCAR/rda-shared-libraries.git
12+
# Github : https://github.com/NCAR/rda-python-common.git
1213
#
1314
###############################################################################
1415
#
15-
import PgLOG
1616
import os
1717
import re
18+
from . import PgLOG
1819

1920
PGPGS = {}
2021
PGPGS["PGSSERV"] = PgLOG.get_environment("PGSSERV", '-h vetsdbprod -p 5432 -U acadmin access_control');

src/rda_python_common/PgSIG.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
#
66
# Author : Zaihua Ji, zji@ucar.edu
77
# Date : 08/05/2020
8+
# 2025-01-10 transferred to package rda_python_common from
9+
# https://github.com/NCAR/rda-shared-libraries.git
810
# Purpose : python library module for start and control daemon process
911
#
10-
# Work File : $DSSHOME/lib/python/PgSIG.py
11-
# Github : https://github.com/NCAR/rda-shared-libraries.git
12+
# Github : https://github.com/NCAR/rda-python-common.git
1213
#
1314
###############################################################################
1415
#
@@ -19,8 +20,8 @@
1920
import signal
2021
import time
2122
from contextlib import contextmanager
22-
import PgLOG
23-
import PgDBI
23+
from . import PgLOG
24+
from . import PgDBI
2425

2526
VUSERS = [] # allow users to start this daemon
2627
CPIDS = {} # allow upto 'mproc' processes at one time for daemon

src/rda_python_common/PgSplit.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44
# Title : PgSplit.py -- PostgreSQL DataBase Interface foe table wfile
55
# Author : Zaihua Ji, zji@ucar.edu
66
# Date : 09/010/2024
7+
# 2025-01-10 transferred to package rda_python_common from
8+
# https://github.com/NCAR/rda-shared-libraries.git
79
# Purpose : Python library module to handle query and manipulate table wfile
810
#
9-
# Work File : $DSSHOME/lib/python/PgSplit.py
10-
# Github : https://github.com/NCAR/rda-shared-libraries.git
11+
# Github : https://github.com/NCAR/rda-python-common.git
1112
#
1213
###############################################################################
1314

1415
import os
1516
import re
1617
from os import path as op
17-
import PgLOG
18-
import PgDBI
19-
import PgUtil
18+
from . import PgLOG
19+
from . import PgDBI
20+
from . import PgUtil
2021

2122
#
2223
# compare wfile records between tables wfile and wfile_dNNNNNN,

0 commit comments

Comments
 (0)