File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
image_in_window_screensaver Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change
1
+ from logging import currentframe
1
2
from os import path as Path
2
3
from typing import List
3
4
import custom_log as l
4
5
import os
5
6
import argument_handler as argh
6
7
7
-
8
+ current_mode = None
9
+ def get_mode ():
10
+ return current_mode
8
11
def walk (mode = None ) -> List :
9
12
"""
10
13
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:
16
19
path : str = argh .get_path ()
17
20
if mode :
18
21
path += mode
22
+ global current_mode
23
+ current_mode = mode
19
24
l .log (path )
20
25
ignore : str = argh .get_ignore_word ()
21
26
l .log ("checking path integrity" )
@@ -47,11 +52,11 @@ def is_exclude_image(image_path: str, ignore_word: str) -> str:
47
52
list_ignores = ignore_word .split (',' )
48
53
49
54
for word in list_ignores :
50
- if image_path .lower ().find (word ) is not - 1 :
55
+ if image_path .lower ().find (word ) != - 1 :
51
56
l .log (["found entry in list_ignore: " , image_path , word ])
52
57
return True
53
58
else :
54
- if image_path .lower ().find (ignore_word ) is not - 1 :
59
+ if image_path .lower ().find (ignore_word ) != - 1 :
55
60
l .log (["found entry in list_ignore: " , image_path , ignore_word ])
56
61
return True
57
62
return False
You can’t perform that action at this time.
0 commit comments