fosslight-util 1.4.41__py3-none-any.whl → 1.4.43__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/cover.py +4 -1
- fosslight_util/download.py +23 -2
- fosslight_util/set_log.py +3 -1
- {fosslight_util-1.4.41.dist-info → fosslight_util-1.4.43.dist-info}/METADATA +7 -2
- {fosslight_util-1.4.41.dist-info → fosslight_util-1.4.43.dist-info}/RECORD +9 -9
- {fosslight_util-1.4.41.dist-info → fosslight_util-1.4.43.dist-info}/LICENSE +0 -0
- {fosslight_util-1.4.41.dist-info → fosslight_util-1.4.43.dist-info}/WHEEL +0 -0
- {fosslight_util-1.4.41.dist-info → fosslight_util-1.4.43.dist-info}/entry_points.txt +0 -0
- {fosslight_util-1.4.41.dist-info → fosslight_util-1.4.43.dist-info}/top_level.txt +0 -0
fosslight_util/cover.py
CHANGED
|
@@ -14,9 +14,10 @@ class CoverItem:
|
|
|
14
14
|
start_time_key = "Start time"
|
|
15
15
|
python_ver_key = "Python version"
|
|
16
16
|
analyzed_path_key = "Analyzed path"
|
|
17
|
+
excluded_path_key = "Excluded path"
|
|
17
18
|
comment_key = "Comment"
|
|
18
19
|
|
|
19
|
-
def __init__(self, tool_name="", start_time="", input_path="", comment=""):
|
|
20
|
+
def __init__(self, tool_name="", start_time="", input_path="", comment="", exclude_path=[]):
|
|
20
21
|
self.tool_name = tool_name
|
|
21
22
|
if start_time:
|
|
22
23
|
date, time = start_time.split('_')
|
|
@@ -24,6 +25,7 @@ class CoverItem:
|
|
|
24
25
|
else:
|
|
25
26
|
self.start_time = ""
|
|
26
27
|
self.input_path = os.path.abspath(input_path)
|
|
28
|
+
self.exclude_path = ", ".join(exclude_path)
|
|
27
29
|
self.comment = comment
|
|
28
30
|
|
|
29
31
|
self.tool_version = print_package_version(self.tool_name, "", False)
|
|
@@ -39,6 +41,7 @@ class CoverItem:
|
|
|
39
41
|
json_item[self.start_time_key] = self.start_time
|
|
40
42
|
json_item[self.python_ver_key] = self.python_version
|
|
41
43
|
json_item[self.analyzed_path_key] = self.input_path
|
|
44
|
+
json_item[self.excluded_path_key] = self.exclude_path
|
|
42
45
|
json_item[self.comment_key] = self.comment
|
|
43
46
|
|
|
44
47
|
return json_item
|
fosslight_util/download.py
CHANGED
|
@@ -61,13 +61,21 @@ def change_src_link_to_https(src_link):
|
|
|
61
61
|
return src_link
|
|
62
62
|
|
|
63
63
|
|
|
64
|
+
def change_ssh_link_to_https(src_link):
|
|
65
|
+
src_link = src_link.replace("git@github.com:", "https://github.com/")
|
|
66
|
+
return src_link
|
|
67
|
+
|
|
68
|
+
|
|
64
69
|
def parse_src_link(src_link):
|
|
65
70
|
src_info = {"url": src_link}
|
|
66
71
|
src_link_changed = ""
|
|
67
|
-
if src_link.startswith("git://") or src_link.startswith("
|
|
72
|
+
if src_link.startswith("git://") or src_link.startswith("git@") \
|
|
73
|
+
or src_link.startswith("https://") or src_link.startswith("http://"):
|
|
68
74
|
src_link_split = src_link.split(';')
|
|
69
75
|
if src_link.startswith("git://github.com/"):
|
|
70
76
|
src_link_changed = change_src_link_to_https(src_link_split[0])
|
|
77
|
+
elif src_link.startswith("git@github.com:"):
|
|
78
|
+
src_link_changed = change_ssh_link_to_https(src_link_split[0])
|
|
71
79
|
else:
|
|
72
80
|
if "rubygems.org" in src_link:
|
|
73
81
|
src_info["rubygems"] = True
|
|
@@ -205,11 +213,24 @@ def get_github_ossname(link):
|
|
|
205
213
|
return oss_name
|
|
206
214
|
|
|
207
215
|
|
|
216
|
+
def get_github_token(git_url):
|
|
217
|
+
github_token = ""
|
|
218
|
+
pattern = r'https://(.*?)@'
|
|
219
|
+
search = re.search(pattern, git_url)
|
|
220
|
+
if search:
|
|
221
|
+
github_token = search.group(1)
|
|
222
|
+
return github_token
|
|
223
|
+
|
|
224
|
+
|
|
208
225
|
def download_git_clone(git_url, target_dir, checkout_to="", tag="", branch=""):
|
|
209
226
|
ref_to_checkout = decide_checkout(checkout_to, tag, branch)
|
|
210
227
|
msg = ""
|
|
211
228
|
oss_name = get_github_ossname(git_url)
|
|
212
229
|
oss_version = ""
|
|
230
|
+
github_token = get_github_token(git_url)
|
|
231
|
+
callbacks = None
|
|
232
|
+
if github_token != "":
|
|
233
|
+
callbacks = git.RemoteCallbacks(credentials=git.UserPass("foo", github_token)) # username is not used, so set to dummy
|
|
213
234
|
|
|
214
235
|
if platform.system() != "Windows":
|
|
215
236
|
signal.signal(signal.SIGALRM, alarm_handler)
|
|
@@ -221,7 +242,7 @@ def download_git_clone(git_url, target_dir, checkout_to="", tag="", branch=""):
|
|
|
221
242
|
Path(target_dir).mkdir(parents=True, exist_ok=True)
|
|
222
243
|
repo = git.clone_repository(git_url, target_dir,
|
|
223
244
|
bare=False, repository=None,
|
|
224
|
-
remote=None, callbacks=
|
|
245
|
+
remote=None, callbacks=callbacks)
|
|
225
246
|
if platform.system() != "Windows":
|
|
226
247
|
signal.alarm(0)
|
|
227
248
|
else:
|
fosslight_util/set_log.py
CHANGED
|
@@ -42,7 +42,7 @@ class CustomAdapter(logging.LoggerAdapter):
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
def init_log(log_file, create_file=True, stream_log_level=logging.INFO,
|
|
45
|
-
file_log_level=logging.DEBUG, main_package_name="", path_to_analyze=""):
|
|
45
|
+
file_log_level=logging.DEBUG, main_package_name="", path_to_analyze="", path_to_exclude=[]):
|
|
46
46
|
|
|
47
47
|
logger = logging.getLogger(constant.LOGGER_NAME)
|
|
48
48
|
|
|
@@ -83,5 +83,7 @@ def init_log(log_file, create_file=True, stream_log_level=logging.INFO,
|
|
|
83
83
|
_result_log["Tool Info"] = pkg_info
|
|
84
84
|
if path_to_analyze != "":
|
|
85
85
|
_result_log["Path to analyze"] = path_to_analyze
|
|
86
|
+
if path_to_exclude != []:
|
|
87
|
+
_result_log["Path to exclude"] = ", ".join(path_to_exclude)
|
|
86
88
|
|
|
87
89
|
return logger, _result_log
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fosslight-util
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.43
|
|
4
4
|
Summary: FOSSLight Util
|
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_util
|
|
6
6
|
Author: LG Electronics
|
|
@@ -152,6 +152,7 @@ If you give a link, the source is downloaded to the target directory through git
|
|
|
152
152
|
|
|
153
153
|
#### How it works
|
|
154
154
|
1. Try git clone.
|
|
155
|
+
1-1. If the link is ssh-url, convert to https-url.
|
|
155
156
|
2. If git clone fails, download it with wget and extract the compressed file.
|
|
156
157
|
3. After extracting the compressed file, delete the compressed file.
|
|
157
158
|
|
|
@@ -165,7 +166,11 @@ If you give a link, the source is downloaded to the target directory through git
|
|
|
165
166
|
|
|
166
167
|
#### How to run
|
|
167
168
|
```
|
|
168
|
-
$ fosslight_download
|
|
169
|
+
$ fosslight_download -s "https://github.com/LGE-OSS/example" -t target_dir/
|
|
170
|
+
```
|
|
171
|
+
If you want to try with private repository, set your github token like below.
|
|
172
|
+
```
|
|
173
|
+
$ fosslight_download -s "https://my_github_token@github.com/Foo/private_repo -t target_dir/"
|
|
169
174
|
```
|
|
170
175
|
|
|
171
176
|
## 👏 How to report issue
|
|
@@ -4,14 +4,14 @@ fosslight_util/compare_yaml.py,sha256=0bapoyS0yrzkiK70K57E8-3wZ_D6mZAJ-24Eq9TYBl
|
|
|
4
4
|
fosslight_util/constant.py,sha256=j9uhncoC2Fn4j4ATNsjUoS91nVXhyGzU6xLyWFj941A,1834
|
|
5
5
|
fosslight_util/convert_excel_to_yaml.py,sha256=7ZsAMMQJIEXrmcl_28nSHvFpGMi1ZiRZYpEfI5O8vP8,2298
|
|
6
6
|
fosslight_util/correct.py,sha256=v4OL8XssYuatcP9G0YhnLChWUiJP8rwoyWDeMmQGT0E,5334
|
|
7
|
-
fosslight_util/cover.py,sha256=
|
|
8
|
-
fosslight_util/download.py,sha256=
|
|
7
|
+
fosslight_util/cover.py,sha256=GZAeGoQGGCx7OEddErS_Mj6pbMCQrdr5jX-CixU4iAA,1607
|
|
8
|
+
fosslight_util/download.py,sha256=4_s1zPEpxPQ7FNkDo0f6MdrQLMOVdjifDO7Y5psqAq8,14484
|
|
9
9
|
fosslight_util/help.py,sha256=xhAf43fuRLOU3TE7jqaxVTizVn4aANDvHaHYQAdaqYc,2154
|
|
10
10
|
fosslight_util/oss_item.py,sha256=JxGokv79z_6Ca4-Aquc_zZEvRqu-xmBunP8Lvy6AIjY,7268
|
|
11
11
|
fosslight_util/output_format.py,sha256=kJpuTuS3XTrsdUd2gsl5GWto5KtJfSej-qkD9azZFdQ,2982
|
|
12
12
|
fosslight_util/parsing_yaml.py,sha256=R2aecMLDoWR-bBdD8qiW0OTn7F5ZC5YNd1Of0YYEJxU,4514
|
|
13
13
|
fosslight_util/read_excel.py,sha256=21T12bSaB69Yp19n-o2qpHMJNWUFoytneaNneRp3qCA,5294
|
|
14
|
-
fosslight_util/set_log.py,sha256=
|
|
14
|
+
fosslight_util/set_log.py,sha256=GsUtbtqmYKgBltHzeaxV3H9gaUWMYQYDJEhr_LdEGoo,3258
|
|
15
15
|
fosslight_util/spdx_licenses.py,sha256=r90hUY4_T-XrHIJHLx1Ox3gWZ3qzdZj9rJFo7AwmkPE,3641
|
|
16
16
|
fosslight_util/timer_thread.py,sha256=5VbZENQPD-N0NUmzEktqGr6Am-e7vxD79K05mmr29g0,433
|
|
17
17
|
fosslight_util/write_excel.py,sha256=FJFmCs6_vJTYNDgp-Cwk0ylkMTjN3u3_Wgxy0yoiGqo,12306
|
|
@@ -23,9 +23,9 @@ fosslight_util/write_yaml.py,sha256=iJcG3ItggoBp8p3m8PAZwULehKo3BlH1qW2rZzlDv8g,
|
|
|
23
23
|
fosslight_util/resources/frequentLicenselist.json,sha256=GUhzK6tu7ok10fekOnmVmUgIGRC-acGABZKTNKfDyYA,4776157
|
|
24
24
|
fosslight_util/resources/frequent_license_nick_list.json,sha256=ryU2C_6ZxHbz90_sUN9OvI9GXkCMLu7oGcmd9W79YYo,5005
|
|
25
25
|
fosslight_util/resources/licenses.json,sha256=mK55z-bhY7Mjpj2KsO1crKGGL-X3F6MBFQJ0zLlx010,240843
|
|
26
|
-
fosslight_util-1.4.
|
|
27
|
-
fosslight_util-1.4.
|
|
28
|
-
fosslight_util-1.4.
|
|
29
|
-
fosslight_util-1.4.
|
|
30
|
-
fosslight_util-1.4.
|
|
31
|
-
fosslight_util-1.4.
|
|
26
|
+
fosslight_util-1.4.43.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
27
|
+
fosslight_util-1.4.43.dist-info/METADATA,sha256=ymBhCoY9sAe4DGu3z8QxmJMg1F7Wews2qO0uR45Z9pI,6418
|
|
28
|
+
fosslight_util-1.4.43.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
29
|
+
fosslight_util-1.4.43.dist-info/entry_points.txt,sha256=bzXX5i7HZ13V8BLKvtu_9KO3ZjtRypH-XszOXT6I3bU,69
|
|
30
|
+
fosslight_util-1.4.43.dist-info/top_level.txt,sha256=2qyYWGLakgBRy4BqoBNt-I5C29tBr_e93e5e1pbuTGA,15
|
|
31
|
+
fosslight_util-1.4.43.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|