[FL-2220, FL-2221, FL-1883] RFID and iButton GUI update (#1107)

* RFID and iButton gui update
* Grammar nazi: readed -> read
* Grammar nazi pt.2: writed -> written

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-04-14 15:03:47 +03:00
committed by GitHub
parent 72a6bbb8ad
commit 779d319069
44 changed files with 419 additions and 131 deletions

View File

@@ -232,18 +232,18 @@ class FlipperStorage:
self.read.until(self.CLI_PROMPT)
return filedata
size = int(answer.split(b": ")[1])
readed_size = 0
read_size = 0
while readed_size < size:
while read_size < size:
self.read.until("Ready?" + self.CLI_EOL)
self.send("y")
read_size = min(size - readed_size, buffer_size)
read_size = min(size - read_size, buffer_size)
filedata.extend(self.port.read(read_size))
readed_size = readed_size + read_size
read_size = read_size + read_size
percent = str(math.ceil(readed_size / size * 100))
percent = str(math.ceil(read_size / size * 100))
total_chunks = str(math.ceil(size / buffer_size))
current_chunk = str(math.ceil(readed_size / buffer_size))
current_chunk = str(math.ceil(read_size / buffer_size))
sys.stdout.write(f"\r{percent}%, chunk {current_chunk} of {total_chunks}")
sys.stdout.flush()
print()