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
96482f82
Commit
96482f82
authored
Aug 02, 2018
by
rgaudin
Browse files
Use decimal sizes for SD-card as its what the cards are known for
parent
6d349160
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
96482f82
2.0-rc4
* Use decimal (GB) sizes for SD card selection
2.0-rc3
* Static content selection window display all contents, not only those selected [regression]
...
...
pibox-installer/sd_card_info.py
View file @
96482f82
...
...
@@ -41,7 +41,7 @@ if sys.platform == "linux":
device
=
bytes
(
info
.
get
(
'PreferredDevice'
)).
decode
(
'utf-8'
)
size
=
info
.
get
(
'Size'
)
formatted_size
=
human_readable_size
(
size
)
formatted_size
=
human_readable_size
(
size
,
binary
=
False
)
devices
.
append
({
"key"
:
key
,
# Because device name ends with \x00
...
...
@@ -92,7 +92,7 @@ elif sys.platform == "darwin":
for
name
in
device_names
:
plist
=
plistlib
.
loads
(
subprocess
.
check_output
([
"diskutil"
,
"info"
,
"-plist"
,
name
]))
size
=
plist
[
"Size"
]
formatted_size
=
human_readable_size
(
size
)
formatted_size
=
human_readable_size
(
size
,
binary
=
False
)
devices
.
append
({
"bus_protocol"
:
plist
[
"BusProtocol"
],
"device_identifier"
:
plist
[
"DeviceIdentifier"
],
...
...
@@ -137,7 +137,7 @@ elif sys.platform == "win32":
lines
.
pop
(
0
)
for
line
in
filter
(
lambda
l
:
len
(
l
)
is
not
0
,
lines
):
size
=
extract_field
(
column
[
"Size"
],
line
)
formatted_size
=
human_readable_size
(
size
)
formatted_size
=
human_readable_size
(
size
,
binary
=
False
)
devices
.
append
({
"caption"
:
extract_field
(
column
[
"Caption"
],
line
),
"description"
:
extract_field
(
column
[
"Description"
],
line
),
...
...
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