Whitespace fixes.
This commit is contained in:
parent
fa9d29075b
commit
6ad6e7c661
@ -73,7 +73,7 @@ class BackupVMsWindow(Ui_Backup, QWizard):
|
|||||||
if vm.qid == 0:
|
if vm.qid == 0:
|
||||||
self.vm = vm
|
self.vm = vm
|
||||||
break;
|
break;
|
||||||
|
|
||||||
assert self.vm != None
|
assert self.vm != None
|
||||||
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
@ -118,9 +118,9 @@ class BackupVMsWindow(Ui_Backup, QWizard):
|
|||||||
home_dir = pwd.getpwnam(local_user).pw_dir
|
home_dir = pwd.getpwnam(local_user).pw_dir
|
||||||
self.size = qubesutils.get_disk_usage(home_dir)
|
self.size = qubesutils.get_disk_usage(home_dir)
|
||||||
else:
|
else:
|
||||||
self.size = self.get_vm_size(vm)
|
self.size = self.get_vm_size(vm)
|
||||||
super(BackupVMsWindow.VmListItem, self).__init__(vm.name+ " (" + qubesutils.size_to_human(self.size) + ")")
|
super(BackupVMsWindow.VmListItem, self).__init__(vm.name+ " (" + qubesutils.size_to_human(self.size) + ")")
|
||||||
|
|
||||||
def get_vm_size(self, vm):
|
def get_vm_size(self, vm):
|
||||||
size = 0
|
size = 0
|
||||||
if vm.private_img is not None:
|
if vm.private_img is not None:
|
||||||
@ -169,7 +169,7 @@ class BackupVMsWindow(Ui_Backup, QWizard):
|
|||||||
item.setForeground(QBrush(QColor(0, 0, 0)))
|
item.setForeground(QBrush(QColor(0, 0, 0)))
|
||||||
|
|
||||||
self.show_running_vms_warning(some_selected_vms_running)
|
self.show_running_vms_warning(some_selected_vms_running)
|
||||||
|
|
||||||
for i in range(self.select_vms_widget.available_list.count()):
|
for i in range(self.select_vms_widget.available_list.count()):
|
||||||
item = self.select_vms_widget.available_list.item(i)
|
item = self.select_vms_widget.available_list.item(i)
|
||||||
if item.vm.is_running() and item.vm.qid != 0:
|
if item.vm.is_running() and item.vm.qid != 0:
|
||||||
@ -195,7 +195,7 @@ class BackupVMsWindow(Ui_Backup, QWizard):
|
|||||||
self.app.processEvents()
|
self.app.processEvents()
|
||||||
|
|
||||||
if reply == QMessageBox.Yes:
|
if reply == QMessageBox.Yes:
|
||||||
|
|
||||||
wait_time = 60.0
|
wait_time = 60.0
|
||||||
for vm in vms:
|
for vm in vms:
|
||||||
self.shutdown_vm_func(vm, wait_time*1000)
|
self.shutdown_vm_func(vm, wait_time*1000)
|
||||||
@ -212,7 +212,6 @@ class BackupVMsWindow(Ui_Backup, QWizard):
|
|||||||
|
|
||||||
progress.hide()
|
progress.hide()
|
||||||
|
|
||||||
|
|
||||||
def get_running_vms(self):
|
def get_running_vms(self):
|
||||||
names = []
|
names = []
|
||||||
vms = []
|
vms = []
|
||||||
@ -223,12 +222,8 @@ class BackupVMsWindow(Ui_Backup, QWizard):
|
|||||||
vms.append(item.vm)
|
vms.append(item.vm)
|
||||||
return (names, vms)
|
return (names, vms)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def dev_combobox_activated(self, idx):
|
def dev_combobox_activated(self, idx):
|
||||||
dev_combobox_activated(self, idx)
|
dev_combobox_activated(self, idx)
|
||||||
|
|
||||||
|
|
||||||
@pyqtSlot(name='on_select_path_button_clicked')
|
@pyqtSlot(name='on_select_path_button_clicked')
|
||||||
def select_path_button_clicked(self):
|
def select_path_button_clicked(self):
|
||||||
@ -276,7 +271,7 @@ class BackupVMsWindow(Ui_Backup, QWizard):
|
|||||||
|
|
||||||
thread_monitor.set_finished()
|
thread_monitor.set_finished()
|
||||||
|
|
||||||
|
|
||||||
def current_page_changed(self, id):
|
def current_page_changed(self, id):
|
||||||
if self.currentPage() is self.confirm_page:
|
if self.currentPage() is self.confirm_page:
|
||||||
|
|
||||||
@ -323,7 +318,7 @@ class BackupVMsWindow(Ui_Backup, QWizard):
|
|||||||
if self.dev_mount_path != None:
|
if self.dev_mount_path != None:
|
||||||
umount_device(self.dev_mount_path)
|
umount_device(self.dev_mount_path)
|
||||||
self.button(self.FinishButton).setEnabled(True)
|
self.button(self.FinishButton).setEnabled(True)
|
||||||
|
|
||||||
|
|
||||||
def reject(self):
|
def reject(self):
|
||||||
#cancell clicked while the backup is in progress.
|
#cancell clicked while the backup is in progress.
|
||||||
@ -348,7 +343,7 @@ class BackupVMsWindow(Ui_Backup, QWizard):
|
|||||||
if self.dev_mount_path != None:
|
if self.dev_mount_path != None:
|
||||||
umount_device(self.dev_mount_path)
|
umount_device(self.dev_mount_path)
|
||||||
self.done(0)
|
self.done(0)
|
||||||
|
|
||||||
|
|
||||||
def has_selected_vms(self):
|
def has_selected_vms(self):
|
||||||
return self.select_vms_widget.selected_list.count() > 0
|
return self.select_vms_widget.selected_list.count() > 0
|
||||||
|
@ -80,7 +80,7 @@ def fill_appvms_list(dialog):
|
|||||||
dialog.appvm_combobox.addItem("None")
|
dialog.appvm_combobox.addItem("None")
|
||||||
|
|
||||||
dialog.appvm_combobox.setCurrentIndex(0) #current selected is null ""
|
dialog.appvm_combobox.setCurrentIndex(0) #current selected is null ""
|
||||||
|
|
||||||
for vm in dialog.qvm_collection.values():
|
for vm in dialog.qvm_collection.values():
|
||||||
if vm.is_appvm() and vm.internal:
|
if vm.is_appvm() and vm.internal:
|
||||||
continue
|
continue
|
||||||
@ -93,7 +93,7 @@ def fill_appvms_list(dialog):
|
|||||||
def fill_devs_list(dialog):
|
def fill_devs_list(dialog):
|
||||||
dialog.dev_combobox.clear()
|
dialog.dev_combobox.clear()
|
||||||
dialog.dev_combobox.addItem("None")
|
dialog.dev_combobox.addItem("None")
|
||||||
|
|
||||||
dialog.blk_manager.blk_lock.acquire()
|
dialog.blk_manager.blk_lock.acquire()
|
||||||
for a in dialog.blk_manager.attached_devs:
|
for a in dialog.blk_manager.attached_devs:
|
||||||
if dialog.blk_manager.attached_devs[a]['attached_to']['vm'] == dialog.vm.name :
|
if dialog.blk_manager.attached_devs[a]['attached_to']['vm'] == dialog.vm.name :
|
||||||
@ -112,7 +112,7 @@ def fill_devs_list(dialog):
|
|||||||
|
|
||||||
def enable_dir_line_edit(dialog, boolean):
|
def enable_dir_line_edit(dialog, boolean):
|
||||||
dialog.dir_line_edit.setEnabled(boolean)
|
dialog.dir_line_edit.setEnabled(boolean)
|
||||||
dialog.select_path_button.setEnabled(boolean)
|
dialog.select_path_button.setEnabled(boolean)
|
||||||
|
|
||||||
|
|
||||||
def dev_combobox_activated(dialog, idx):
|
def dev_combobox_activated(dialog, idx):
|
||||||
@ -129,7 +129,7 @@ def dev_combobox_activated(dialog, idx):
|
|||||||
dialog.dev_combobox.setCurrentIndex(dialog.prev_dev_idx)
|
dialog.dev_combobox.setCurrentIndex(dialog.prev_dev_idx)
|
||||||
return
|
return
|
||||||
|
|
||||||
if dialog.dev_combobox.currentText() != "None": #An existing device chosen
|
if dialog.dev_combobox.currentText() != "None": #An existing device chosen
|
||||||
dev_name = str(dialog.dev_combobox.itemData(idx).toString())
|
dev_name = str(dialog.dev_combobox.itemData(idx).toString())
|
||||||
|
|
||||||
dialog.blk_manager.blk_lock.acquire()
|
dialog.blk_manager.blk_lock.acquire()
|
||||||
@ -155,7 +155,7 @@ def dev_combobox_activated(dialog, idx):
|
|||||||
dialog.dev_combobox.setCurrentIndex(0) #if couldn't mount - set current device to "None"
|
dialog.dev_combobox.setCurrentIndex(0) #if couldn't mount - set current device to "None"
|
||||||
dialog.prev_dev_idx = 0
|
dialog.prev_dev_idx = 0
|
||||||
return
|
return
|
||||||
|
|
||||||
dialog.prev_dev_idx = idx
|
dialog.prev_dev_idx = idx
|
||||||
|
|
||||||
if dialog.dev_mount_path != None:
|
if dialog.dev_mount_path != None:
|
||||||
|
@ -72,7 +72,7 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
|
|||||||
if vm.qid == 0:
|
if vm.qid == 0:
|
||||||
self.vm = vm
|
self.vm = vm
|
||||||
break;
|
break;
|
||||||
|
|
||||||
assert self.vm != None
|
assert self.vm != None
|
||||||
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
@ -98,7 +98,7 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
|
|||||||
|
|
||||||
def dev_combobox_activated(self, idx):
|
def dev_combobox_activated(self, idx):
|
||||||
dev_combobox_activated(self, idx)
|
dev_combobox_activated(self, idx)
|
||||||
|
|
||||||
@pyqtSlot(name='on_select_path_button_clicked')
|
@pyqtSlot(name='on_select_path_button_clicked')
|
||||||
def select_path_button_clicked(self):
|
def select_path_button_clicked(self):
|
||||||
select_path_button_clicked(self)
|
select_path_button_clicked(self)
|
||||||
@ -148,14 +148,12 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
|
|||||||
if 'dom0-home' in self.restore_options:
|
if 'dom0-home' in self.restore_options:
|
||||||
self.skip_dom0.setChecked(self.restore_options['dom0-home'])
|
self.skip_dom0.setChecked(self.restore_options['dom0-home'])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def gather_output(self, s):
|
def gather_output(self, s):
|
||||||
self.func_output.append(s)
|
self.func_output.append(s)
|
||||||
|
|
||||||
def restore_error_output(self, s):
|
def restore_error_output(self, s):
|
||||||
self.emit(SIGNAL("restore_progress(QString)"), '<font color="red">{0}</font>'.format(s))
|
self.emit(SIGNAL("restore_progress(QString)"), '<font color="red">{0}</font>'.format(s))
|
||||||
|
|
||||||
def restore_output(self, s):
|
def restore_output(self, s):
|
||||||
self.emit(SIGNAL("restore_progress(QString)"),'<font color="black">{0}</font>'.format(s))
|
self.emit(SIGNAL("restore_progress(QString)"),'<font color="black">{0}</font>'.format(s))
|
||||||
|
|
||||||
@ -181,7 +179,6 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
|
|||||||
|
|
||||||
thread_monitor.set_finished()
|
thread_monitor.set_finished()
|
||||||
|
|
||||||
|
|
||||||
def current_page_changed(self, id):
|
def current_page_changed(self, id):
|
||||||
|
|
||||||
if self.currentPage() is self.select_vms_page:
|
if self.currentPage() is self.select_vms_page:
|
||||||
@ -206,7 +203,7 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
|
|||||||
elif self.currentPage() is self.commit_page:
|
elif self.currentPage() is self.commit_page:
|
||||||
self.button(self.CancelButton).setDisabled(True)
|
self.button(self.CancelButton).setDisabled(True)
|
||||||
self.button(self.FinishButton).setDisabled(True)
|
self.button(self.FinishButton).setDisabled(True)
|
||||||
|
|
||||||
self.thread_monitor = ThreadMonitor()
|
self.thread_monitor = ThreadMonitor()
|
||||||
thread = threading.Thread (target= self.__do_restore__ , args=(self.thread_monitor,))
|
thread = threading.Thread (target= self.__do_restore__ , args=(self.thread_monitor,))
|
||||||
thread.daemon = True
|
thread.daemon = True
|
||||||
@ -227,8 +224,6 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
|
|||||||
if self.dev_mount_path != None:
|
if self.dev_mount_path != None:
|
||||||
umount_device(self.dev_mount_path)
|
umount_device(self.dev_mount_path)
|
||||||
self.done(0)
|
self.done(0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def has_selected_dir(self):
|
def has_selected_dir(self):
|
||||||
return self.backup_dir != None
|
return self.backup_dir != None
|
||||||
|
Loading…
Reference in New Issue
Block a user