summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <tails@boum.org>2011-07-09 19:29:03 +0200
committerTails developers <tails@boum.org>2011-07-10 00:05:19 +0200
commitfd34f5ef23def6347bf56d578084715d5efa8c2c (patch)
tree3ad8a0459e79a9f91bed0ae843bf89a2011b97d0
parenta06151cc76f94517fbe28240835318cb880899e4 (diff)
Hide the device that is the source of the copy, don't warn if it is mounted.feature/ignore_source_device
-rwxr-xr-xliveusb/creator.py2
-rwxr-xr-xliveusb/gui.py4
2 files changed, 6 insertions, 0 deletions
diff --git a/liveusb/creator.py b/liveusb/creator.py
index 5f8570d..c2dcada 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -651,6 +651,8 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
self.log.debug(pformat(mounted_parts))
for device, data in self.drives.iteritems():
+ if self.source and data['udi'] == self.source.dev:
+ continue
if device in mounted_parts and len(mounted_parts[device]) > 0:
data['mounted_partitions'] = mounted_parts[device]
self.log.info(('Some partitions of USB device %s are mounted. '
diff --git a/liveusb/gui.py b/liveusb/gui.py
index 2b39135..056bbf3 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -365,6 +365,10 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface):
self.startButton.setEnabled(False)
return
for device, info in self.live.drives.items():
+ # Skip the device that is the source of the copy
+ if self.live.source and info['udi'] == self.live.source.dev:
+ self.live.log.debug('Skipping source device: %s' % data['device'])
+ continue
if info['label']:
self.driveBox.addItem("%s (%s)" % (device, info['label']))
else: