diff options
author | root <root@YZenbook.local> | 2018-12-13 18:54:35 +0100 |
---|---|---|
committer | root <root@YZenbook.local> | 2018-12-13 18:54:35 +0100 |
commit | 790b0c624000b023d18f32aaa3387de36e24a7ec (patch) | |
tree | 3893e44531c3db30ec8af3f18cbe50e7a7e7b560 /backend/magiback | |
parent | 67d4650d78c1270a02bcaae65a7005da080c48a8 (diff) | |
download | isodumper-790b0c624000b023d18f32aaa3387de36e24a7ec.tar isodumper-790b0c624000b023d18f32aaa3387de36e24a7ec.tar.gz isodumper-790b0c624000b023d18f32aaa3387de36e24a7ec.tar.bz2 isodumper-790b0c624000b023d18f32aaa3387de36e24a7ec.tar.xz isodumper-790b0c624000b023d18f32aaa3387de36e24a7ec.zip |
Add operations for persistent partition creation
Diffstat (limited to 'backend/magiback')
-rwxr-xr-x | backend/magiback | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/backend/magiback b/backend/magiback index 904afcf..01a730c 100755 --- a/backend/magiback +++ b/backend/magiback @@ -36,6 +36,9 @@ class Isodumper(raw_write.Dumper): <arg type='s' name='target' direction='in'/> <arg type='s' name='source' direction='in'/> </method> + <method name='do_persistence'> + <arg type='s' name='target' direction='in'/> + </method> <method name='get_sum'> <arg type='s' name='source' direction='in'/> </method> @@ -67,6 +70,9 @@ class Isodumper(raw_write.Dumper): self.sum_check = "" self.sum_check_searched = False self.signature_checked = False + self.writing_perm = False + self.writing_target = "" + def do_write(self,source, target, size, dbus_context): self.finished.clear() @@ -74,10 +80,21 @@ class Isodumper(raw_write.Dumper): self.thread = threading.Thread(target=self._do_write, args=(source, target, size, )) self.thread.start() logging.debug("Writing thread started") + self.writing_perm = True + self.writing_target = target else: self.return_message = "Access denied" self.finished.set() + def do_persistence(self, target): + self.finished.clear() + if self.writing_perm and self.writing_target == target : + self._do_persistence(target) + else: + self.return_message = "Access denied" + self.writing_perm = False + self.writing_target = "" + @property def done(self): return self.finished.wait(1) |