diff --git a/CHANGELOG.md b/CHANGELOG.md index aab1cdc..03f07ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - `README.md` modified - `AUTHORS.md` updated +- Menu updated - Exit bug fixed - Program details updated ## [0.8] - 2024-11-04 diff --git a/nafas/__main__.py b/nafas/__main__.py index 393e805..66f42d0 100644 --- a/nafas/__main__.py +++ b/nafas/__main__.py @@ -28,11 +28,14 @@ def main(): if silent_flag: tprint("Silent Mode") description_print() + _ = input("Press any key to continue.") + clear_screen() EXIT_FLAG = False while not EXIT_FLAG: input_data = get_input_standard() filtered_data = input_filter(input_data) program_name, level, program_data = get_program_data(filtered_data) + clear_screen() program_description_print(program_name, level, program_data) run(program_data, silent=silent_flag) INPUTINDEX = str( diff --git a/nafas/functions.py b/nafas/functions.py index 004df51..be30c79 100644 --- a/nafas/functions.py +++ b/nafas/functions.py @@ -2,7 +2,7 @@ """nafas functions.""" import time -from nafas.params import NAFAS_DESCRIPTION, NAFAS_NOTICE, NAFAS_CAUTIONS, STANDARD_MENU, STANDARD_MENU_ORDER, STEP_MAP +from nafas.params import NAFAS_DESCRIPTION, NAFAS_TIPS, NAFAS_CAUTIONS, STANDARD_MENU, STANDARD_MENU_ORDER, STEP_MAP from nafas.params import PROGRAMS, PROGRAM_DESCRIPTION, SOUND_MAP, STEP_TEMPLATE, CYCLE_TEMPLATE from nafas.params import SOUND_WARNING_MESSAGE, EXIT_MESSAGE, BAD_INPUT_MESSAGE, PROGRAM_END_MESSAGE from nafas.params import MINUTES_TEMPLATE, SECONDS_TEMPLATE, PROGRAM_TIME_TEMPLATE @@ -148,7 +148,8 @@ def description_print(): :return: None """ print("\n".join(justify(NAFAS_DESCRIPTION.split(), 100))) - print(NAFAS_NOTICE) + print(NAFAS_TIPS) + line() print(NAFAS_CAUTIONS) diff --git a/nafas/params.py b/nafas/params.py index 72a0249..219e8ad 100644 --- a/nafas/params.py +++ b/nafas/params.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- """nafas parameters.""" +NAFAS_VERSION = "0.8" + NAFAS_DESCRIPTION = """ Breathing gymnastics is a system of breathing exercises that focuses on the treatment of various diseases and general health promotion. Nafas is a collection of breathing gymnastics designed to reduce the exhaustion of long working hours. @@ -8,8 +10,8 @@ No need to walk away to take a break, just sit comfortably, run Nafas and let the journey begin. """ -NAFAS_NOTICE = """ -Please consider the following : +NAFAS_TIPS = """ +Breathing tips: 1. Inhaling is only done through the nose 2. Exhaling, you can use both nose and mouth @@ -24,8 +26,6 @@ 3. If you feel dizzy, nauseous, or lightheaded stop practicing and rest """ -NAFAS_VERSION = "0.8" - SOUND_WARNING_MESSAGE = "Your device is not compatible with our underlying sound-playing library. You can refer to https://github.com/openscilab/nava." EXIT_MESSAGE = "See you. Bye!" @@ -34,7 +34,7 @@ PROGRAM_END_MESSAGE = "Well done!" -PROGRAM_DESCRIPTION = """Program Details : +PROGRAM_DESCRIPTION = """Program details: Name : {0} @@ -55,13 +55,13 @@ PROGRAM_TIME_TEMPLATE = "{0}- {1} (~ {2})" -MENU_TEMPLATE_1 = "- Please choose a {0} : \n" +MENU_TEMPLATE_1 = "- Choose a {0}: \n" MENU_TEMPLATE_2 = "{0}- {1}" -CYCLE_TEMPLATE = "Cycle : {0} (Remaining : {1})" +CYCLE_TEMPLATE = "Cycle: {0} (Remaining: {1})" -STEP_TEMPLATE = "- {0} for {1} sec" +STEP_TEMPLATE = "- {0} for {1} seconds" STANDARD_MENU = { "program": { diff --git a/test/test.py b/test/test.py index 523bd96..75a6855 100644 --- a/test/test.py +++ b/test/test.py @@ -18,12 +18,13 @@ oxygen level. No need to walk away to take a break, just sit comfortably, run Nafas and let the journey begin. -Please consider the following : +Breathing tips: 1. Inhaling is only done through the nose 2. Exhaling, you can use both nose and mouth 3. When exhaling through your mouth, it is recommended to fold the lips +###################################################################### Cautions: @@ -60,7 +61,7 @@ >>> def test_keyboard_interrupt(i): ... raise KeyboardInterrupt >>> input_data = get_input_standard(lambda x: "1") -- Please choose a program : +- Choose a program: 1- Clear Mind (~ 7 minutes) 2- Relax1 (~ 7 minutes) @@ -76,7 +77,7 @@ 12- Decision-Making (~ 2 minutes) 13- Balancing (~ 2 minutes) 14- Energizing (~ 2 minutes) -- Please choose a level : +- Choose a level: 1- Beginner 2- Medium @@ -96,7 +97,7 @@ True >>> program_description_print("Clear Mind","Beginner",{"ratio": [1, 0, 3, 0], "unit": 3, "pre": 3, "cycle": 35}) ###################################################################### -Program Details : +Program details: Name : Clear Mind @@ -116,16 +117,16 @@ ###################################################################### Start ###################################################################### -Cycle : 1 (Remaining : 1) -- Inhale for 1 sec +Cycle: 1 (Remaining: 1) +- Inhale for 1 seconds . -- Exhale for 3 sec +- Exhale for 3 seconds . . . ###################################################################### -Cycle : 2 (Remaining : 0) -- Inhale for 1 sec +Cycle: 2 (Remaining: 0) +- Inhale for 1 seconds . -- Exhale for 3 sec +- Exhale for 3 seconds . . . ###################################################################### Well done! @@ -134,16 +135,16 @@ ###################################################################### Start ###################################################################### -Cycle : 1 (Remaining : 1) -- Inhale for 1 sec +Cycle: 1 (Remaining: 1) +- Inhale for 1 seconds . -- Exhale for 3 sec +- Exhale for 3 seconds . . . ###################################################################### -Cycle : 2 (Remaining : 0) -- Inhale for 1 sec +Cycle: 2 (Remaining: 0) +- Inhale for 1 seconds . -- Exhale for 3 sec +- Exhale for 3 seconds . . . ###################################################################### Well done! @@ -152,16 +153,16 @@ ###################################################################### Start ###################################################################### -Cycle : 1 (Remaining : 1) -- Inhale for 1 sec +Cycle: 1 (Remaining: 1) +- Inhale for 1 seconds . -- Exhale for 3.3 sec +- Exhale for 3.3 seconds . . . . ###################################################################### -Cycle : 2 (Remaining : 0) -- Inhale for 1 sec +Cycle: 2 (Remaining: 0) +- Inhale for 1 seconds . -- Exhale for 3.3 sec +- Exhale for 3.3 seconds . . . . ###################################################################### Well done!