Skip to content

Commit a418397

Browse files
authored
Added additional excluded folders check
- Added additional excluded folders check - Updated README.md - Centralized font
1 parent adce4b7 commit a418397

File tree

6 files changed

+48
-17
lines changed

6 files changed

+48
-17
lines changed

FF_Compare.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ def generate_title_label(self, text, text2, color) -> tuple[QLabel, QLabel]:
188188

189189
# Defining the font
190190
font2 = QFont(FF_Files.DEFAULT_FONT, FF_Files.SMALLER_FONT_SIZE)
191-
# font2.setBold(True)
192191
# Configure the font
193192
label2.setFont(font2)
194193

FF_Files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import hashlib
1818

1919
# Versions
20-
VERSION: str = "rc_27-may-24"
20+
VERSION: str = "4-july-24"
2121
VERSION_SHORT: str = "0.0-rc2"
2222
# Versions of file formats
2323
FF_FILTER_VERSION = 1

FF_Main_UI.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,9 +1187,9 @@ def menu_bar(self, shell_cmd):
11871187
switch_tab_basic.triggered.connect(lambda: self.tabbed_widget.setCurrentIndex(0))
11881188
switch_tab_basic.setShortcut("Ctrl+1")
11891189
# File Content
1190-
switch_tab_file_content = QAction("Switch to tab File Content", self.Root_Window)
1191-
switch_tab_file_content.triggered.connect(lambda: self.tabbed_widget.setCurrentIndex(1))
1192-
switch_tab_file_content.setShortcut("Ctrl+2")
1190+
switch_tab_properties = QAction("Switch to tab Properties", self.Root_Window)
1191+
switch_tab_properties.triggered.connect(lambda: self.tabbed_widget.setCurrentIndex(1))
1192+
switch_tab_properties.setShortcut("Ctrl+2")
11931193
# Advanced
11941194
switch_tab_advanced = QAction("Switch to tab Advanced", self.Root_Window)
11951195
switch_tab_advanced.triggered.connect(lambda: self.tabbed_widget.setCurrentIndex(2))
@@ -1199,7 +1199,7 @@ def menu_bar(self, shell_cmd):
11991199
switch_tab_sorting.triggered.connect(lambda: self.tabbed_widget.setCurrentIndex(3))
12001200
switch_tab_sorting.setShortcut("Ctrl+4")
12011201
# Add options to menu
1202-
tabs_menu.addActions([switch_tab_basic, switch_tab_file_content, switch_tab_advanced, switch_tab_sorting])
1202+
tabs_menu.addActions([switch_tab_basic, switch_tab_properties, switch_tab_advanced, switch_tab_sorting])
12031203

12041204
# Search Status Menu
12051205
global search_status_menu

FF_Search.py

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,17 @@ def __init__(self, data_name, data_in_name, data_filetype, data_file_size_min, d
229229

230230
logging.debug(f"{size_data = }, {data_file_size_min = }, {data_file_size_max = }")
231231

232+
# Loading excluded files
233+
with open(os.path.join(FF_Files.FF_LIB_FOLDER, "Settings")) as excluded_file:
234+
data_excluded_files = load(excluded_file)["excluded_files"]
235+
236+
# Checking if the search scope is an excluded directory
237+
excluded_files_block_search = False
238+
for excluded_file in data_excluded_files:
239+
if data_search_from_valid.startswith(excluded_file):
240+
excluded_files_block_search = True
241+
break
242+
232243
# Fetching Errors
233244
# Testing if file ending, file groups or name contains are used together with name,
234245
# because if they do no file will be found
@@ -308,6 +319,20 @@ def __init__(self, data_name, data_in_name, data_filetype, data_file_size_min, d
308319
"No files would be found, because no file type "
309320
"category is selected.",
310321
parent=None)
322+
323+
# If the search scope is an excluded file
324+
elif excluded_files_block_search:
325+
# Debug
326+
logging.error("Directory Error! Search in directory is in an excluded directory")
327+
328+
# Show Popup
329+
FF_Additional_UI.PopUps.show_critical_messagebox(
330+
"Directory Error!",
331+
"Directory Error!\n\n"
332+
"The directory you searched in is in an excluded folder.\n\n"
333+
"You can edit the excluded folders in the File Find Settings. \n(File Find > Preferences...)",
334+
parent=None)
335+
311336
# Start Searching
312337
else:
313338

@@ -348,15 +373,15 @@ class SignalClass(QObject):
348373
lambda: self.searching(
349374
data_name, data_in_name, data_filetype, data_file_size_min, data_file_size_max, data_library,
350375
data_search_from_valid, data_search_for, data_content, unix_time_list, data_sort_by,
351-
data_reverse_sort, data_file_group, parent))
376+
data_reverse_sort, data_file_group, data_excluded_files, parent))
352377

