[Pkg-privacy-commits] [tails-installer] 90/210: Fix writing under windows

Intrigeri intrigeri at moszumanska.debian.org
Wed May 24 15:26:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to tag 3.90.0
in repository tails-installer.

commit ce5ba028a0b2c26b59c1d794b1820299015b4b08
Author: Martin Briza <mbriza at redhat.com>
Date:   Tue May 12 17:22:08 2015 +0200

    Fix writing under windows
---
 liveusb-creator.spec |  4 ++--
 liveusb/gui.py       | 31 +++++++++++++++++--------------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/liveusb-creator.spec b/liveusb-creator.spec
index 9018d1e..cd03205 100644
--- a/liveusb-creator.spec
+++ b/liveusb-creator.spec
@@ -43,13 +43,13 @@ exe = EXE(pyz,
           exclude_binaries=True,
           name='liveusb-creator.exe',
           debug=False,
-          strip=True,
+          strip=False,
           upx=True,
           console=True )
 coll = COLLECT(exe,
                a.binaries,
                a.datas,
                newqml,
-               strip=True,
+               strip=False,
                upx=True,
                name='liveusb-creator')
\ No newline at end of file
diff --git a/liveusb/gui.py b/liveusb/gui.py
index 2f06210..9825190 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -804,27 +804,30 @@ class LiveUSBData(QObject):
             previouslySelected = self._usbDrives[self._currentDrive].drive['device']
         for drive, info in self.live.drives.items():
             name = ''
-            if info['vendor'] and info['model']:
+            if 'vendor' in info and 'model' in info:
                 name = info['vendor'] + ' ' + info['model']
-            elif info['label']:
+            elif 'label' in info:
                 name = info['label']
             else:
                 name = info['device']
 
             gb = 1000.0 # if it's decided to use base 2 values, change this
 
-            if info['fullSize']:
-                pass
-                if info['fullSize'] < gb:
-                    name += ' (%.1f B)'  % (info['fullSize'] / (gb ** 0))
-                elif info['fullSize'] < gb * gb:
-                    name += ' (%.1f KB)' % (info['fullSize'] / (gb ** 1))
-                elif info['fullSize'] < gb * gb * gb:
-                    name += ' (%.1f MB)' % (info['fullSize'] / (gb ** 2))
-                elif info['fullSize'] < gb * gb * gb * gb:
-                    name += ' (%.1f GB)' % (info['fullSize'] / (gb ** 3))
-                else:
-                    name += ' (%.1f TB)' % (info['fullSize'] / (gb ** 4))
+            if 'fullSize' in info:
+                usedSize = info['fullSize']
+            else:
+                usedSize = info['size']
+
+            if usedSize < gb ** 1:
+                name += ' (%.1f B)'  % (usedSize / (gb ** 0))
+            elif usedSize < gb ** 2:
+                name += ' (%.1f KB)' % (usedSize / (gb ** 1))
+            elif usedSize < gb ** 3:
+                name += ' (%.1f MB)' % (usedSize / (gb ** 2))
+            elif usedSize < gb ** 4:
+                name += ' (%.1f GB)' % (usedSize / (gb ** 3))
+            else:
+                name += ' (%.1f TB)' % (usedSize / (gb ** 4))
 
             tmpDrives.append(USBDrive(self, name, info))
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git



More information about the Pkg-privacy-commits mailing list