|
| 1 | +#!/usr/bin/env python |
| 2 | +# -*- coding: utf-8 -*- |
| 3 | +# Copyright (c) 2021 LG Electronics Inc. |
| 4 | +# SPDX-License-Identifier: Apache-2.0 |
| 5 | +from fosslight_util.output_format import write_output_file |
| 6 | +from fosslight_util.set_log import init_log |
| 7 | + |
| 8 | + |
| 9 | +def main(): |
| 10 | + logger, _result_log = init_log("test_result/output_format/log_write_output.txt") |
| 11 | + |
| 12 | + sheet_list = {'SRC_FL_Source': [ |
| 13 | + ['test/lib/babel-polyfill.js', '', '', 'bsd-3-clause,facebook-patent-rights-2', '', '', |
| 14 | + 'Copyright (c) 2014, Facebook, Inc.', 'Exclude', ''], |
| 15 | + ['requirements.txt', '', '', 'MIT', 'https://pypi.org/project/future/0.18.2', '', '', '', ''], |
| 16 | + ['bower.json', '', '', 'mit', '', '', '', '', ''], |
| 17 | + ['LICENSE', '', '', 'mit', '', '', 'Copyright (c) 2016-2021, The Cytoscape Consortium', '', ''], |
| 18 | + ['license-update.js', '', '', 'mit', '', '', 'Copyright (c) 2016-$ year, The Cytoscape Consortium', '', ''], |
| 19 | + ['package.json', '', '', 'mit', '', '', '', '', ''], ['README.md', '', '', 'mit', '', '', '', '', ''], |
| 20 | + ['dist/cytoscape.cjs.js', '', '', 'mit', '', '', 'Copyright Gaetan Renaudeau,Copyright (c) 2016-2021,c \ |
| 21 | + The Cytoscape Consortium,copyright Koen Bok,Copyright (c) 2013-2014 Ralf S. Engelschall \ |
| 22 | + (http://engelschall.com)', '', ''], |
| 23 | + ['dist/cytoscape.esm.js', '', '', 'mit', '', '', 'Copyright Gaetan Renaudeau,Copyright (c) 2016-2021,\ |
| 24 | + The Cytoscape Consortium,copyright Koen Bok,Copyright (c) 2013-2014 Ralf S. Engelschall \ |
| 25 | + (http://engelschall.com)', '', ''], |
| 26 | + ['dist/cytoscape.esm.min.js', '', '', 'mit', '', '', 'Copyright Gaetan Renaudeau,copyright Koen Bok, \ |
| 27 | + Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)', '', ''], |
| 28 | + ['dist/cytoscape.min.js', '', '', 'mit', |
| 29 | + '', '', 'Copyright Gaetan Renaudeau,Copyright (c) 2016-2021, The Cytoscape Consortium,copyright Koen Bok,Copyright \ |
| 30 | + (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)', '', ''], |
| 31 | + ['dist/cytoscape.umd.js', '', '', 'mit', '', '', |
| 32 | + 'Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors,Copyright jQuery Foundation \ |
| 33 | + and other contributors <https://jquery.org/>,Copyright (c) 2016-2021, The Cytoscape Consortium,copyright Koen\ |
| 34 | + Bok,Copyright Gaetan Renaudeau,Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)', '', ''], |
| 35 | + ['documentation/css/highlight/monokai_sublime.css', '', '', 'mit', '', '', '', '', ''], |
| 36 | + ['documentation/js/cytoscape.min.js', '', '', 'mit', '', '', 'Copyright Gaetan Renaudeau,\ |
| 37 | + Copyright (c) 2016-2021, The Cytoscape Consortium,copyright Koen Bok, \ |
| 38 | + Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)', '', ''], |
| 39 | + ['documentation/md/links.md', '', '', 'mit', '', '', '', '', ''], |
| 40 | + ['src/event.js', '', '', 'mit', '', '', '', '', '']], |
| 41 | + 'BIN_FL_Binary': [ |
| 42 | + ['askalono_macos', 'askalono', '', 'Apache-2.0', '', '', '', '', ''], |
| 43 | + ['test/askalono_macos', 'askalono', '', 'Apache-2.0', '', '', '', 'Exclude', '']], |
| 44 | + 'SRC_FL_Dependency': [ |
| 45 | + ['requirements.txt', 'pypi:future', '0.18.2', 'MIT', 'https://pypi.org/project/future/0.18.2', |
| 46 | + 'https://python-future.org', '', '', ''], |
| 47 | + ['requirements.txt', 'pypi:numpy', '1.19.5', 'BSD-3-Clause-Open-MPI,GCC-exception-3.1,GPL-3.0', |
| 48 | + 'https://pypi.org/project/numpy/1.19.5', 'https://www.numpy.org', '', '', ''], |
| 49 | + ['requirements.txt', 'pypi:pandas', '1.1.5', 'BSD-3-Clause', 'https://pypi.org/project/pandas/1.1.5', |
| 50 | + 'https://pandas.pydata.org', '', '', '']]} |
| 51 | + |
| 52 | + logger.warning("TESTING - Writing an excel output") |
| 53 | + success, msg = write_output_file( |
| 54 | + 'test_result/output_format/FL-TEST_Excel.xlsx', '.xlsx', sheet_list) |
| 55 | + logger.warning("Result:" + str(success) + ", error_msg:" + msg) |
| 56 | + |
| 57 | + logger.warning("TESTING - Writing an opossum output") |
| 58 | + success, msg = write_output_file( |
| 59 | + 'test_result/output_format/FL-TEST_opossum.json', '.json', sheet_list) |
| 60 | + logger.warning("Result:" + str(success) + ", error_msg:" + msg) |
| 61 | + |
| 62 | + |
| 63 | +if __name__ == '__main__': |
| 64 | + main() |
0 commit comments