353378
# Debug
354379
logging.debug("Finished Setting up QThreadPool!")
355380

356381
# The search engine
357382
def searching(self, data_name, data_in_name, data_filetype, data_file_size_min, data_file_size_max, data_library,
358383
data_search_from, data_search_for, data_content, data_time, data_sort_by, data_reverse_sort,
359-
data_file_group, parent):
384+
data_file_group, data_excluded_files, parent):
360385
# Debug
361386
logging.info("Starting Search...")
362387
self.ui_logger.update("Starting Search...")
@@ -402,12 +427,15 @@ def searching(self, data_name, data_in_name, data_filetype, data_file_size_min,
402427
logging.debug("Files and folders checking is NOT needed")
403428
data_search_for_needed = True
404429

405-
# Loading excluded files and checking if the need to be scanned
406-
with open(os.path.join(FF_Files.FF_LIB_FOLDER, "Settings")) as excluded_file:
407-
data_excluded_files = load(excluded_file)["excluded_files"]
430+
# Testing if one of the excluded folder is in the search scope, if not checking isn't necessary
431+
exclude_file_in_scope = False
432+
for excluded_test_file in data_excluded_files:
433+
if excluded_test_file.startswith(data_search_from):
434+
exclude_file_in_scope = True
435+
break
408436

409-
# If data_excluded_files is an empty list
410-
if not data_excluded_files:
437+
# If data_excluded_files is an empty list or no file in the excluded list is in the search scope
438+
if not data_excluded_files or not exclude_file_in_scope:
411439
# If the list is empty
412440
logging.debug("Excluded files checking is NOT needed")
413441
data_excluded_files_needed = False

FF_Settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(self, parent):
7575

7676
# Excluded Files
7777
# Define the Label
78-
exclude_label = QLabel("Always excluded files:", parent=self.Settings_Window)
78+
exclude_label = QLabel("Always excluded folders:", parent=self.Settings_Window)
7979
# Change Font
8080
exclude_label.setFont(QFont(FF_Files.DEFAULT_FONT, FF_Files.SMALLER_FONT_SIZE))
8181
# Display the Label

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
[![File Find build](https://img.shields.io/github/actions/workflow/status/Pixel-Master/File-Find/File-Find.yml?branch=main&label=File%20Find%20build%20status&logo=File%20Find&style=flat-square)](https://github.com/Pixel-Master/File-Find/actions/workflows/File-Find.yml)
1212
[![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-blue.svg?style=flat-square)](http://www.gnu.org/licenses/gpl-3.0.html)
13-
[![GitLab last commit](https://img.shields.io/github/last-commit/Pixel-Master/File-Find.svg?style=flat-square)](https://github.com/Pixel-Master/File-Find/)
14-
[![GitHub stars](https://img.shields.io/github/stars/Pixel-Master/File-Find.svg?style=flat-square&label=Stars&color=yellow)](https://github.com/Pixel-Master/File-Find/)
13+
[![GitLab last commit](https://img.shields.io/github/last-commit/Pixel-Master/File-Find.svg?style=flat-square)](https://github.com/Pixel-Master/File-Find/commits)
14+
[![GitHub stars](https://img.shields.io/github/stars/Pixel-Master/File-Find.svg?style=flat-square&label=Stars&color=yellow)](https://Pixel-Master.github.io/File-Find/)
1515
[![GitLab forks](https://img.shields.io/github/forks/Pixel-Master/File-Find.svg?style=flat-square&label=Fork&color=red)](https://github.com/Pixel-Master/File-Find/forks/)
1616

1717
#### Links: [GitHub](https://github.com/Pixel-Master/File-Find), [Website](https://pixel-master.github.io/File-Find)
@@ -29,7 +29,11 @@
2929
- [File Structure](#file-structure)
3030

3131
## Download
32-
File Find isn't ready for Release yet Run from source or download pre-build macOS, Windows or Linux Apps from the GitHub action Page.
32+
33+
- [macOS](https://github.com/Pixel-Master/File-Find/releases/latest/download/File.Find.dmg)
34+
- [Windows](https://github.com/Pixel-Master/File-Find/releases/latest/download/File.Find.exe)
35+
36+
File Find is still in beta. Build might be unstable. To get the newest version:
3337
- [Building from Source](#building-from-source)
3438
- [GitHub Action Page](https://github.com/Pixel-Master/File-Find/actions/workflows/File-Find.yml)
3539

0 commit comments

Comments
 (0)