delete-file-home-assistant icon indicating copy to clipboard operation
delete-file-home-assistant copied to clipboard

Feature request: include string pattern for exclusion files

Open gateriderz opened this issue 2 years ago • 0 comments

It would be nice to have an official release to include a string instead of the exact file name to exclude.

Line 153:

Current code:

if except_files != []:
    if file in except_files:
        remove_file = False

Modified code:

import re
...
if except_files != []:
    for pattern in except_files:
        if re.search(pattern.lower(), file.lower()):
            remove_file = False
            break
        else:
            remove_file = True

Let me know what you think.

Thanks and keep up the great contribution.

gateriderz avatar Nov 23 '22 04:11 gateriderz