fosslight-util 2.1.39__py3-none-any.whl → 2.1.40__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
fosslight_util/exclude.py CHANGED
@@ -109,7 +109,13 @@ def get_excluded_paths(path_to_scan: str, custom_excluded_paths: list = [], cust
109
109
  path_to_exclude_with_dot = []
110
110
  excluded_files = set() # Use set for O(1) operations
111
111
  abs_path_to_scan = os.path.abspath(path_to_scan)
112
- custom_excluded_normalized = [p.replace('\\', '/') for p in custom_excluded_paths]
112
+ # Normalize: backslash to slash; trailing /* -> / so directory matching works without special case
113
+ custom_excluded_normalized = []
114
+ for p in custom_excluded_paths:
115
+ p = p.replace('\\', '/')
116
+ if p.endswith('/*'):
117
+ p = p[:-2] + '/'
118
+ custom_excluded_normalized.append(p)
113
119
  cnt_file_except_skipped = 0
114
120
 
115
121
  for root, dirs, files in os.walk(path_to_scan):
@@ -124,6 +130,11 @@ def get_excluded_paths(path_to_scan: str, custom_excluded_paths: list = [], cust
124
130
  path_to_exclude_with_dot.append(rel_path)
125
131
  elif rel_path in custom_excluded_normalized or rel_path + '/' in custom_excluded_normalized:
126
132
  path_to_exclude.append(rel_path)
133
+ elif any(
134
+ fnmatch.fnmatch(rel_path, pattern)
135
+ for pattern in custom_excluded_normalized
136
+ ):
137
+ path_to_exclude.append(rel_path)
127
138
 
128
139
  for file_name in files:
129
140
  file_path = os.path.join(root, file_name)
@@ -132,9 +143,11 @@ def get_excluded_paths(path_to_scan: str, custom_excluded_paths: list = [], cust
132
143
  except_info_sheet = False
133
144
  if not _has_parent_in_exclude_list(rel_path, path_to_exclude):
134
145
  file_ext = os.path.splitext(file_name)[1].lstrip('.').lower()
135
- if rel_path in custom_excluded_normalized:
136
- should_exclude = True
137
- elif file_name in custom_excluded_normalized:
146
+ if any(
147
+ fnmatch.fnmatch(rel_path, pattern)
148
+ or fnmatch.fnmatch(file_name, pattern)
149
+ for pattern in custom_excluded_normalized
150
+ ):
138
151
  should_exclude = True
139
152
  elif file_name.startswith('.'):
140
153
  should_exclude = True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fosslight_util
3
- Version: 2.1.39
3
+ Version: 2.1.40
4
4
  Summary: FOSSLight Util
5
5
  Home-page: https://github.com/fosslight/fosslight_util
6
6
  Download-URL: https://github.com/fosslight/fosslight_util
@@ -5,7 +5,7 @@ fosslight_util/constant.py,sha256=3BzJtyxC0o5IFAhYaUW-DeTKkA6f5tDJFJTb0k5ji9Y,24
5
5
  fosslight_util/correct.py,sha256=1WEAL-9_KhjFPLucPhv0PNN3K7avm0z8mU6sTuSyeHM,3864
6
6
  fosslight_util/cover.py,sha256=yrWwguN5VM7mOllljiDVykPfuLYfI11kcJ6gEs49Bjo,2616
7
7
  fosslight_util/download.py,sha256=8um4tTn7j4nBqa7iET4aI6n5r0FCimpN3ko6MhYlxTY,26796
8
- fosslight_util/exclude.py,sha256=a8aEBglvc1Ub5cRtXHqpzbmuyhzgH3O-X1rFDHkOayc,6841
8
+ fosslight_util/exclude.py,sha256=ojQa9xzPla5_S184GTcKdrrk-jWE-KKn4eBQcEA_Huo,7336
9
9
  fosslight_util/get_pom_license.py,sha256=vmh2LG1_4U7ts9SSpN3_UAANWbx5GBAVjremwm62OFY,5639
10
10
  fosslight_util/help.py,sha256=tOKrQz1thNDMfl9nZYGSHJ8gkPjLKBwgGI44AD3kUyI,6143
11
11
  fosslight_util/oss_item.py,sha256=8890JHb5ZoKQWAwN7Fl8badnlYatJtF4MVJz1rdS4yQ,6938
@@ -25,9 +25,9 @@ fosslight_util/write_yaml.py,sha256=QlEKoIPQsEaYERfbP53TeKgnllYzhLQWm5wYjnWtVjE,
25
25
  fosslight_util/resources/frequentLicenselist.json,sha256=GUhzK6tu7ok10fekOnmVmUgIGRC-acGABZKTNKfDyYA,4776157
26
26
  fosslight_util/resources/frequent_license_nick_list.json,sha256=ryU2C_6ZxHbz90_sUN9OvI9GXkCMLu7oGcmd9W79YYo,5005
27
27
  fosslight_util/resources/licenses.json,sha256=mK55z-bhY7Mjpj2KsO1crKGGL-X3F6MBFQJ0zLlx010,240843
28
- fosslight_util-2.1.39.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
29
- fosslight_util-2.1.39.dist-info/METADATA,sha256=9jO1KlH_I5M2DP4IO8bLY-s2hQ-_OTyy4HIwvsJmrmI,6365
30
- fosslight_util-2.1.39.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
31
- fosslight_util-2.1.39.dist-info/entry_points.txt,sha256=0yZggRWNwDaClDG8UmUA10UFG8cVX3Jiy5gG9nW7hJs,68
32
- fosslight_util-2.1.39.dist-info/top_level.txt,sha256=2qyYWGLakgBRy4BqoBNt-I5C29tBr_e93e5e1pbuTGA,15
33
- fosslight_util-2.1.39.dist-info/RECORD,,
28
+ fosslight_util-2.1.40.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
29
+ fosslight_util-2.1.40.dist-info/METADATA,sha256=59BAUojlZ3JoIUQVaAIHplVJ-qaQHNkLQx6pb3GdCgA,6365
30
+ fosslight_util-2.1.40.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
31
+ fosslight_util-2.1.40.dist-info/entry_points.txt,sha256=0yZggRWNwDaClDG8UmUA10UFG8cVX3Jiy5gG9nW7hJs,68
32
+ fosslight_util-2.1.40.dist-info/top_level.txt,sha256=2qyYWGLakgBRy4BqoBNt-I5C29tBr_e93e5e1pbuTGA,15
33
+ fosslight_util-2.1.40.dist-info/RECORD,,