[Pkg-privacy-commits] [tails-installer] 20/35: Stop our progress thread before unmounting
anonym
anonym-tails-guest at moszumanska.debian.org
Thu Jan 12 15:14:42 UTC 2017
This is an automated email from the git hooks/post-receive script.
anonym-tails-guest pushed a commit to annotated tag 3.12.0
in repository tails-installer.
commit 496e58cf4e9e1a1ed4a812b976f44e8c113fa7ef
Author: Luke Macken <lmacken at redhat.com>
Date: Mon Apr 22 15:13:21 2013 -0400
Stop our progress thread before unmounting
---
liveusb/gui.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/liveusb/gui.py b/liveusb/gui.py
index fb0d677..e1491d4 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -130,6 +130,7 @@ class ProgressThread(QtCore.QThread):
orig_free = 0
drive = None
get_free_bytes = None
+ alive = True
def set_data(self, size, drive, freebytes):
self.totalsize = size / 1024
@@ -139,7 +140,7 @@ class ProgressThread(QtCore.QThread):
self.emit(QtCore.SIGNAL("maxprogress(int)"), self.totalsize)
def run(self):
- while True:
+ while self.alive:
free = self.get_free_bytes()
value = (self.orig_free - free) / 1024
self.emit(QtCore.SIGNAL("progress(int)"), value)
@@ -147,6 +148,9 @@ class ProgressThread(QtCore.QThread):
break
sleep(3)
+ def stop(self):
+ self.alive = False
+
def terminate(self):
self.emit(QtCore.SIGNAL("progress(int)"), self.totalsize)
QtCore.QThread.terminate(self)
@@ -223,6 +227,8 @@ class LiveUSBThread(QtCore.QThread):
if self.parent.opts.liveos_checksum:
self.live.calculate_liveos_checksum()
+ self.progress.stop()
+
# Flush all filesystem buffers and unmount
self.live.flush_buffers()
self.live.unmount_device()
@@ -302,12 +308,12 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface):
'the Properties. Under the Compatibility tab, check the "Run '
'this program as an administrator" box.'))
-
def populate_devices(self, *args, **kw):
if self.in_process:
return
self.driveBox.clear()
#self.textEdit.clear()
+
def add_devices():
if not len(self.live.drives):
self.textEdit.setPlainText(_("Unable to find any USB drives"))
--
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