Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ideascube
ARCHIVED Kiwix Hotspot
Commits
86c88ac0
Commit
86c88ac0
authored
Aug 02, 2018
by
rgaudin
Browse files
Fixed
#194
: refresh logger every 100MiB on SD-card writting (was 4KiB)
parent
96482f82
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
86c88ac0
2.0-rc4
* Use decimal (GB) sizes for SD card selection
* Fixed logger refresh while writing to SD-card
2.0-rc3
* Static content selection window display all contents, not only those selected [regression]
...
...
pibox-installer/backend/qemu.py
View file @
86c88ac0
...
...
@@ -138,14 +138,21 @@ class Emulator:
os
.
lseek
(
image
,
0
,
os
.
SEEK_SET
)
current_percentage
=
0.0
refresh_every
=
100
*
ONE_MiB
while
True
:
current_size
=
os
.
lseek
(
image
,
0
,
os
.
SEEK_CUR
)
new_percentage
=
(
100
*
current_size
)
/
total_size
if
new_percentage
!=
current_percentage
:
current_percentage
=
new_percentage
self
.
_logger
.
progress
(
current_percentage
/
100
)
self
.
_logger
.
std
(
str
(
current_percentage
)
+
"%
\r
"
)
if
current_size
%
refresh_every
==
0
:
self
.
_logger
.
progress
(
current_percentage
/
100
)
self
.
_logger
.
std
(
"Copied {copied} of {total} ({pc:.2}%)"
.
format
(
copied
=
human_readable_size
(
current_size
),
total
=
human_readable_size
(
total_size
),
pc
=
current_percentage
))
buf
=
os
.
read
(
image
,
4096
)
if
buf
==
b
""
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment