fosslight-util 2.1.0__tar.gz → 2.1.1__tar.gz
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-2.1.0 → fosslight_util-2.1.1}/PKG-INFO +1 -1
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/requirements.txt +1 -1
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/setup.py +1 -1
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/compare_yaml.py +3 -1
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/output_format.py +4 -4
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util.egg-info/PKG-INFO +1 -1
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util.egg-info/SOURCES.txt +0 -1
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util.egg-info/requires.txt +2 -2
- fosslight_util-2.1.0/src/fosslight_util/convert_excel_to_yaml.py +0 -69
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/LICENSE +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/MANIFEST.in +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/README.md +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/setup.cfg +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/__init__.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/_get_downloadable_url.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/constant.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/correct.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/cover.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/download.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/help.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/oss_item.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/parsing_yaml.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/read_excel.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/resources/frequentLicenselist.json +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/resources/frequent_license_nick_list.json +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/resources/licenses.json +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/set_log.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/spdx_licenses.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/timer_thread.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/write_excel.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/write_opossum.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/write_scancodejson.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/write_spdx.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/write_txt.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/write_yaml.py +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util.egg-info/dependency_links.txt +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util.egg-info/entry_points.txt +0 -0
- {fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util.egg-info/top_level.txt +0 -0
|
@@ -8,7 +8,7 @@ coloredlogs
|
|
|
8
8
|
python3-wget
|
|
9
9
|
beautifulsoup4
|
|
10
10
|
jsonmerge
|
|
11
|
-
spdx-tools
|
|
11
|
+
spdx-tools==0.8.*;sys_platform=="linux"
|
|
12
12
|
setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability
|
|
13
13
|
numpy; python_version < '3.8'
|
|
14
14
|
numpy>=1.22.2; python_version >= '3.8'
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
# SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
6
6
|
import logging
|
|
7
|
+
from typing import List, Dict
|
|
7
8
|
from fosslight_util.constant import LOGGER_NAME
|
|
9
|
+
from fosslight_util.oss_item import FileItem
|
|
8
10
|
|
|
9
11
|
logger = logging.getLogger(LOGGER_NAME)
|
|
10
12
|
VERSION = 'version'
|
|
@@ -12,7 +14,7 @@ LICENSE = 'license'
|
|
|
12
14
|
NAME = 'name'
|
|
13
15
|
|
|
14
16
|
|
|
15
|
-
def compare_yaml(before_fileitems, after_fileitems):
|
|
17
|
+
def compare_yaml(before_fileitems: List[FileItem], after_fileitems: List[FileItem]) -> Dict[str, List]:
|
|
16
18
|
bf_raw = []
|
|
17
19
|
af_raw = []
|
|
18
20
|
for bf in before_fileitems:
|
|
@@ -183,11 +183,11 @@ def write_output_file(output_file_without_ext: str, file_extension: str, scan_it
|
|
|
183
183
|
elif format == 'yaml':
|
|
184
184
|
success, msg, _ = write_yaml(result_file, scan_item, False)
|
|
185
185
|
elif format.startswith('spdx'):
|
|
186
|
-
if platform.system()
|
|
187
|
-
success, msg, _ = write_spdx(output_file_without_ext, file_extension, scan_item, spdx_version)
|
|
188
|
-
else:
|
|
186
|
+
if platform.system() == 'Windows' or platform.system() == 'Darwin':
|
|
189
187
|
success = False
|
|
190
|
-
msg = '
|
|
188
|
+
msg = f'{platform.system()} not support spdx format.'
|
|
189
|
+
else:
|
|
190
|
+
success, msg, _ = write_spdx(output_file_without_ext, file_extension, scan_item, spdx_version)
|
|
191
191
|
else:
|
|
192
192
|
if file_extension == '.xlsx':
|
|
193
193
|
success, msg = write_result_to_excel(result_file, scan_item, extended_header, hide_header)
|
|
@@ -7,7 +7,6 @@ src/fosslight_util/__init__.py
|
|
|
7
7
|
src/fosslight_util/_get_downloadable_url.py
|
|
8
8
|
src/fosslight_util/compare_yaml.py
|
|
9
9
|
src/fosslight_util/constant.py
|
|
10
|
-
src/fosslight_util/convert_excel_to_yaml.py
|
|
11
10
|
src/fosslight_util/correct.py
|
|
12
11
|
src/fosslight_util/cover.py
|
|
13
12
|
src/fosslight_util/download.py
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
# Copyright (c) 2022 LG Electronics Inc.
|
|
4
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
import os
|
|
6
|
-
import sys
|
|
7
|
-
import logging
|
|
8
|
-
import yaml
|
|
9
|
-
import re
|
|
10
|
-
from fosslight_util.constant import LOGGER_NAME
|
|
11
|
-
from fosslight_util.write_yaml import create_yaml_with_ossitem
|
|
12
|
-
from fosslight_util.read_excel import read_oss_report
|
|
13
|
-
|
|
14
|
-
logger = logging.getLogger(LOGGER_NAME)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def find_report_file(path_to_find):
|
|
18
|
-
file_to_find = ["FOSSLight-Report.xlsx", "OSS-Report.xlsx"]
|
|
19
|
-
|
|
20
|
-
try:
|
|
21
|
-
for file in file_to_find:
|
|
22
|
-
file_with_path = os.path.join(path_to_find, file)
|
|
23
|
-
if os.path.isfile(file_with_path):
|
|
24
|
-
return file
|
|
25
|
-
for root, dirs, files in os.walk(path_to_find):
|
|
26
|
-
for file in files:
|
|
27
|
-
file_name = file.lower()
|
|
28
|
-
p = re.compile(r"[\s\S]*OSS[\s\S]*-Report[\s\S]*.xlsx", re.I)
|
|
29
|
-
if p.search(file_name):
|
|
30
|
-
return os.path.join(root, file)
|
|
31
|
-
except Exception as error:
|
|
32
|
-
logger.debug("Find report:"+str(error))
|
|
33
|
-
return ""
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def convert_excel_to_yaml(oss_report_to_read: str, output_file: str, sheet_names: str = "") -> None:
|
|
37
|
-
_file_extension = ".yaml"
|
|
38
|
-
yaml_dict = {}
|
|
39
|
-
|
|
40
|
-
if os.path.isfile(oss_report_to_read):
|
|
41
|
-
try:
|
|
42
|
-
items = read_oss_report(oss_report_to_read, sheet_names)
|
|
43
|
-
for item in items:
|
|
44
|
-
create_yaml_with_ossitem(item, yaml_dict)
|
|
45
|
-
if yaml_dict:
|
|
46
|
-
output_file = output_file if output_file.endswith(_file_extension) else output_file + _file_extension
|
|
47
|
-
success = write_yaml_file(output_file, yaml_dict)
|
|
48
|
-
if success:
|
|
49
|
-
logger.warning(f"Output: {output_file}")
|
|
50
|
-
else:
|
|
51
|
-
logger.error(f"Can't write yaml file : {output_file}")
|
|
52
|
-
sys.exit(1)
|
|
53
|
-
except Exception as error:
|
|
54
|
-
logger.error(f"Convert yaml: {error}")
|
|
55
|
-
else:
|
|
56
|
-
logger.error(f"Can't find a file: {oss_report_to_read}")
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def write_yaml_file(output_file, json_output):
|
|
60
|
-
success = True
|
|
61
|
-
error_msg = ""
|
|
62
|
-
|
|
63
|
-
try:
|
|
64
|
-
with open(output_file, 'w') as f:
|
|
65
|
-
yaml.dump(json_output, f, sort_keys=False)
|
|
66
|
-
except Exception as ex:
|
|
67
|
-
error_msg = str(ex)
|
|
68
|
-
success = False
|
|
69
|
-
return success, error_msg
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util/resources/frequentLicenselist.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_util-2.1.0 → fosslight_util-2.1.1}/src/fosslight_util.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|