feat: Bump version to 0.3.2 and update related files
This commit is contained in:
BIN
dist/renamer-0.3.2-py3-none-any.whl
vendored
Normal file
BIN
dist/renamer-0.3.2-py3-none-any.whl
vendored
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "renamer"
|
name = "renamer"
|
||||||
version = "0.3.1"
|
version = "0.3.2"
|
||||||
description = "Terminal-based media file renamer and metadata viewer"
|
description = "Terminal-based media file renamer and metadata viewer"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.11"
|
requires-python = ">=3.11"
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ class OpenScreen(Screen):
|
|||||||
if not path.is_dir():
|
if not path.is_dir():
|
||||||
self.query_one("#dir_input", Input).value = f"Not a directory: {path_str}"
|
self.query_one("#dir_input", Input).value = f"Not a directory: {path_str}"
|
||||||
return
|
return
|
||||||
self.app.scan_dir = path
|
self.app.scan_dir = path # type: ignore
|
||||||
self.app.scan_files()
|
self.app.scan_files() # type: ignore
|
||||||
self.app.pop_screen()
|
self.app.pop_screen()
|
||||||
|
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ Do you want to proceed with renaming?
|
|||||||
try:
|
try:
|
||||||
self.old_path.rename(self.new_path)
|
self.old_path.rename(self.new_path)
|
||||||
# Update the tree node
|
# Update the tree node
|
||||||
self.app.update_renamed_file(self.old_path, self.new_path)
|
self.app.update_renamed_file(self.old_path, self.new_path) # type: ignore
|
||||||
self.app.pop_screen()
|
self.app.pop_screen()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# Show error
|
# Show error
|
||||||
@@ -216,17 +216,20 @@ Do you want to proceed with renaming?
|
|||||||
self.set_focus(self.query_one("#cancel"))
|
self.set_focus(self.query_one("#cancel"))
|
||||||
elif current.id == "cancel":
|
elif current.id == "cancel":
|
||||||
self.set_focus(self.query_one("#new_name_input"))
|
self.set_focus(self.query_one("#new_name_input"))
|
||||||
elif event.key == "y":
|
|
||||||
# Trigger rename
|
# Hotkeys only work when not focused on input
|
||||||
try:
|
if not current or not hasattr(current, 'id') or current.id != "new_name_input":
|
||||||
self.old_path.rename(self.new_path)
|
if event.key == "y":
|
||||||
# Update the tree node
|
# Trigger rename
|
||||||
self.app.update_renamed_file(self.old_path, self.new_path)
|
try:
|
||||||
self.app.pop_screen()
|
self.old_path.rename(self.new_path)
|
||||||
except Exception as e:
|
# Update the tree node
|
||||||
# Show error
|
self.app.update_renamed_file(self.old_path, self.new_path) # type: ignore
|
||||||
content = self.query_one("#confirm_content", Static)
|
self.app.pop_screen()
|
||||||
content.update(f"Error renaming file: {str(e)}")
|
except Exception as e:
|
||||||
elif event.key == "n":
|
# Show error
|
||||||
# Cancel
|
content = self.query_one("#confirm_content", Static)
|
||||||
self.app.pop_screen()
|
content.update(f"Error renaming file: {str(e)}")
|
||||||
|
elif event.key == "n":
|
||||||
|
# Cancel
|
||||||
|
self.app.pop_screen()
|
||||||
Reference in New Issue
Block a user