Skip to content

Commit acef9ed

Browse files
committed
Not print progress barin add mmode when interactive working
1 parent 32c53bb commit acef9ed

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ flake8==3.9.2
33
pytest
44
pytest-cov
55
pytest-flake8
6+
importlib-metadata==4.2.0

src/fosslight_prechecker/_add.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def add_content(target_path="", input_license="", input_copyright="", output_pat
419419
all_files_list = get_allfiles_list(path_to_find)
420420

421421
# Get missing license / copyright file list
422-
missing_license, missing_copyright, _, project, _ = precheck_for_project(path_to_find, need_log_file)
422+
missing_license, missing_copyright, _, project, _ = precheck_for_project(path_to_find)
423423

424424
# Print Skipped Files
425425
missing_license_filtered, missing_copyright_filtered = \

src/fosslight_prechecker/_precheck.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def precheck_for_files(path, files):
157157
return missing_license_list, missing_copyright_list, prj
158158

159159

160-
def precheck_for_project(path_to_find, need_log_file):
160+
def precheck_for_project(path_to_find):
161161
missing_license = []
162162
missing_copyright = []
163163

@@ -166,18 +166,9 @@ def precheck_for_project(path_to_find, need_log_file):
166166
need_rollback, temp_file_name, temp_dir_name = create_reuse_dep5_file(path_to_find)
167167

168168
try:
169-
if need_log_file:
170-
# Use ProgressBar
171-
timer = TimerThread()
172-
timer.setDaemon(True)
173-
timer.start()
174-
175169
project = Project(path_to_find)
176170
report = ProjectReport.generate(project)
177171

178-
if need_log_file:
179-
timer.stop = True
180-
181172
# File list that missing license text
182173
missing_license = [str(sub) for sub in set(report.files_without_licenses)]
183174
if not path_to_find.endswith("/"):
@@ -267,10 +258,18 @@ def run_lint(target_path, disable, output_file_name, format='', need_log_file=Tr
267258
oss_pkg_info = []
268259
_turn_on_default_reuse_config = not disable
269260

261+
if need_log_file:
262+
# Use ProgressBar
263+
timer = TimerThread()
264+
timer.setDaemon(True)
265+
timer.start()
266+
270267
if _check_only_file_mode:
271268
license_missing_files, copyright_missing_files, project = precheck_for_files(path_to_find, file_to_check_list)
272269
else:
273-
license_missing_files, copyright_missing_files, oss_pkg_info, project, report = precheck_for_project(path_to_find, need_log_file)
270+
license_missing_files, copyright_missing_files, oss_pkg_info, project, report = precheck_for_project(path_to_find)
271+
if need_log_file:
272+
timer.stop = True
274273

275274
result_item = result_for_summary(path_to_find,
276275
oss_pkg_info,

0 commit comments

Comments
 (0)