fosslight-util 1.4.34__py3-none-any.whl → 2.1.28__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/_get_downloadable_url.py +466 -36
- fosslight_util/compare_yaml.py +20 -11
- fosslight_util/constant.py +35 -0
- fosslight_util/correct.py +46 -78
- fosslight_util/cover.py +60 -0
- fosslight_util/download.py +302 -95
- fosslight_util/exclude.py +65 -0
- fosslight_util/help.py +20 -8
- fosslight_util/oss_item.py +171 -110
- fosslight_util/output_format.py +147 -19
- fosslight_util/parsing_yaml.py +45 -23
- fosslight_util/read_excel.py +40 -39
- fosslight_util/set_log.py +30 -5
- fosslight_util/spdx_licenses.py +2 -1
- fosslight_util/write_cyclonedx.py +210 -0
- fosslight_util/write_excel.py +141 -133
- fosslight_util/write_opossum.py +14 -20
- fosslight_util/write_scancodejson.py +51 -32
- fosslight_util/write_spdx.py +162 -115
- fosslight_util/write_txt.py +2 -1
- fosslight_util/write_yaml.py +43 -49
- {fosslight_util-1.4.34.dist-info → fosslight_util-2.1.28.dist-info}/METADATA +32 -24
- fosslight_util-2.1.28.dist-info/RECORD +32 -0
- {fosslight_util-1.4.34.dist-info → fosslight_util-2.1.28.dist-info}/WHEEL +1 -1
- {fosslight_util-1.4.34.dist-info → fosslight_util-2.1.28.dist-info}/entry_points.txt +0 -1
- fosslight_util/convert_excel_to_yaml.py +0 -69
- fosslight_util-1.4.34.dist-info/RECORD +0 -30
- {fosslight_util-1.4.34.dist-info → fosslight_util-2.1.28.dist-info/licenses}/LICENSE +0 -0
- {fosslight_util-1.4.34.dist-info → fosslight_util-2.1.28.dist-info}/top_level.txt +0 -0
|
@@ -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, output_file, sheet_names=""):
|
|
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
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
fosslight_util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
fosslight_util/_get_downloadable_url.py,sha256=UggybHxs_MeqxKzOpdS9PuOeKvO3YayhpbwLZPIZDss,5844
|
|
3
|
-
fosslight_util/compare_yaml.py,sha256=0bapoyS0yrzkiK70K57E8-3wZ_D6mZAJ-24Eq9TYBlk,2632
|
|
4
|
-
fosslight_util/constant.py,sha256=mDrH3Ahldhs9xT63iC8BmeRLHjN6fewI1H-pxnGvcD8,595
|
|
5
|
-
fosslight_util/convert_excel_to_yaml.py,sha256=7ZsAMMQJIEXrmcl_28nSHvFpGMi1ZiRZYpEfI5O8vP8,2298
|
|
6
|
-
fosslight_util/correct.py,sha256=RQ70zaQ_xuo9Mo0zIcb6pRQwt96bsimQJWkYldE2vbg,5224
|
|
7
|
-
fosslight_util/download.py,sha256=CMT_ZHK_lCQI6_-_6hI90n5fhw_AkxV3elAZl4uilzk,12561
|
|
8
|
-
fosslight_util/help.py,sha256=3ej8HhpszfFLRxR99Ob55MwHypjIHce1-YSp5_ENq-A,2113
|
|
9
|
-
fosslight_util/oss_item.py,sha256=Gjw-aI4gZGYrCbAkCL35lXlgA2w2F2plgOUmenQ1Cig,5238
|
|
10
|
-
fosslight_util/output_format.py,sha256=kmlruqjTjrkENsg0sF4B-wAfEUlld_Uc--cGGm5NPs0,3214
|
|
11
|
-
fosslight_util/parsing_yaml.py,sha256=zmetMiZprni_YMxUfj_Nx-nXm0sT31Ck_V0nWFS6ZmE,4332
|
|
12
|
-
fosslight_util/read_excel.py,sha256=XLN4-iCPB_6GoNQwjt4ScMi39_uBfNGdqR73f06j244,5043
|
|
13
|
-
fosslight_util/set_log.py,sha256=8cFGpr4HMk4grHo3a5keR4V1xWBscbjowYPxyrh42ks,3140
|
|
14
|
-
fosslight_util/spdx_licenses.py,sha256=r90hUY4_T-XrHIJHLx1Ox3gWZ3qzdZj9rJFo7AwmkPE,3641
|
|
15
|
-
fosslight_util/timer_thread.py,sha256=5VbZENQPD-N0NUmzEktqGr6Am-e7vxD79K05mmr29g0,433
|
|
16
|
-
fosslight_util/write_excel.py,sha256=DI-Re-__VlkaCC6s4pi9PbEZn5HWrq7NU7ahZkzH41A,9175
|
|
17
|
-
fosslight_util/write_opossum.py,sha256=PGJV5DysNJvIFbzsyGXxh_kRcvZuHAOmLs-WlXP8qMI,11831
|
|
18
|
-
fosslight_util/write_scancodejson.py,sha256=LKvy8C-8YvGRGhdmjIvtu3wD-IUfhS2rg64TJEZE9jI,2189
|
|
19
|
-
fosslight_util/write_spdx.py,sha256=B_aHv9vScgZI5gHo5Hd56ckNWOHdyAQebRV54bTx9ec,9542
|
|
20
|
-
fosslight_util/write_txt.py,sha256=Ms8E2wbc0U84IYP0dxTAbIfX5PzpQG3xblu8lv1w8J0,574
|
|
21
|
-
fosslight_util/write_yaml.py,sha256=ppBBErAXbXw8jtJ9j7BDeQHHzDlsTRt62XR0GgTcr70,3294
|
|
22
|
-
fosslight_util/resources/frequentLicenselist.json,sha256=GUhzK6tu7ok10fekOnmVmUgIGRC-acGABZKTNKfDyYA,4776157
|
|
23
|
-
fosslight_util/resources/frequent_license_nick_list.json,sha256=ryU2C_6ZxHbz90_sUN9OvI9GXkCMLu7oGcmd9W79YYo,5005
|
|
24
|
-
fosslight_util/resources/licenses.json,sha256=mK55z-bhY7Mjpj2KsO1crKGGL-X3F6MBFQJ0zLlx010,240843
|
|
25
|
-
fosslight_util-1.4.34.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
26
|
-
fosslight_util-1.4.34.dist-info/METADATA,sha256=nnfmrSHHm-AxpehOHFY7hOZNvFoSTulea4qNbxQHiBY,6165
|
|
27
|
-
fosslight_util-1.4.34.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
|
|
28
|
-
fosslight_util-1.4.34.dist-info/entry_points.txt,sha256=bzXX5i7HZ13V8BLKvtu_9KO3ZjtRypH-XszOXT6I3bU,69
|
|
29
|
-
fosslight_util-1.4.34.dist-info/top_level.txt,sha256=2qyYWGLakgBRy4BqoBNt-I5C29tBr_e93e5e1pbuTGA,15
|
|
30
|
-
fosslight_util-1.4.34.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|