rda-python-common 1.0.42__py3-none-any.whl → 1.0.43__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.

@@ -1636,7 +1636,7 @@ 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['data_size'] = fstat.st_size
1639
+ info['data_size'] = fstat.st_size if info['isfile'] else local_path_size(file)
1640
1640
  info['fname'] = op.basename(file)
1641
1641
  if not opt: return info
1642
1642
  if opt&64 and info['isfile'] and info['data_size'] < PgLOG.PGLOG['MINSIZE']:
@@ -1665,6 +1665,18 @@ def local_file_stat(file, fstat, opt, logact):
1665
1665
 
1666
1666
  return info
1667
1667
 
1668
+ #
1669
+ # get total size of files under a given path
1670
+ #
1671
+ def local_path_size(pname):
1672
+
1673
+ if not pname: pname = '.' # To get size of current directory
1674
+ size = 0
1675
+ for path, dirs, files in os.walk(pname):
1676
+ for f in files:
1677
+ size += os.path.getsize(os.path.join(path, f))
1678
+ return size
1679
+
1668
1680
  #
1669
1681
  # check and get file status information of a file on remote host
1670
1682
  #
@@ -2557,7 +2569,7 @@ def rda_file_size(file, host, opt = 0, logact = 0):
2557
2569
  #
2558
2570
  def local_file_size(file, opt = 0, logact = 0):
2559
2571
 
2560
- if not op.isfile(file):
2572
+ if not op.exists(file):
2561
2573
  if opt&4: lmsg(file, PgLOG.PGLOG['MISSFILE'], logact)
2562
2574
  return -1 # file not eixsts
2563
2575
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 1.0.42
3
+ Version: 1.0.43
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,6 +1,6 @@
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=gJuzBxLRYo3HQyNW1WNYDsQWRei2cco9bYEb6uOL8Ds,98487
3
+ rda_python_common/PgFile.py,sha256=iVTgGX5WyUtphCAXiDc-JEIxvfH3W1hRh89huezdJzs,98827
4
4
  rda_python_common/PgLOG.py,sha256=g4v3sJnpeQyz4JxUMoPiKCf47NIGGg85jzWPIVzMd9g,55396
5
5
  rda_python_common/PgLock.py,sha256=12i84nsGBuifSyPnm8IR63LvHvRuVU573D5QKFlHdOI,22623
6
6
  rda_python_common/PgOPT.py,sha256=Q0e5dhfhOw8ha7y28s3SS8xBk_kdHSWjC8JfC--2rvU,56012
@@ -8,8 +8,8 @@ rda_python_common/PgSIG.py,sha256=ZVM9Qz6yIFurwIQJtV5-CFbKOTdFsZ-Rs95SEpDFgNk,35
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.42.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
12
- rda_python_common-1.0.42.dist-info/METADATA,sha256=lXJssYfgnZ2bn46SAcNv-bnRuGbjG10bpluLDYRKjb0,716
13
- rda_python_common-1.0.42.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- rda_python_common-1.0.42.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
15
- rda_python_common-1.0.42.dist-info/RECORD,,
11
+ rda_python_common-1.0.43.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
12
+ rda_python_common-1.0.43.dist-info/METADATA,sha256=4VkARzFwR3ev_B5ciO_i4Ub4dDJXdwoSecOh3sGw1-g,716
13
+ rda_python_common-1.0.43.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ rda_python_common-1.0.43.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
15
+ rda_python_common-1.0.43.dist-info/RECORD,,