[Pkg-privacy-commits] [tails-installer] 17/30: Make drive restoring work on Windows

Intrigeri intrigeri at moszumanska.debian.org
Wed May 24 15:27:09 UTC 2017


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

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

commit 0700a30dd1062c226eb628ec1227e828258e9aed
Author: Martin Bříza <m at rtinbriza.cz>
Date:   Tue Apr 5 16:03:43 2016 +0200

    Make drive restoring work on Windows
---
 liveusb/creator.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/liveusb/creator.py b/liveusb/creator.py
index 5c0a449..ec95f18 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -614,6 +614,17 @@ class WindowsLiveUSBCreator(LiveUSBCreator):
 
     def restore_drive(self, d, callback):
 
+        def restore_drive_work(callback, device):
+            import threading
+            diskpart = subprocess.Popen(['diskpart'], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+            diskpart.communicate('select disk '+self.drive.device+'\r\nclean\r\ncreate part pri\r\nselect part 1\r\nformat fs=fat32 quick\r\nassign\r\nexit')
+            diskpart.wait()
+            callback(True)
+
+        from threading import Thread
+
+        t = Thread(target=restore_drive_work, args=(callback, self.drive.device, ))
+        t.start()
 
         """
         Notes to self:

-- 
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