@@ -55,8 +55,7 @@ def hits(self) -> int:
5555
5656 def summary (self ) -> str :
5757 return (
58- f"cache hits: { self .hits } cache misses: "
59- f"{ self .misses } writes: { self .writes } "
58+ f"cache hits: { self .hits } cache misses: { self .misses } writes: { self .writes } "
6059 )
6160
6261
@@ -176,9 +175,9 @@ def write_block(self, block: int, data: bytes) -> None:
176175 def read (self , cfg : LFSConfig , block : int , off : int , size : int ) -> bytearray :
177176 log .debug ("LFS Read : Block: %d, Offset: %d, Size=%d" % (block , off , size ))
178177 assert off == 0 , "Read offset must be 0"
179- assert (
180- size == cfg . block_size == self . block_cache . block_size
181- ), "Read size must be block size"
178+ assert size == cfg . block_size == self . block_cache . block_size , (
179+ "Read size must be block size"
180+ )
182181 start , end = block , block + (off + size ) // cfg .block_size
183182 data = b"" .join (self .read_block (i ) for i in range (start , end + 1 ))
184183 return bytearray (data [off : off + size ])
@@ -187,9 +186,9 @@ def prog(self, cfg: "LFSConfig", block: int, off: int, data: bytes) -> int:
187186 log .debug ("LFS Prog : Block: %d, Offset: %d, Size=%d" % (block , off , len (data )))
188187 block_size = cfg .block_size
189188 assert off == 0 , "Write offset must be 0"
190- assert (
191- len ( data ) == block_size == self . block_cache . block_size
192- ), "Write size must be block size"
189+ assert len ( data ) == block_size == self . block_cache . block_size , (
190+ "Write size must be block size"
191+ )
193192 for i in range (len (data ) // block_size ):
194193 self .write_block (
195194 block + i ,
@@ -329,7 +328,7 @@ def do_info(self) -> None:
329328 print (f" Block Size: { fs .cfg .block_size :9d} / 0x{ fs .cfg .block_size :X} " )
330329 print (f" Blocks Total:{ fs .block_count :9d} " )
331330 print (f" Blocks Used: { fs .used_block_count :>9d} " )
332- print (f" Blocks Free: { fs .block_count - fs .used_block_count :>9d} " )
331+ print (f" Blocks Free: { fs .block_count - fs .used_block_count :>9d} " )
333332
334333 def do_df (self ) -> None :
335334 """Print size and usage information about the LittleFS filesystem."""
0 commit comments