File tree 1 file changed +4
-11
lines changed
1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 19
19
)
20
20
sys .exit ()
21
21
22
- ignore = []
23
- skip = []
24
- if len (sys .argv ) == 4 :
25
- ignore = sys .argv [3 ].split ("," )
26
- if len (sys .argv ) == 5 :
27
- skip = sys .argv [4 ].split ("," )
22
+ ignore = sys .argv [3 ].split ("," ) if len (sys .argv ) >= 4 else []
23
+ skip = sys .argv [4 ].split ("," ) if len (sys .argv ) == 5 else []
28
24
29
25
URL_BASE = f"https://github.com/TheAlgorithms/{ sys .argv [0 ]} /blob/HEAD"
30
26
@@ -33,17 +29,14 @@ def good_file_paths(top_dir: str = ".") -> Iterator[str]:
33
29
for dir_path , dir_names , filenames in os .walk (top_dir ):
34
30
dir_names [:] = [d for d in dir_names if d != "scripts" and d [0 ] not in "._" ]
35
31
for filename in filenames :
36
- if filename == "__init__.py" :
37
- continue
38
- if any (
32
+ if filename == "__init__.py" or any (
39
33
e .lower () in os .path .join (dir_path , filename ).lower () for e in ignore
40
34
):
41
35
continue
42
36
if os .path .splitext (filename )[1 ] in sys .argv [2 ].split ("," ):
43
37
path = os .path .join (dir_path , filename ).lstrip ("." ).lstrip ("/" )
44
38
for e in skip :
45
- path = path .replace (e + "/" , "" )
46
- path = path .replace (e + "\\ " , "" )
39
+ path = path .replace (f"{ e } /" , "" ).replace (f"{ e } \\ " , "" )
47
40
yield path
48
41
49
42
You can’t perform that action at this time.
0 commit comments