Skip to content

Commit 407bb9d

Browse files
Merge pull request #47 from sepandhaghighi/dev
Version 0.4
2 parents cec1165 + 20bee34 commit 407bb9d

21 files changed

+214
-60
lines changed

Diff for: .github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: https://github.com/sepandhaghighi/nafas#show-your-support

Diff for: .github/dependabot.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
time: "01:30"
8+
open-pull-requests-limit: 10
9+
target-branch: dev

Diff for: .github/workflows/test.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ jobs:
2929
python -m nafas test
3030
- name: Install dev-requirements
3131
run: |
32-
pip install --upgrade --upgrade-strategy=only-if-needed -r dev-requirements.txt
32+
python otherfiles/requirements-splitter.py
33+
pip install --upgrade --upgrade-strategy=only-if-needed -r test-requirements.txt
3334
- name: Version check
3435
run: |
3536
python otherfiles/version_check.py
37+
if: matrix.python-version == 3.7
3638
- name: Test with pytest
3739
run: |
3840
python -m pytest test --cov=nafas --cov-report=term
@@ -41,6 +43,8 @@ jobs:
4143
python -m vulture nafas/ setup.py --min-confidence 65 --exclude=__init__.py --sort-by-size
4244
python -m bandit -r nafas -s B311
4345
python -m pydocstyle --match-dir=nafas -v
46+
if: matrix.python-version == 3.7
4447
- name: Codecov
4548
run: |
4649
codecov
50+
if: matrix.python-version == 3.7 && matrix.os == 'ubuntu-latest'

Diff for: CHANGELOG.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
## [0.4] - 2021-05-12
9+
### Added
10+
- `start.wav`
11+
- `well_done.wav`
12+
- `preparing.wav`
13+
- `requirements-splitter.py`
14+
- 4-7-8 program
15+
- 7-11 program
16+
### Changed
17+
- Sound speaker changed
18+
- Test system modified
19+
- Menu optimized
820
## [0.3] - 2021-02-09
921
### Changed
1022
- Sounds bug in pypi fixed
@@ -38,7 +50,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3850
- Anti-Appetite program
3951
- Cigarette Replace program
4052

41-
[Unreleased]: https://github.com/sepandhaghighi/nafas/compare/v0.3...dev
53+
[Unreleased]: https://github.com/sepandhaghighi/nafas/compare/v0.4...dev
54+
[0.4]: https://github.com/sepandhaghighi/nafas/compare/v0.3...v0.4
4255
[0.3]: https://github.com/sepandhaghighi/nafas/compare/v0.2...v0.3
4356
[0.2]: https://github.com/sepandhaghighi/nafas/compare/v0.1...v0.2
4457
[0.1]: https://github.com/sepandhaghighi/nafas/compare/c58087a...v0.1

Diff for: README.md

