reykit 1.1.75__py3-none-any.whl → 1.1.78__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.
reykit/ros.py CHANGED
@@ -63,7 +63,7 @@ __all__ = (
63
63
  'Folder',
64
64
  'TempFile',
65
65
  'TempFolder',
66
- 'FileCache',
66
+ 'FileStore',
67
67
  'doc_to_docx',
68
68
  'extract_docx_content',
69
69
  'extract_pdf_content',
@@ -1922,13 +1922,13 @@ class TempFolder(Base):
1922
1922
  __add__ = __radd__ = join
1923
1923
 
1924
1924
 
1925
- class FileCache(Base):
1925
+ class FileStore(Base):
1926
1926
  """
1927
- File cache type.
1927
+ File Store type.
1928
1928
  """
1929
1929
 
1930
1930
 
1931
- def __init__(self, path: str = 'cache') -> None:
1931
+ def __init__(self, path: str = 'file') -> None:
1932
1932
  """
1933
1933
  Build instance attributes.
1934
1934
 
@@ -1947,31 +1947,36 @@ class FileCache(Base):
1947
1947
  def __make_dir(self) -> None:
1948
1948
  """
1949
1949
  Make cache directory and subdirectories.
1950
+ When root directory exists, then not make.
1950
1951
  """
1951
1952
 
1952
- # Make.
1953
- chars = '0123456789abcdef'
1953
+ # Exist.
1954
+ if self.folder:
1955
+ return
1954
1956
 
1955
- ## Root.
1957
+ # Handle parameter.
1958
+ chars = '0123456789abcdef'
1959
+ subdir_names = [
1960
+ char1 + char2
1961
+ for char1 in chars
1962
+ for char2 in chars
1963
+ ]
1956
1964
  paths = [self.folder.path]
1957
-
1958
- ## Second layer.
1959
1965
  paths.extend(
1960
1966
  [
1961
- self.folder + char
1962
- for char in chars
1967
+ self.folder + name
1968
+ for name in subdir_names
1963
1969
  ]
1964
1970
  )
1965
-
1966
- ## Third layer.
1967
1971
  paths.extend(
1968
1972
  [
1969
- self.folder + f'{char}/{char_sub}'
1970
- for char in chars
1971
- for char_sub in chars
1973
+ self.folder + f'{name1}/{name2}'
1974
+ for name1 in subdir_names
1975
+ for name2 in subdir_names
1972
1976
  ]
1973
1977
  )
1974
1978
 
1979
+ # Make.
1975
1980
  make_dir(*paths)
1976
1981
 
1977
1982
 
@@ -1995,7 +2000,7 @@ class FileCache(Base):
1995
2000
  name = name or md5
1996
2001
 
1997
2002
  # Not exist md5.
1998
- md5_relpath = f'{md5[0]}/{md5[1]}/{md5}'
2003
+ md5_relpath = f'{md5[:2]}/{md5[2:4]}/{md5}'
1999
2004
  if md5_relpath not in self.folder:
2000
2005
  return
2001
2006
 
@@ -2051,7 +2056,7 @@ class FileCache(Base):
2051
2056
  return path
2052
2057
 
2053
2058
  # Store.
2054
- md5_relpath = f'{file_md5[0]}/{file_md5[1]}/{file_md5}'
2059
+ md5_relpath = f'{file_md5[:2]}/{file_md5[2:4]}/{file_md5}'
2055
2060
  md5_path = self.folder + md5_relpath
2056
2061
  folder = Folder(md5_path)
2057
2062
  folder.make()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reykit
3
- Version: 1.1.75
3
+ Version: 1.1.78
4
4
  Summary: Kit method set.
5
5
  Project-URL: homepage, https://github.com/reyxbo/reykit/
6
6
  Author-email: Rey <reyxbo@163.com>
@@ -8,7 +8,7 @@ reykit/rlog.py,sha256=TRAWaVG9KTgzeNjN-FXkcvBmvq1IhICgawllQEGoUdg,25745
8
8
  reykit/rmonkey.py,sha256=Dj2GBzBDFXbo0Z-5f8Zep4dfbaIw1bo1FUmC31xvDuk,7929
9
9
  reykit/rnet.py,sha256=ql1L-QCoa_nZ2Vp8cpZrWl4AoxfZq9dhPdistiAdM64,17767
10
10
  reykit/rnum.py,sha256=PhG4V_BkVfCJUsbpMDN1umGZly1Hsus80TW8bpyBtyY,3653
11
- reykit/ros.py,sha256=8ok5ZrhKMVSWUtHgmDq7eOFevc9_M9IcA9lCqPclneo,47652
11
+ reykit/ros.py,sha256=O5xAqVR1S5pGU-ryKh6JFN9ztO-GNMl_83fWoh75zOY,47873
12
12
  reykit/rrand.py,sha256=4VwooITgox54_GonELcJfcIpStDi-UJchpnyWKnyeIA,8606
13
13
  reykit/rre.py,sha256=1qva7xatKVE9qC2j7IujjXSM59qxHWwTYpiizFFQ8Xo,6024
14
14
  reykit/rschedule.py,sha256=HuQRSNF6yd397P9knIX9-z8Ii1tUXFUL_-zxTIkxir0,14804
@@ -22,7 +22,7 @@ reykit/rwrap.py,sha256=FEmeK_fboJ-OyXeJf8bilc7U2ph8xIbZGNHb6fLCy2c,15063
22
22
  reykit/rzip.py,sha256=BGEONswuBZxQ-zcgd_xp2fcvYesC9AmKaaXWvnT3bTI,3456
23
23
  reykit/rdll/__init__.py,sha256=nLSb8onBm2ilyoxzpDzUeGfSCKwkLEesIhzK3LiJ8mk,701
24
24
  reykit/rdll/rdll_core.py,sha256=o6-rKcTQgxZQe0kD3GnwyNb3KL9IogzgCQNOmYLMm7A,5086
25
- reykit-1.1.75.dist-info/METADATA,sha256=G7l2GpQpAgoT0wO_HOuAfvCj2lkorviX-enuViPEotA,1872
26
- reykit-1.1.75.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- reykit-1.1.75.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
- reykit-1.1.75.dist-info/RECORD,,
25
+ reykit-1.1.78.dist-info/METADATA,sha256=QsUb6Z4hLUmpgzrm2oWUL0UvN_eNq9kQ-P_Z49KYJWk,1872
26
+ reykit-1.1.78.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ reykit-1.1.78.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
+ reykit-1.1.78.dist-info/RECORD,,