reykit 1.1.75__py3-none-any.whl → 1.1.77__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
 
@@ -1949,29 +1949,29 @@ class FileCache(Base):
1949
1949
  Make cache directory and subdirectories.
1950
1950
  """
1951
1951
 
1952
- # Make.
1952
+ # Handle parameter.
1953
1953
  chars = '0123456789abcdef'
1954
-
1955
- ## Root.
1954
+ subdir_names = [
1955
+ char1 + char2
1956
+ for char1 in chars
1957
+ for char2 in chars
1958
+ ]
1956
1959
  paths = [self.folder.path]
1957
-
1958
- ## Second layer.
1959
1960
  paths.extend(
1960
1961
  [
1961
- self.folder + char
1962
- for char in chars
1962
+ self.folder + name
1963
+ for name in subdir_names
1963
1964
  ]
1964
1965
  )
1965
-
1966
- ## Third layer.
1967
1966
  paths.extend(
1968
1967
  [
1969
- self.folder + f'{char}/{char_sub}'
1970
- for char in chars
1971
- for char_sub in chars
1968
+ self.folder + f'{name1}/{name2}'
1969
+ for name1 in subdir_names
1970
+ for name2 in subdir_names
1972
1971
  ]
1973
1972
  )
1974
1973
 
1974
+ # Make.
1975
1975
  make_dir(*paths)
1976
1976
 
1977
1977
 
@@ -1995,7 +1995,7 @@ class FileCache(Base):
1995
1995
  name = name or md5
1996
1996
 
1997
1997
  # Not exist md5.
1998
- md5_relpath = f'{md5[0]}/{md5[1]}/{md5}'
1998
+ md5_relpath = f'{md5[:2]}/{md5[2:4]}/{md5}'
1999
1999
  if md5_relpath not in self.folder:
2000
2000
  return
2001
2001
 
@@ -2051,7 +2051,7 @@ class FileCache(Base):
2051
2051
  return path
2052
2052
 
2053
2053
  # Store.
2054
- md5_relpath = f'{file_md5[0]}/{file_md5[1]}/{file_md5}'
2054
+ md5_relpath = f'{file_md5[:2]}/{file_md5[2:4]}/{file_md5}'
2055
2055
  md5_path = self.folder + md5_relpath
2056
2056
  folder = Folder(md5_path)
2057
2057
  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.77
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=Gs_g8d-RVBfBWxj6V2bLHzhYc0CrLZ5Nj09djmCHOJw,47756
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.77.dist-info/METADATA,sha256=Db5CuuhZqvh1VfqsCJjyi0cx1P0cQAc0byTkAUTT0FI,1872
26
+ reykit-1.1.77.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ reykit-1.1.77.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
+ reykit-1.1.77.dist-info/RECORD,,