fosslight-scanner 2.1.4__py3-none-any.whl → 2.1.6__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.
@@ -8,6 +8,7 @@ import sys
8
8
  import logging
9
9
  import shutil
10
10
  import copy
11
+ import traceback
11
12
  from fosslight_util.constant import LOGGER_NAME, FOSSLIGHT_SOURCE, FOSSLIGHT_BINARY, FOSSLIGHT_DEPENDENCY
12
13
  from fosslight_util.write_scancodejson import write_scancodejson
13
14
  from fosslight_util.oss_item import OssItem, FileItem
@@ -116,11 +117,10 @@ def create_scancodejson(all_scan_item_origin, ui_mode_report, src_path=""):
116
117
 
117
118
  try:
118
119
  all_scan_item = copy.deepcopy(all_scan_item_origin)
119
- if FOSSLIGHT_DEPENDENCY in all_scan_item.file_items:
120
- del all_scan_item.file_items[FOSSLIGHT_DEPENDENCY]
121
120
  if all_scan_item.file_items:
122
- first_sheet = next(iter(all_scan_item.file_items))
123
- else:
121
+ first_sheet = next((item for item in all_scan_item.file_items if item != FOSSLIGHT_DEPENDENCY),
122
+ None)
123
+ if not first_sheet:
124
124
  first_sheet = FOSSLIGHT_SOURCE
125
125
  all_scan_item.file_items[first_sheet] = []
126
126
  if src_path:
@@ -178,7 +178,10 @@ def correct_scanner_result(all_scan_item):
178
178
  bin_empty_license_exists = all(not oss_item.license for oss_item in bin_fileitem.oss_items)
179
179
 
180
180
  if src_all_licenses_non_empty and bin_empty_license_exists:
181
- exclude = bin_fileitem.oss_items[0].exclude
181
+ if bin_fileitem.oss_items:
182
+ exclude = bin_fileitem.oss_items[0].exclude
183
+ else:
184
+ exclude = False
182
185
  bin_fileitem.oss_items = []
183
186
  for src_oss_item in src_fileitem.oss_items:
184
187
  src_oss_item.exclude = exclude
@@ -191,13 +194,11 @@ def correct_scanner_result(all_scan_item):
191
194
  for i in sorted(remove_src_idx_list, reverse=True):
192
195
  del src_fileitems[i]
193
196
  except Exception as ex:
194
- logger.warning(f"correct the scanner result:{ex}")
197
+ logger.warning(f"Fail to correct the scanner result:{ex}")
198
+ logger.warning(traceback.format_exc())
195
199
 
196
- try:
197
- if duplicates:
198
- logger.info('Success to correct the src/bin scanner result')
199
- except Exception as ex:
200
- logger.warning(f"Corrected src/bin scanner result:{ex}")
200
+ if duplicates:
201
+ logger.info('Success to correct the src/bin scanner result')
201
202
  return all_scan_item
202
203
 
203
204
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fosslight-scanner
3
- Version: 2.1.4
3
+ Version: 2.1.6
4
4
  Summary: FOSSLight Scanner
5
5
  Home-page: https://github.com/fosslight/fosslight_scanner
6
6
  Author: LG Electronics
@@ -21,7 +21,7 @@ Requires-Dist: openpyxl
21
21
  Requires-Dist: progress
22
22
  Requires-Dist: pyyaml
23
23
  Requires-Dist: beautifulsoup4
24
- Requires-Dist: fosslight-util<3.0.0,>=2.1.6
24
+ Requires-Dist: fosslight-util<3.0.0,>=2.1.12
25
25
  Requires-Dist: fosslight-source<3.0.0,>=2.1.4
26
26
  Requires-Dist: fosslight-dependency<5.0.0,>=4.1.3
27
27
  Requires-Dist: fosslight-binary<6.0.0,>=5.1.2
@@ -4,12 +4,12 @@ fosslight_scanner/_help.py,sha256=-Dqgn1inH26614GjrIe8I5cdEziuAxTtwrUdtTkrpjQ,30
4
4
  fosslight_scanner/_parse_setting.py,sha256=SoIEoPGlFXAp6__eEFEMIPYPoKLvmqxXF5X_C_uFiVI,2468
5
5
  fosslight_scanner/_run_compare.py,sha256=zmzX-FIvWCSkwPvEA3iHfVpyg6QDGUCpw3tJuGLdPWM,10657
6
6
  fosslight_scanner/cli.py,sha256=C4YNPVJJ-Ezj_6xe8k9QbIrf5V44GXbHWCGzR2FMcV8,6547
7
- fosslight_scanner/common.py,sha256=PLAp1HLBQnsBY7pIq76z2RuSWeA5tuR6rQHw61IJrE0,8385
7
+ fosslight_scanner/common.py,sha256=0LgXlGOJVB0kDeZ-1VeHEErArh7TgXkwEAmYAL9q93I,8465
8
8
  fosslight_scanner/fosslight_scanner.py,sha256=EftUvIHIzWm6yOOGyPFCRV_IkT-2YFcoKSDrVEIea2I,20841
9
9
  fosslight_scanner/resources/bom_compare.html,sha256=VocJ9bDmQQOwfGyvXatPZ4W-QddO-IlsAvKdO0nZ7pA,2240
10
- fosslight_scanner-2.1.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
- fosslight_scanner-2.1.4.dist-info/METADATA,sha256=3Ul5Kwh_OKE4ptzrNNHw_PlA52u5UbUofpcdnhDirps,7872
12
- fosslight_scanner-2.1.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
13
- fosslight_scanner-2.1.4.dist-info/entry_points.txt,sha256=0tBUtN9pKtAkuohQuhbzuohdHbeoI0-w95aWAR7J_RU,105
14
- fosslight_scanner-2.1.4.dist-info/top_level.txt,sha256=43_xLb5KYpy8wOU1H2Wd2fEsWBY7Dg6ZEJJXkfT64Ak,18
15
- fosslight_scanner-2.1.4.dist-info/RECORD,,
10
+ fosslight_scanner-2.1.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
+ fosslight_scanner-2.1.6.dist-info/METADATA,sha256=g3mRdT_wV9E0QNyN0SL15rJzObJR0GByXFz4tewi6fY,7873
12
+ fosslight_scanner-2.1.6.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
13
+ fosslight_scanner-2.1.6.dist-info/entry_points.txt,sha256=0tBUtN9pKtAkuohQuhbzuohdHbeoI0-w95aWAR7J_RU,105
14
+ fosslight_scanner-2.1.6.dist-info/top_level.txt,sha256=43_xLb5KYpy8wOU1H2Wd2fEsWBY7Dg6ZEJJXkfT64Ak,18
15
+ fosslight_scanner-2.1.6.dist-info/RECORD,,