rda-python-common 1.0.42__py3-none-any.whl → 1.0.44__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rda-python-common might be problematic. Click here for more details.
- rda_python_common/PgFile.py +18 -3
- rda_python_common/PgLOG.py +1 -0
- {rda_python_common-1.0.42.dist-info → rda_python_common-1.0.44.dist-info}/METADATA +1 -1
- {rda_python_common-1.0.42.dist-info → rda_python_common-1.0.44.dist-info}/RECORD +7 -7
- {rda_python_common-1.0.42.dist-info → rda_python_common-1.0.44.dist-info}/WHEEL +0 -0
- {rda_python_common-1.0.42.dist-info → rda_python_common-1.0.44.dist-info}/licenses/LICENSE +0 -0
- {rda_python_common-1.0.42.dist-info → rda_python_common-1.0.44.dist-info}/top_level.txt +0 -0
rda_python_common/PgFile.py
CHANGED
|
@@ -1636,7 +1636,10 @@ def local_file_stat(file, fstat, opt, logact):
|
|
|
1636
1636
|
|
|
1637
1637
|
info = {}
|
|
1638
1638
|
info['isfile'] = (1 if stat.S_ISREG(fstat.st_mode) else 0)
|
|
1639
|
-
info['
|
|
1639
|
+
if info['isfile'] == 0 and logact&PgLOG.PFSIZE:
|
|
1640
|
+
info['data_size'] = local_path_size(file)
|
|
1641
|
+
else:
|
|
1642
|
+
info['data_size'] = fstat.st_size
|
|
1640
1643
|
info['fname'] = op.basename(file)
|
|
1641
1644
|
if not opt: return info
|
|
1642
1645
|
if opt&64 and info['isfile'] and info['data_size'] < PgLOG.PGLOG['MINSIZE']:
|
|
@@ -1665,6 +1668,18 @@ def local_file_stat(file, fstat, opt, logact):
|
|
|
1665
1668
|
|
|
1666
1669
|
return info
|
|
1667
1670
|
|
|
1671
|
+
#
|
|
1672
|
+
# get total size of files under a given path
|
|
1673
|
+
#
|
|
1674
|
+
def local_path_size(pname):
|
|
1675
|
+
|
|
1676
|
+
if not pname: pname = '.' # To get size of current directory
|
|
1677
|
+
size = 0
|
|
1678
|
+
for path, dirs, files in os.walk(pname):
|
|
1679
|
+
for f in files:
|
|
1680
|
+
size += os.path.getsize(os.path.join(path, f))
|
|
1681
|
+
return size
|
|
1682
|
+
|
|
1668
1683
|
#
|
|
1669
1684
|
# check and get file status information of a file on remote host
|
|
1670
1685
|
#
|
|
@@ -2557,11 +2572,11 @@ def rda_file_size(file, host, opt = 0, logact = 0):
|
|
|
2557
2572
|
#
|
|
2558
2573
|
def local_file_size(file, opt = 0, logact = 0):
|
|
2559
2574
|
|
|
2560
|
-
if not op.
|
|
2575
|
+
if not op.exists(file):
|
|
2561
2576
|
if opt&4: lmsg(file, PgLOG.PGLOG['MISSFILE'], logact)
|
|
2562
2577
|
return -1 # file not eixsts
|
|
2563
2578
|
|
|
2564
|
-
info = check_local_file(file, 0, logact)
|
|
2579
|
+
info = check_local_file(file, 0, logact|PgLOG.PFSIZE)
|
|
2565
2580
|
if info:
|
|
2566
2581
|
if info['isfile'] and info['data_size'] < PgLOG.PGLOG['MINSIZE']:
|
|
2567
2582
|
if opt:
|
rda_python_common/PgLOG.py
CHANGED
|
@@ -67,6 +67,7 @@ ADDTBL = (0x200000) # action to add a new table if it does not exist
|
|
|
67
67
|
SKPTRC = (0x400000) # action to skip tracing when log errors
|
|
68
68
|
UCNAME = (0x800000) # action to change query field names to upper case
|
|
69
69
|
UCLWEX = (0x800015) # UCNAME|MSGLOG|WARNLG|EXITLG
|
|
70
|
+
PFSIZE = (0x1000000) # total file size under a path
|
|
70
71
|
|
|
71
72
|
SUCCESS = 1 # Successful function call
|
|
72
73
|
FINISH = 2 # go through a function, including time out
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rda_python_common
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.44
|
|
4
4
|
Summary: RDA Python common library codes shared by other RDA python packages
|
|
5
5
|
Author-email: Zaihua Ji <zji@ucar.edu>
|
|
6
6
|
Project-URL: Homepage, https://github.com/NCAR/rda-python-common
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
rda_python_common/PgCMD.py,sha256=EYjG2Z4zEnvsXE1z-jt5UaNoEKxnOYYiMMzvW6HrKA4,20597
|
|
2
2
|
rda_python_common/PgDBI.py,sha256=nAov-B-B9XZ7p7rX1ZU4TcjAItSXVq18yD0Xe80TkwY,74962
|
|
3
|
-
rda_python_common/PgFile.py,sha256=
|
|
4
|
-
rda_python_common/PgLOG.py,sha256=
|
|
3
|
+
rda_python_common/PgFile.py,sha256=yAYpk_U3xGKwrGQXhM7Zy9bvyV-tCwCrYr1OSNcX2Pw,98905
|
|
4
|
+
rda_python_common/PgLOG.py,sha256=5Ac9DydzJbZSzoOseQWw4trEUAI4sWXblDpYWCkouPo,55449
|
|
5
5
|
rda_python_common/PgLock.py,sha256=12i84nsGBuifSyPnm8IR63LvHvRuVU573D5QKFlHdOI,22623
|
|
6
6
|
rda_python_common/PgOPT.py,sha256=Q0e5dhfhOw8ha7y28s3SS8xBk_kdHSWjC8JfC--2rvU,56012
|
|
7
7
|
rda_python_common/PgSIG.py,sha256=ZVM9Qz6yIFurwIQJtV5-CFbKOTdFsZ-Rs95SEpDFgNk,35795
|
|
8
8
|
rda_python_common/PgSplit.py,sha256=QKPbF55m8KCTGmwVwL3uG_nuylCC4FSVfLuXeLjJHbE,8816
|
|
9
9
|
rda_python_common/PgUtil.py,sha256=OqESKCd72b9g8m8jwjPJhXDtPYlW6G8oSOhwChvz2Cg,48600
|
|
10
10
|
rda_python_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
rda_python_common-1.0.
|
|
12
|
-
rda_python_common-1.0.
|
|
13
|
-
rda_python_common-1.0.
|
|
14
|
-
rda_python_common-1.0.
|
|
15
|
-
rda_python_common-1.0.
|
|
11
|
+
rda_python_common-1.0.44.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
|
|
12
|
+
rda_python_common-1.0.44.dist-info/METADATA,sha256=zPzyedrVtoTcpAxvcDR_znVIZmOk2XK7kKAwSjuR3Nk,716
|
|
13
|
+
rda_python_common-1.0.44.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
rda_python_common-1.0.44.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
|
|
15
|
+
rda_python_common-1.0.44.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|