liveusb/creator.py | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
New commits:
commit 3225dd4dd622e7c51b22d8c7ed99d7ec94cbc5a9
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Dec 31 15:53:48 2008 -0500
Setup the logger a bit differently for windows.
Only create the StreamHandler if we are in verbose mode. If we don't do this,
closing the liveusb-creator, even after a successful run, will display a popup
telling the user that stdout log output has been written to
liveusb-creator.exe.log.
diff --git a/liveusb/creator.py b/liveusb/creator.py
index 7e75d33..c5846d0 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -651,6 +651,18 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
class WindowsLiveUSBCreator(LiveUSBCreator):
+ def _setup_logger(self):
+ self.log = logging.getLogger(__name__)
+ level = logging.INFO
+ if self.opts.verbose:
+ level = logging.DEBUG
+ handler = logging.StreamHandler()
+ handler.setLevel(level)
+ formatter = logging.Formatter("[%(module)s:%(lineno)s] %(message)s")
+ handler.setFormatter(formatter)
+ self.log.addHandler(handler)
+ self.log.setLevel(level)
+
def detect_removable_drives(self):
import win32file, win32api
self.drives = {}
commit 9bfa12c35530cc5756819dcce0f20b16f6002658
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Dec 31 15:53:28 2008 -0500
Add a hack to not display 0mb/sec, until we can do this properly.
diff --git a/liveusb/creator.py b/liveusb/creator.py
index df7ddcb..7e75d33 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -500,8 +500,9 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
delta = datetime.now() - start
if delta.seconds:
self.mb_per_sec = (self.isosize / delta.seconds) / 1024**2
- self.log.info(_("Wrote to device at") + " %d MB/sec" %
- self.mb_per_sec)
+ if self.mb_per_sec:
+ self.log.info(_("Wrote to device at") + " %d MB/sec" %
+ self.mb_per_sec)
isolinux = os.path.join(self.dest, 'isolinux')
if not os.path.exists(isolinux):
os.mkdir(isolinux)
@@ -716,8 +717,9 @@ class WindowsLiveUSBCreator(LiveUSBCreator):
delta = datetime.now() - start
if delta.seconds:
self.mb_per_sec = (self.isosize / delta.seconds) / 1024**2
- self.log.info(_("Wrote to device at") + " %d MB/sec" %
- self.mb_per_sec)
+ if self.mb_per_sec:
+ self.log.info(_("Wrote to device at") + " %d MB/sec" %
+ self.mb_per_sec)
def install_bootloader(self):
""" Run syslinux to install the bootloader on our device """