From 68ba66276bc1bb1195c3983b3ed8ef3b1f05d405 Mon Sep 17 00:00:00 2001 From: JaekwonBang Date: Thu, 13 May 2021 16:43:52 +0900 Subject: [PATCH 1/3] Modify Help Message --- src/fosslight_util/_help.py | 23 ++++++++++++----------- tests/test_help.py | 27 +++++++++++++++++++++++++++ tox.ini | 2 ++ 3 files changed, 41 insertions(+), 11 deletions(-) create mode 100755 tests/test_help.py diff --git a/src/fosslight_util/_help.py b/src/fosslight_util/_help.py index 8551def..b34d701 100644 --- a/src/fosslight_util/_help.py +++ b/src/fosslight_util/_help.py @@ -1,19 +1,20 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2021 LG Electronics Inc. -# SPDX-License-Identifier: LicenseRef-LGE-Proprietary -_HELP_MESSAGE_COMMON = """ - _______ _______ _______ _______ ___ ___ _______ __ __ _______ - | || || || || | | | | || | | || | - | ___|| _ || _____|| _____|| | | | | ___|| |_| ||_ _| - | |___ | | | || |_____ | |_____ | | | | | | __ | | | | - | ___|| |_| ||_____ ||_____ || |___ | | | || || _ | | | - | | | | _____| | _____| || || | | |_| || | | | | | - |___| |_______||_______||_______||_______||___| |_______||__| |__| |___| -""" +# SPDX-License-Identifier: Apache-2.0 from abc import * +_HELP_MESSAGE_COMMON = """ + _______ _______ _______ _______ ___ ___ _______ __ __ _______ + | || || || || | | | | || | | || | + | ___|| _ || _____|| _____|| | | | | ___|| |_| ||_ _| + | |___ | | | || |_____ | |_____ | | | | | | __ | | | | + | ___|| |_| ||_____ ||_____ || |___ | | | || || _ | | | + | | | | _____| | _____| || || | | |_| || | | | | | + |___| |_______||_______||_______||_______||___| |_______||__| |__| |___| + """ + class PrintHelpMsgBase(metaclass=ABCMeta): @abstractmethod def print_help_msg(self): - print(_HELP_MESSAGE_COMMON) \ No newline at end of file + print(_HELP_MESSAGE_COMMON) diff --git a/tests/test_help.py b/tests/test_help.py new file mode 100755 index 0000000..c922642 --- /dev/null +++ b/tests/test_help.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2021 LG Electronics Inc. +# SPDX-License-Identifier: Apache-2.0 +from fosslight_util._help import PrintHelpMsgBase + +_HELP_MESSAGE_TEST = """ + Usage Test [Test] + + Test Test Test + """ + + +class PrintHelpMsg(PrintHelpMsgBase): + def print_help_msg(self): + super().print_help_msg() + print(_HELP_MESSAGE_TEST) + + +helpMsg = PrintHelpMsg() + + +def main(): + helpMsg.print_help_msg() + +if __name__ == '__main__': + main() diff --git a/tox.ini b/tox.ini index 3e60d26..7e44441 100644 --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,8 @@ setenv = PYTHONPATH=. commands = + # Test - print help msg + python tests/test_help.py # Test - logging python tests/test_log.py ls test_result From e4dce0bd5e15c36e36de86a973dcc50e129622b1 Mon Sep 17 00:00:00 2001 From: JaekwonBang Date: Thu, 13 May 2021 16:50:59 +0900 Subject: [PATCH 2/3] Modify version to 1.0.6 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 40e1fe4..312b4f7 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ if __name__ == "__main__": setup( name='fosslight_util', - version='1.0.4', + version='1.0.6', package_dir={"": "src"}, packages=find_packages(where='src'), description='FOSSLight Util', From 8a0fb9317727306054a900722e5fc286953769a9 Mon Sep 17 00:00:00 2001 From: JaekwonBang Date: Thu, 13 May 2021 17:25:59 +0900 Subject: [PATCH 3/3] Modify Help Msg using suffix --- src/fosslight_util/_help.py | 20 -------------------- tests/test_help.py | 23 +++++++---------------- 2 files changed, 7 insertions(+), 36 deletions(-) delete mode 100644 src/fosslight_util/_help.py diff --git a/src/fosslight_util/_help.py b/src/fosslight_util/_help.py deleted file mode 100644 index b34d701..0000000 --- a/src/fosslight_util/_help.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2021 LG Electronics Inc. -# SPDX-License-Identifier: Apache-2.0 -from abc import * - -_HELP_MESSAGE_COMMON = """ - _______ _______ _______ _______ ___ ___ _______ __ __ _______ - | || || || || | | | | || | | || | - | ___|| _ || _____|| _____|| | | | | ___|| |_| ||_ _| - | |___ | | | || |_____ | |_____ | | | | | | __ | | | | - | ___|| |_| ||_____ ||_____ || |___ | | | || || _ | | | - | | | | _____| | _____| || || | | |_| || | | | | | - |___| |_______||_______||_______||_______||___| |_______||__| |__| |___| - """ - -class PrintHelpMsgBase(metaclass=ABCMeta): - @abstractmethod - def print_help_msg(self): - print(_HELP_MESSAGE_COMMON) diff --git a/tests/test_help.py b/tests/test_help.py index c922642..06c4c17 100755 --- a/tests/test_help.py +++ b/tests/test_help.py @@ -2,25 +2,16 @@ # -*- coding: utf-8 -*- # Copyright (c) 2021 LG Electronics Inc. # SPDX-License-Identifier: Apache-2.0 -from fosslight_util._help import PrintHelpMsgBase - -_HELP_MESSAGE_TEST = """ - Usage Test [Test] - - Test Test Test - """ - - -class PrintHelpMsg(PrintHelpMsgBase): - def print_help_msg(self): - super().print_help_msg() - print(_HELP_MESSAGE_TEST) - - -helpMsg = PrintHelpMsg() +from fosslight_util.help import PrintHelpMsg def main(): + _HELP_MESSAGE_TEST = """ + Usage Test [Test] + + Test Test Test + """ + helpMsg = PrintHelpMsg(_HELP_MESSAGE_TEST) helpMsg.print_help_msg() if __name__ == '__main__':