Skip to content

Commit 8aa3f72

Browse files
committed
Add a spinner when scanning
1 parent a7676ef commit 8aa3f72

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
scancode-toolkit<=21.2.25
22
typecode_libmagic
3-
XlsxWriter
3+
XlsxWriter
4+
progress

setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
if __name__ == "__main__":
1515
setup(
1616
name='fosslight_source',
17-
version='1.4.0',
17+
version='1.4.1',
1818
package_dir={"": "src"},
1919
packages=find_packages(where='src'),
2020
description='FOSSLight Source',
@@ -24,8 +24,12 @@
2424
author='LG Electronics',
2525
url='https://github.com/fosslight/fosslight_source',
2626
download_url='https://github.com/fosslight/fosslight_source',
27-
classifiers=['Programming Language :: Python :: 3.6',
28-
'License :: OSI Approved :: Apache Software License'],
27+
classifiers=['License :: OSI Approved :: Apache Software License',
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3.6",
30+
"Programming Language :: Python :: 3.7",
31+
"Programming Language :: Python :: 3.8",
32+
"Programming Language :: Python :: 3.9", ],
2933
install_requires=required,
3034
entry_points={
3135
"console_scripts": [
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
# Copyright (c) 2021 LG Electronics Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
import threading
6+
import time
7+
from progress.spinner import Spinner
8+
9+
class TimerThread(threading.Thread):
10+
def __init__(self):
11+
threading.Thread.__init__(self, name=' Thread')
12+
13+
def run(self):
14+
spinner = Spinner('')
15+
while True:
16+
time.sleep(1)
17+
spinner.next()

src/fosslight_source/run_scancode.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from ._write_oss_report_src import write_result_to_csv, write_result_to_excel
1717
from ._parsing_scancode_file_item import parsing_file_item
1818
from ._settings import init_log
19+
from ._timer_thread import TimerThread
1920

2021
logger = logging.getLogger(__name__)
2122
warnings.filterwarnings("ignore", category=FutureWarning)
@@ -48,6 +49,9 @@ def main():
4849
except Exception:
4950
print_help_msg()
5051

52+
timer = TimerThread()
53+
timer.setDaemon(True)
54+
timer.start()
5155
success, msg = run_scan(_path_to_scan, _output_file, _write_json_file, -1)
5256

5357

0 commit comments

Comments
 (0)