Move/Copy many files in one step via nautilus extension

This commit is contained in:
X4lldux 2018-04-27 03:49:57 +02:00
parent d698e7878f
commit 9fa75314f1
No known key found for this signature in database
GPG Key ID: 7A36F6F19EF3F992
2 changed files with 12 additions and 16 deletions

View File

@ -26,11 +26,9 @@ class CopyToAppvmItemExtension(GObject.GObject, Nautilus.MenuProvider):
def on_menu_item_clicked(self, menu, files): def on_menu_item_clicked(self, menu, files):
'''Called when user chooses files though Nautilus context menu. '''Called when user chooses files though Nautilus context menu.
''' '''
for file_obj in files: cmd = [file_obj.get_location().get_path()
for file_obj in files
# Check if file still exists # Check if file is not gone
if file_obj.is_gone(): if not file_obj.is_gone()]
return cmd.insert(0, '/usr/lib/qubes/qvm-copy-to-vm.gnome')
subprocess.call(cmd)
gio_file = file_obj.get_location()
subprocess.call(['/usr/lib/qubes/qvm-copy-to-vm.gnome', gio_file.get_path()])

View File

@ -26,11 +26,9 @@ class MoveToAppvmItemExtension(GObject.GObject, Nautilus.MenuProvider):
def on_menu_item_clicked(self, menu, files): def on_menu_item_clicked(self, menu, files):
'''Called when user chooses files though Nautilus context menu. '''Called when user chooses files though Nautilus context menu.
''' '''
for file_obj in files: cmd = [file_obj.get_location().get_path()
for file_obj in files
# Check if file still exists # Check if file is not gone
if file_obj.is_gone(): if not file_obj.is_gone()]
return cmd.insert(0, '/usr/lib/qubes/qvm-move-to-vm.gnome')
subprocess.call(cmd)
gio_file = file_obj.get_location()
subprocess.call(['/usr/lib/qubes/qvm-move-to-vm.gnome', gio_file.get_path()])