Skip to content

Commit

Permalink
Solve issue #207
Browse files Browse the repository at this point in the history
Issue Resolved: #207

Changes Made:
- Implemented the ability to read folders with escape characters in their names.

Reference:
https://stackoverflow.com/questions/2595119/glob-and-bracket-characters
  • Loading branch information
alanqq0624 committed Mar 4, 2025
1 parent b39c3ab commit d1c3b83
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def select_folder(self):
folder_path = askdirectory(initialdir=initial_dir)
if not folder_path:
return
self.selected_files_path = glob.glob(root_dir=folder_path, pathname=os.path.join(folder_path, "**/*.cbz"),
self.selected_files_path = glob.glob(root_dir=folder_path, pathname=os.path.join(glob.escape(folder_path), "**/*.cbz"),
recursive=True)
# TODO: Auto select recursive or not
# self.selected_files_path = [str(Path(folder_path, file)) for file in os.listdir(folder_path) if file.endswith(".cbz")]
Expand Down Expand Up @@ -514,4 +514,4 @@ def clean_selected(self):
self.widget_mngr.clean_widgets()
self.image_cover_frame.clear()
self.selected_files_path = list()
self.selected_files_treeview.clear()
self.selected_files_treeview.clear()

0 comments on commit d1c3b83

Please sign in to comment.