summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <tails@boum.org>2013-12-02 11:31:28 +0000
committerTails developers <tails@boum.org>2013-12-02 11:31:28 +0000
commit54ca84184f6efa43f1e9453df8ab461fe772d4e2 (patch)
tree5e842b5a1e69cf9a5510c841e1926b45d46198b9
parent8eaf0a443270a0c95f3d3dc928ca4448819c9843 (diff)
Use device size if parent_size is not setbugfix/list_isohybrid
This fixes https://labs.riseup.net/code/issues/6462
-rwxr-xr-xliveusb/gui.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/liveusb/gui.py b/liveusb/gui.py
index eec2b1d..3c188c5 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -433,13 +433,15 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface):
if info['fstype'] and info['fstype'] == 'crypto_LUKS':
self.live.log.debug('Skipping LUKS-encrypted partition: %s' % info['device'])
continue
- if info['label']:
- details = _("%(size)s %(label)s") % {
- 'label': info['label'],
- 'size': _format_bytes_in_gb(info['parent_size'])
- }
- else:
- details = _format_bytes_in_gb(info['size'])
+ size = _format_bytes_in_gb(info['parent_size']
+ if info['parent_size']
+ else info['size'])
+ details = (_("%(size)s %(label)s") % {
+ 'label': info['label'],
+ 'size': size
+ }
+ if info['label']
+ else size)
pretty_name = _("%(vendor)s %(model)s (%(details)s) - %(device)s") % {
'device': info['device'],
'vendor': info['vendor'],