rda-python-common 1.0.43__py3-none-any.whl → 1.0.45__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 +16 -11
- rda_python_common/PgLOG.py +2 -1
- {rda_python_common-1.0.43.dist-info → rda_python_common-1.0.45.dist-info}/METADATA +1 -1
- {rda_python_common-1.0.43.dist-info → rda_python_common-1.0.45.dist-info}/RECORD +7 -7
- {rda_python_common-1.0.43.dist-info → rda_python_common-1.0.45.dist-info}/WHEEL +0 -0
- {rda_python_common-1.0.43.dist-info → rda_python_common-1.0.45.dist-info}/licenses/LICENSE +0 -0
- {rda_python_common-1.0.43.dist-info → rda_python_common-1.0.45.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']:
|
|
@@ -1661,7 +1664,7 @@ def local_file_stat(file, fstat, opt, logact):
|
|
|
1661
1664
|
if opt&8:
|
|
1662
1665
|
info['gid'] = fstat.st_gid
|
|
1663
1666
|
info['group'] = grp.getgrgid(info['gid']).gr_name
|
|
1664
|
-
if opt&32: info['checksum'] = get_md5sum(file, 0, logact)
|
|
1667
|
+
if opt&32 and info['isfile']: info['checksum'] = get_md5sum(file, 0, logact)
|
|
1665
1668
|
|
|
1666
1669
|
return info
|
|
1667
1670
|
|
|
@@ -2302,16 +2305,18 @@ def get_md5sum(file, count = 0, logact = 0):
|
|
|
2302
2305
|
if count > 0:
|
|
2303
2306
|
checksum = [None]*count
|
|
2304
2307
|
for i in range(count):
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2308
|
+
if op.isfile(file[i]):
|
|
2309
|
+
chksm = PgLOG.pgsystem(cmd + file[i], logact, 20)
|
|
2310
|
+
if chksm:
|
|
2311
|
+
ms = re.search(r'(\w{32})', chksm)
|
|
2312
|
+
if ms: checksum[i] = ms.group(1)
|
|
2309
2313
|
else:
|
|
2310
|
-
chksm = PgLOG.pgsystem(cmd + file, logact, 20)
|
|
2311
2314
|
checksum = None
|
|
2312
|
-
if
|
|
2313
|
-
|
|
2314
|
-
if
|
|
2315
|
+
if op.isfile(file):
|
|
2316
|
+
chksm = PgLOG.pgsystem(cmd + file, logact, 20)
|
|
2317
|
+
if chksm:
|
|
2318
|
+
ms = re.search(r'(\w{32})', chksm)
|
|
2319
|
+
if ms: checksum = ms.group(1)
|
|
2315
2320
|
|
|
2316
2321
|
return checksum
|
|
2317
2322
|
|
|
@@ -2573,7 +2578,7 @@ def local_file_size(file, opt = 0, logact = 0):
|
|
|
2573
2578
|
if opt&4: lmsg(file, PgLOG.PGLOG['MISSFILE'], logact)
|
|
2574
2579
|
return -1 # file not eixsts
|
|
2575
2580
|
|
|
2576
|
-
info = check_local_file(file, 0, logact)
|
|
2581
|
+
info = check_local_file(file, 0, logact|PgLOG.PFSIZE)
|
|
2577
2582
|
if info:
|
|
2578
2583
|
if info['isfile'] and info['data_size'] < PgLOG.PGLOG['MINSIZE']:
|
|
2579
2584
|
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
|
|
@@ -473,7 +474,7 @@ def write_message(msg, file, logact):
|
|
|
473
474
|
if logact&BRKLIN: OUT.write("\n")
|
|
474
475
|
if logact&SEPLIN: OUT.write(PGLOG['SEPLINE'])
|
|
475
476
|
OUT.write(msg)
|
|
476
|
-
if errlog and not logact&(EMLALL|SKPTRC): OUT.write(get_call_trace())
|
|
477
|
+
if errlog and file and not logact&(EMLALL|SKPTRC): OUT.write(get_call_trace())
|
|
477
478
|
if doclose: OUT.close()
|
|
478
479
|
|
|
479
480
|
#
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rda_python_common
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.45
|
|
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=CJqMlUzR47JkTRBsAWwfY-Fl_3IED-u5HuR19EtdDuo,99006
|
|
4
|
+
rda_python_common/PgLOG.py,sha256=oZhZc18MdGTBimL4ggCWJbX_PwPK2uPmq1X-ZVhsTR4,55458
|
|
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.45.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
|
|
12
|
+
rda_python_common-1.0.45.dist-info/METADATA,sha256=11wVhDAL3YtGCOVJfCgjLwYj9CJyM4XIHeXeX4Tp0PA,716
|
|
13
|
+
rda_python_common-1.0.45.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
rda_python_common-1.0.45.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
|
|
15
|
+
rda_python_common-1.0.45.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|