liveusb/creator.py | 7 +++++++
liveusb/gui.py | 1 +
2 files changed, 8 insertions(+)
New commits:
commit 12a1af3b9e591e6e779613f1732d8dccd572b09f
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 26 20:26:58 2008 -0400
Calculate the number of megabytes per second for our iso extraction
diff --git a/liveusb/creator.py b/liveusb/creator.py
index b614d74..513cd07 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -34,6 +34,7 @@ import os
import re
from StringIO import StringIO
+from datetime import datetime
from stat import ST_SIZE
from liveusb.releases import releases
@@ -59,6 +60,7 @@ class LiveUSBCreator(object):
totalsize = 0 # the total size of our overlay + iso
isosize = 0 # the size of the selected iso
_drive = None # mountpoint of the currently selected drive
+ mb_per_sec = 0 # how many megabytes per second we can write
log = None
drive = property(fget=lambda self: self.drives[self._drive],
@@ -407,8 +409,13 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
if not os.path.exists(liveos):
os.mkdir(liveos)
for img in ('squashfs.img', 'osmin.img'):
+ start = datetime.now()
self.popen('cp %s %s' % (os.path.join(tmpliveos, img),
os.path.join(liveos, img)))
+ delta = datetime.now() - start
+ if delta.seconds:
+ self.mb_per_sec = (self.isosize / delta.seconds) / 1024**2
+ self.log.info("Copied at %d MB/sec" % self.mb_per_sec)
isolinux = os.path.join(self.dest, 'isolinux')
if not os.path.exists(isolinux):
os.mkdir(isolinux)
diff --git a/liveusb/gui.py b/liveusb/gui.py
index e37f1fd..b77b467 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -175,6 +175,7 @@ class LiveUSBThread(QtCore.QThread):
self.status(_("Extracting live image to USB device..."))
self.live.extract_iso()
+ self.status(_("Wrote to device at %d MB/sec" % self.live.mb_per_sec))
if self.live.overlay:
self.status(_("Creating %d Mb persistent overlay..." %
self.live.overlay))