+35-14
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* [References](https://github.com/sepandhaghighi/nafas#references)
2222
* [Authors](https://github.com/sepandhaghighi/nafas/blob/master/AUTHORS.md)
2323
* [License](https://github.com/sepandhaghighi/nafas/blob/master/LICENSE)
24-
* [Donate](https://github.com/sepandhaghighi/nafas#donate-to-our-project)
24+
* [Show Your Support](https://github.com/sepandhaghighi/nafas#show-your-support)
2525
* [Changelog](https://github.com/sepandhaghighi/nafas/blob/master/CHANGELOG.md)
2626
* [Code of Conduct](https://github.com/sepandhaghighi/nafas/blob/master/.github/CODE_OF_CONDUCT.md)
2727

@@ -76,19 +76,19 @@ No need to walk away to take a break, just sit comfortably, run Nafas and let th
7676
## Installation
7777

7878
### Source Code
79-
- Download [Version 0.3](https://github.com/sepandhaghighi/nafas/archive/v0.3.zip) or [Latest Source ](https://github.com/sepandhaghighi/nafas/archive/dev.zip)
79+
- Download [Version 0.4](https://github.com/sepandhaghighi/nafas/archive/v0.4.zip) or [Latest Source ](https://github.com/sepandhaghighi/nafas/archive/dev.zip)
8080
- `pip install -r requirements.txt` or `pip3 install -r requirements.txt` (Need root access)
8181
- `python3 setup.py install` or `python setup.py install` (Need root access)
8282

8383
### PyPI
8484

8585
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
86-
- `pip install nafas==0.3` or `pip3 install nafas==0.3` (Need root access)
86+
- `pip install nafas==0.4` or `pip3 install nafas==0.4` (Need root access)
8787

8888

8989
### Exe Version (Only Windows)
90-
- Download [Exe-Version 0.3](https://github.com/sepandhaghighi/nafas/releases/download/v0.3/NAFAS-0.3.exe)
91-
- Run `NAFAS-0.3.exe`
90+
- Download [Exe-Version 0.4](https://github.com/sepandhaghighi/nafas/releases/download/v0.4/NAFAS-0.4.exe)
91+
- Run `NAFAS-0.4.exe`
9292

9393

9494
## Usage
@@ -135,20 +135,41 @@ or send an email to [[email protected]](mailto:[email protected] "[email protected]").
135135

136136
<blockquote>6- Bujatti, M., and P. Biederer. "Serotonin, noradrenaline, dopamine metabolites in transcendental meditation-technique." Journal of Neural Transmission 39, no. 3 (1976): 257-267. </blockquote>
137137

138-
<blockquote>7- Martarelli, Daniele, Mario Cocchioni, Stefania Scuri, and Pierluigi Pompei. "Diaphragmatic breathing reduces exercise-induced oxidative stress." Evidence-Based Complementary and Alternative Medicine 2011 (2011). </blockquote>
139-
140-
<blockquote>8- <a href="https://ttsmp3.com/">Free Text-To-Speech and Text-to-MP3 for US English</a> </blockquote>
138+
<blockquote>7- Martarelli, Daniele, Mario Cocchioni, Stefania Scuri, and Pierluigi Pompei. "Diaphragmatic breathing reduces exercise-induced oxidative stress." Evidence-Based Complementary and Alternative Medicine 2011 (2011). </blockquote>
141139

140+
<blockquote>8- <a href="https://www.drweil.com/health-wellness/body-mind-spirit/stress-anxiety/breathing-three-exercises/">DrWeil, Integrative Medicine & Healthy Living</a> </blockquote>
142141

143-
## Donate to our project
144-
142+
<blockquote>9- <a href="https://www.hgi.org.uk/resources/delve-our-extensive-library/resources-and-techniques/7-11-breathing-how-does-deep">Human Givens Institute</a> </blockquote>
143+
144+
<blockquote>10- <a href="https://ttsmp3.com/">Free Text-To-Speech and Text-to-MP3 for US English</a> </blockquote>
145145

146-
<h3>Bitcoin :</h3>
147146

148-
```1XGr9qbZjBpUQJJSB6WtgBQbDTgrhPLPA```
147+
## Show your support
148+
149+
<h3>Star this repo</h3>
149150

151+
Give a ⭐️ if this project helped you!
150152

153+
<h3>Donate to our project</h3>
151154

152-
<h3>Payping (For Iranian citizens) :</h3>
155+
<h4>Bitcoin</h4>
156+
1KtNLEEeUbTEK9PdN6Ya3ZAKXaqoKUuxCy
157+
<h4>Ethereum</h4>
158+
0xcD4Db18B6664A9662123D4307B074aE968535388
159+
<h4>Litecoin</h4>
160+
Ldnz5gMcEeV8BAdsyf8FstWDC6uyYR6pgZ
161+
<h4>Doge</h4>
162+
DDUnKpFQbBqLpFVZ9DfuVysBdr249HxVDh
163+
<h4>Tron</h4>
164+
TCZxzPZLcJHr2qR3uPUB1tXB6L3FDSSAx7
165+
<h4>Ripple</h4>
166+
rN7ZuRG7HDGHR5nof8nu5LrsbmSB61V1qq
167+
<h4>Binance Coin</h4>
168+
bnb1zglwcf0ac3d0s2f6ck5kgwvcru4tlctt4p5qef
169+
<h4>Tether</h4>
170+
0xcD4Db18B6664A9662123D4307B074aE968535388
171+
<h4>Dash</h4>
172+
Xd3Yn2qZJ7VE8nbKw2fS98aLxR5M6WUU3s
173+
<h4>Stellar</h4>
153174

154-
<a href="http://www.payping.net/sepandhaghighi" target="__blank"><img src="http://www.qpage.ir/images/payping.png" height=100px width=100px></a>
175+
GALPOLPISRHIYHLQER2TLJRGUSZH52RYDK6C3HIU4PSMNAV65Q36EGNL

Diff for: nafas/__main__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
program_name, level, program_data = get_program_data(filtered_data)
2020
program_description_print(program_name, level, program_data)
2121
run(program_data)
22-
INPUTINDEX = str(input("Press [R] to restart or any other key to exit."))
22+
INPUTINDEX = str(
23+
input("Press [R] to restart or any other key to exit."))
2324
if INPUTINDEX.upper() != "R":
2425
EXIT_FLAG = True

Diff for: nafas/functions.py

+20-16
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""nafas functions."""
33

44
import time
5-
from nafas.params import DESCRIPTION, STANDARD_MENU, STEP_MAP, PROGRAMS, PROGRAM_DESCRIPTION, SOUND_MAP, SOUND_ERROR_MESSAGE
5+
from nafas.params import NAFAS_DESCRIPTION, NAFAS_NOTICE, STANDARD_MENU, STEP_MAP, PROGRAMS, PROGRAM_DESCRIPTION, SOUND_MAP, SOUND_ERROR_MESSAGE, STEP_TEMPLATE, CYCLE_TEMPLATE
66
import playsound
77
import threading
88
import os
@@ -92,8 +92,8 @@ def description_print():
9292
9393
:return: None
9494
"""
95-
print("\n".join(justify(DESCRIPTION.split(), 100)))
96-
print("\n")
95+
print("\n".join(justify(NAFAS_DESCRIPTION.split(), 100)))
96+
print(NAFAS_NOTICE)
9797

9898

9999
def program_description_print(program_name, level, program_data):
@@ -261,29 +261,33 @@ def run(program_data):
261261
ratio = program_data["ratio"]
262262
unit = program_data["unit"]
263263
pre = program_data["pre"]
264-
print("Preparing ", end="")
264+
print("Preparing ", end="", flush=True)
265+
sound_thread = play_sound(get_sound_path(SOUND_MAP['Prepare']))
265266
graphic_counter(pre)
266267
line()
267-
time.sleep(unit / 2)
268-
print("Start")
269-
time.sleep(unit / 2)
268+
time.sleep(1)
269+
sound_thread.join()
270+
sound_thread = play_sound(get_sound_path(SOUND_MAP['Start']))
271+
print("Start", flush=True)
272+
time.sleep(1)
273+
sound_thread.join()
270274
line()
271-
time.sleep(unit / 2)
275+
time.sleep(1)
272276
for i in range(cycle):
273-
print("Cycle : " + str(i + 1))
274-
time.sleep(unit / 2)
277+
print(CYCLE_TEMPLATE.format(str(i + 1), str(cycle - i - 1)))
278+
time.sleep(1)
275279
for index, item in enumerate(ratio):
276280
if item != 0:
277281
item_name = STEP_MAP[index]
278282
sound_thread = play_sound(get_sound_path(SOUND_MAP[item_name]))
279283
print(
280-
"- " +
281-
item_name +
282-
" for {0} sec".format(
283-
unit *
284-
item))
284+
STEP_TEMPLATE.format(
285+
item_name, str(
286+
unit * item)), flush=True)
285287
graphic_counter(item * unit)
286288
sound_thread.join()
287289
time.sleep(1)
288290
line()
289-
print("End!")
291+
sound_thread = play_sound(get_sound_path(SOUND_MAP['End']))
292+
print("Well done!", flush=True)
293+
sound_thread.join()

Diff for: nafas/params.py

+89-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
# -*- coding: utf-8 -*-
22
"""nafas parameters."""
33

4-
DESCRIPTION = """
4+
NAFAS_DESCRIPTION = """
55
Breathing gymnastics is a system of breathing exercises that focuses on the treatment of various diseases and general health promotion.
66
Nafas is a collection of breathing gymnastics designed to reduce the exhaustion of long working hours.
77
With multiple breathing patterns, Nafas helps you find your way to a detoxified energetic workday and also improves your concentration by increasing the oxygen level.
88
No need to walk away to take a break, just sit comfortably, run Nafas and let the journey begin.
99
"""
1010

11-
NAFAS_VERSION = "0.3"
11+
NAFAS_NOTICE = """
12+
Please consider the following :
13+
14+
1. Inhaling is only done through the nose
15+
2. Exhaling, you can use both nose and mouth
16+
3. When exhaling through your mouth, it is recommended to fold the lips
17+
"""
18+
19+
NAFAS_VERSION = "0.4"
1220

1321
SOUND_ERROR_MESSAGE = "ERROR : Unable to play sound."
1422

@@ -25,6 +33,10 @@
2533
Sequence : {4}
2634
"""
2735

36+
CYCLE_TEMPLATE = "Cycle : {0} (Remaining : {1})"
37+
38+
STEP_TEMPLATE = "- {0} for {1} sec"
39+
2840
STANDARD_MENU = {
2941
"program": {
3042
1: "Clear Mind",
@@ -34,7 +46,9 @@
3446
5: "Harmony",
3547
6: "Anti-Stress",
3648
7: "Anti-Appetite",
37-
8: "Cigarette Replace"},
49+
8: "Cigarette Replace",
50+
9: "4-7-8(Relaxing Breath)",
51+
10: "7-11(Relaxing Breath)"},
3852
"level": {
3953
1: "Beginner",
4054
2: "Medium",
@@ -72,6 +86,66 @@
7286

7387
HARMONY_ADVANCED = {"ratio": [1, 5, 2, 1], "unit": 3, "pre": 3, "cycle": 16}
7488

89+
FOUR_SEVEN_EIGHT_BEGINNER = {
90+
"ratio": [
91+
4,
92+
7,
93+
8,
94+
0],
95+
"unit": 1,
96+
"pre": 3,
97+
"cycle": 4}
98+
99+
FOUR_SEVEN_EIGHT_MEDIUM = {
100+
"ratio": [
101+
4,
102+
7,
103+
8,
104+
0],
105+
"unit": 1,
106+
"pre": 3,
107+
"cycle": 8}
108+
109+
FOUR_SEVEN_EIGHT_ADVANCED = {
110+
"ratio": [
111+
4,
112+
7,
113+
8,
114+
0],
115+
"unit": 1,
116+
"pre": 3,
117+
"cycle": 12}
118+
119+
SEVEN_ELEVEN_BEGINNER = {
120+
"ratio": [
121+
7,
122+
0,
123+
11,
124+
0],
125+
"unit": 1,
126+
"pre": 3,
127+
"cycle": 15}
128+
129+
SEVEN_ELEVEN_MEDIUM = {
130+
"ratio": [
131+
7,
132+
0,
133+
11,
134+
0],
135+
"unit": 1,
136+
"pre": 3,
137+
"cycle": 20}
138+
139+
SEVEN_ELEVEN_ADVANCED = {
140+
"ratio": [
141+
7,
142+
0,
143+
11,
144+
0],
145+
"unit": 1,
146+
"pre": 3,
147+
"cycle": 24}
148+
75149
ANTI_STRESS_BEGINNER = {
76150
"ratio": [
77151
3,
@@ -186,12 +260,22 @@
186260
"Advanced": CIGARETTE_REPLACE_ADVANCED},
187261
"Harmony": {"Beginner": HARMONY_BEGINNER,
188262
"Medium": HARMONY_MEDIUM,
189-
"Advanced": HARMONY_ADVANCED}}
263+
"Advanced": HARMONY_ADVANCED},
264+
"4-7-8(Relaxing Breath)": {"Beginner": FOUR_SEVEN_EIGHT_BEGINNER,
265+
"Medium": FOUR_SEVEN_EIGHT_MEDIUM,
266+
"Advanced": FOUR_SEVEN_EIGHT_ADVANCED},
267+
"7-11(Relaxing Breath)": {"Beginner": SEVEN_ELEVEN_BEGINNER,
268+
"Medium": SEVEN_ELEVEN_MEDIUM,
269+
"Advanced": SEVEN_ELEVEN_ADVANCED}
270+
}
190271

191272

192273
SOUND_MAP = {
274+
"Start": "start.wav",
275+
"Prepare": "preparing.wav",
193276
"Inhale": "inhale.wav",
194277
"Exhale": "exhale.wav",
195278
"Retain": "retain.wav",
196-
"Sustain": "sustain.wav"
279+
"Sustain": "sustain.wav",
280+
"End": "well_done.wav",
197281
}

Diff for: nafas/sounds/exhale.wav

378 Bytes
Binary file not shown.

Diff for: nafas/sounds/inhale.wav

-19.8 KB
Binary file not shown.

Diff for: nafas/sounds/preparing.wav

31.6 KB
Binary file not shown.

Diff for: nafas/sounds/retain.wav

1.66 KB
Binary file not shown.

Diff for: nafas/sounds/start.wav

28.2 KB
Binary file not shown.

Diff for: nafas/sounds/sustain.wav

-1.75 KB
Binary file not shown.

Diff for: nafas/sounds/well_done.wav

30.5 KB
Binary file not shown.

Diff for: otherfiles/Version.rc

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
VSVersionInfo(
22
ffi=FixedFileInfo(
3-
filevers=(0, 3, 0, 0),
4-
prodvers=(0, 3, 0, 0),
3+
filevers=(0, 4, 0, 0),
4+
prodvers=(0, 4, 0, 0),
55
mask=0x3f,
66
flags=0x0,
77
OS=0x40004,
@@ -16,12 +16,12 @@ VSVersionInfo(
1616
u'040904B0',
1717
[StringStruct(u'CompanyName', u'Sepand Haghighi'),
1818
StringStruct(u'FileDescription', u'NAFAS.exe'),
19-
StringStruct(u'FileVersion', u'0.3.0.0'),
19+
StringStruct(u'FileVersion', u'0.4.0.0'),
2020
StringStruct(u'InternalName', u'NAFAS.exe'),
2121
StringStruct(u'LegalCopyright', u'Copyright (c) 2021 Sepand Haghighi'),
2222
StringStruct(u'OriginalFilename', u'NAFAS.exe'),
2323
StringStruct(u'ProductName', u'NAFAS'),
24-
StringStruct(u'ProductVersion', u'0, 3, 0, 0')])
24+
StringStruct(u'ProductVersion', u'0, 4, 0, 0')])
2525
]),
2626
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
2727
]

Diff for: otherfiles/logo.png

9.2 KB
Loading

0 commit comments

Comments
 (0)