Skip to content

Commit ad4b3df

Browse files
committed
mode consideration for deletion and storing.
1 parent 4106839 commit ad4b3df

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

image_in_window_screensaver/file_walker.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
from logging import currentframe
12
from os import path as Path
23
from typing import List
34
import custom_log as l
45
import os
56
import argument_handler as argh
67

7-
8+
current_mode = None
9+
def get_mode():
10+
return current_mode
811
def walk(mode=None) -> List:
912
"""
1013
walks through a path to return list of absolute path of images with png or jpg extensions
@@ -16,6 +19,8 @@ def walk(mode=None) -> List:
1619
path: str = argh.get_path()
1720
if mode:
1821
path += mode
22+
global current_mode
23+
current_mode = mode
1924
l.log(path)
2025
ignore: str = argh.get_ignore_word()
2126
l.log("checking path integrity")
@@ -47,11 +52,11 @@ def is_exclude_image(image_path: str, ignore_word: str) -> str:
4752
list_ignores = ignore_word.split(',')
4853

4954
for word in list_ignores:
50-
if image_path.lower().find(word) is not -1:
55+
if image_path.lower().find(word) != -1:
5156
l.log(["found entry in list_ignore: ", image_path, word])
5257
return True
5358
else:
54-
if image_path.lower().find(ignore_word) is not -1:
59+
if image_path.lower().find(ignore_word) != -1:
5560
l.log(["found entry in list_ignore: ", image_path, ignore_word])
5661
return True
5762
return False

0 commit comments

Comments
 (0)