I fixed the toolbar, but
selected_names doesn't exist:
Quote:
AttributeError: 'FileListWidget' object has no attribute 'selected_names'
|
The whole function:
Quote:
def request_remove_ext(self):
# Import calibre/src/calibre/gui2/tweak_book/file_list.py
from calibre.gui2.tweak_book.file_list import FileList
self.boss.add_savepoint('Before: File Extension Remover')
names = self.gui.file_list.selected_names
if names is not None:
def change_name(name):
base = posixpath.splitext(name)[0]
return base
name_map = {n:change_name(n) for n in names}
self.boss.bulk_rename_requested.emit(name_map)
|
---
To add, this works, but with only one selected file:
Quote:
def request_remove_ext(self):
# Import calibre/src/calibre/gui2/tweak_book/file_list.py
from calibre.gui2.tweak_book.file_list import FileList
self.boss.add_savepoint('Before: File Extension Remover')
name = self.gui.file_list.current_name
name_without_ext = posixpath.splitext(name)[0]
self.boss.rename_requested(name,name_without_ext)
|