Commit 85ac299f5e4fd1ab34c426ea9a93c6918536a160
menu Screen and the start of help!
Zach committed on 12/4/2017, 7:31:46 PMParent: 4bfdf13b53f35a001ffc963548f4e922cd4a1256
Files changed
__init__.py | changed |
asanas/__init__.py | changed |
asanas/intertwingled.py | changed |
asanas/gather_kriyas.py | added |
asanas/meditation.py | deleted |
asanas/intention.py | added |
asanas/reps.py | added |
components.py | changed |
helper.py | changed |
kriyas/morning-kriya.ini | changed |
kriyas/angelicas-morning.ini | added |
kriyas/example-kriya.ini | deleted |
kriyas/may-kriya.ini | deleted |
kriyas/new-kriya.ini | deleted |
kriyas/salutations.ini | added |
kriyas/powerful-morning.ini | deleted |
kriyas/writing.ini | deleted |
transitions/closing_remark.py | changed |
transitions/settle.py | changed |
transitions/splashpage.py | changed |
menu_screen.py | added |
asanas/__init__.py | ||
---|---|---|
@@ -1,1 +1,1 @@ | ||
1 | -__all__ = ["breath_of_fire", "cat_cow", "intertwingled", "hollow_body", "mantra", "meditation"] | |
1 … | +__all__ = ["intertwingled", "gather_kriyas", "intention","reps"] |
asanas/intertwingled.py | |||
---|---|---|---|
@@ -4,9 +4,9 @@ | |||
4 | 4 … | ||
5 | 5 … | '''These are global variables for the whole kriya-helper ''' | |
6 | 6 … | dir_path = os.path.dirname(os.path.realpath(__file__)) | |
7 | 7 … | ||
8 | -def clear_screen(): | ||
8 … | +def clear(): | ||
9 | 9 … | os.system('cls' if os.name == 'nt' else 'clear') | |
10 | 10 … | ||
11 | 11 … | def beginning(): | |
12 | 12 … | pyglet.resource.path = ['@asanas.sounds'] | |
@@ -64,6 +64,6 @@ | |||
64 | 64 … | ||
65 | 65 … | def sleep(duration): | |
66 | 66 … | mins = 0 | |
67 | 67 … | while mins != duration: | |
68 | - time.sleep(5) | ||
68 … | + time.sleep(60) | ||
69 | 69 … | mins += 1 |
asanas/gather_kriyas.py | ||
---|---|---|
@@ -1,0 +1,19 @@ | ||
1 … | +import os | |
2 … | +import collections | |
3 … | +import configparser | |
4 … | +#Lists for Kriyas and where to find them | |
5 … | +kriya_dict = collections.OrderedDict() | |
6 … | +kriya_list = [] | |
7 … | + | |
8 … | +def main(): | |
9 … | + for file in os.listdir('kriyas'): | |
10 … | + kriya = 'kriyas/{}'.format(file) | |
11 … | + config = configparser.ConfigParser() | |
12 … | + config.read(kriya) | |
13 … | + for section in config.sections(): | |
14 … | + kriya_dict[section] = kriya | |
15 … | + kriya_list.append(section) | |
16 … | + | |
17 … | +if __name__ == "__main__": | |
18 … | + main() | |
19 … | + |
asanas/meditation.py | ||
---|---|---|
@@ -1,47 +1,0 @@ | ||
1 | -import time | |
2 | -from . import intertwingled | |
3 | - | |
4 | -def main(duration): | |
5 | - medi = """ | |
6 | - | |
7 | - | |
8 | - | |
9 | - | |
10 | - | |
11 | - | |
12 | - | |
13 | - | |
14 | - | |
15 | - | |
16 | - | |
17 | -888b d888 888 d8b 888 888 d8b | |
18 | -8888b d8888 888 Y8P 888 888 Y8P | |
19 | -88888b.d88888 888 888 888 | |
20 | -888Y88888P888 .d88b. .d88888 888 888888 8888b. 888888 888 .d88b. 88888b. | |
21 | -888 Y888P 888 d8P Y8b d88" 888 888 888 "88b 888 888 d88""88b 888 "88b | |
22 | -888 Y8P 888 88888888 888 888 888 888 .d888888 888 888 888 888 888 888 | |
23 | -888 " 888 Y8b. Y88b 888 888 Y88b. 888 888 Y88b. 888 Y88..88P 888 888 | |
24 | -888 888 "Y8888 "Y88888 888 "Y888 "Y888888 "Y888 888 "Y88P" 888 888 | |
25 | - | |
26 | - | |
27 | - | |
28 | - | |
29 | - | |
30 | - | |
31 | - | |
32 | - | |
33 | - | |
34 | - | |
35 | - | |
36 | - | |
37 | - | |
38 | - """ | |
39 | - print(medi) | |
40 | - mins = 0 | |
41 | - while mins != duration: | |
42 | - time.sleep(60) | |
43 | - mins += 1 | |
44 | - intertwingled.transition() | |
45 | - | |
46 | -if __name__ == "__main__": | |
47 | - main() |
asanas/intention.py | ||
---|---|---|
@@ -1,0 +1,72 @@ | ||
1 … | +import sys | |
2 … | +import configparser | |
3 … | +from asanas import intertwingled | |
4 … | +from components import * | |
5 … | + | |
6 … | +config = configparser.ConfigParser() | |
7 … | +kriya_title = None | |
8 … | + | |
9 … | +def summon_kriya(routine): | |
10 … | + config.read(routine) | |
11 … | + for section in config.sections(): | |
12 … | + global kriya_title | |
13 … | + kriya_title = str(section) | |
14 … | + | |
15 … | +def heading(): | |
16 … | + print("\n"+kriya_title) | |
17 … | + print("="*len(kriya_title)+"\n") | |
18 … | + | |
19 … | +def poses(routine): | |
20 … | + intertwingled.clear() | |
21 … | + heading() | |
22 … | + for component, energy in config.items(kriya_title): | |
23 … | + if component == 'summary': | |
24 … | + print(energy) | |
25 … | + print("\nIn this kriya you will do:\n") | |
26 … | + for component, energy in config.items(kriya_title): | |
27 … | + if component != 'summary': | |
28 … | + if component in ('sun salutation', 'second sun salutation'): | |
29 … | + name = component.title() | |
30 … | + if str(energy) != '1': | |
31 … | + print(" "*8 + "{} for {} reps.".format(name, energy)) | |
32 … | + else: | |
33 … | + print(" " * 8 + "{} for {} rep.".format(name, energy)) | |
34 … | + else: | |
35 … | + name = component.title() | |
36 … | + if str(energy) != '1': | |
37 … | + print(" "*8 + "{} for {} minutes.".format(name, energy)) | |
38 … | + else: | |
39 … | + print(" "*8 + "{} for {} minute.".format(name, energy)) | |
40 … | + print('\n'*10+'='*len(kriya_title)) | |
41 … | + cont = input("Start your Kriya? [y/N] Or type 'help' to learn more\n> ").lower() | |
42 … | + | |
43 … | + if cont == 'n': | |
44 … | + sys.exit() | |
45 … | + elif cont in ('help','h','halp'): | |
46 … | + help(routine) | |
47 … | + else: | |
48 … | + pass | |
49 … | + | |
50 … | +def help(routine): | |
51 … | + intertwingled.clear() | |
52 … | + heading() | |
53 … | + for option in config.options(kriya_title): | |
54 … | + if option != 'summary': | |
55 … | + func = option.replace(" ","") | |
56 … | + func_to_run = getattr(Components, func) | |
57 … | + description = func_to_run.__doc__ | |
58 … | + if description != None: | |
59 … | + print(description) | |
60 … | + else: | |
61 … | + print("{}:\n No description available now.\n".format(option.title())) | |
62 … | + print("\n" + "="*len(kriya_title) + "\n") | |
63 … | + back_to_menu = input("Hit Enter to Return.") | |
64 … | + if back_to_menu == "": | |
65 … | + poses(routine) | |
66 … | + | |
67 … | +def main(routine): | |
68 … | + summon_kriya(routine) | |
69 … | + poses(routine) | |
70 … | + | |
71 … | +if __name__ == "__main__": | |
72 … | + main(routine) |
asanas/reps.py | ||
---|---|---|
@@ -1,0 +1,124 @@ | ||
1 … | +dictionary = { | |
2 … | +"1" : """ | |
3 … | + | |
4 … | + | |
5 … | + # | |
6 … | + ## ##### ###### ##### | |
7 … | + # # # # # # # | |
8 … | + # # # ##### # # | |
9 … | + # ##### # ##### | |
10 … | + # # # # # | |
11 … | + ##### # # ###### # | |
12 … | + | |
13 … | +""", | |
14 … | +"2" : """ | |
15 … | + | |
16 … | + | |
17 … | + ##### | |
18 … | +# # ##### ###### ##### #### | |
19 … | + # # # # # # # | |
20 … | + ##### # # ##### # # #### | |
21 … | +# ##### # ##### # | |
22 … | +# # # # # # # | |
23 … | +####### # # ###### # #### | |
24 … | + | |
25 … | +""", | |
26 … | +"3" : """ | |
27 … | + | |
28 … | + | |
29 … | + ##### | |
30 … | +# # ##### ###### ##### #### | |
31 … | + # # # # # # # | |
32 … | + ##### # # ##### # # #### | |
33 … | + # ##### # ##### # | |
34 … | +# # # # # # # # | |
35 … | + ##### # # ###### # #### | |
36 … | + | |
37 … | +""", | |
38 … | +"4" : """ | |
39 … | + | |
40 … | + | |
41 … | +# | |
42 … | +# # ##### ###### ##### #### | |
43 … | +# # # # # # # # | |
44 … | +# # # # ##### # # #### | |
45 … | +####### ##### # ##### # | |
46 … | + # # # # # # # | |
47 … | + # # # ###### # #### | |
48 … | + | |
49 … | +""", | |
50 … | +"5" : """ | |
51 … | + | |
52 … | + | |
53 … | +####### | |
54 … | +# ##### ###### ##### #### | |
55 … | +# # # # # # # | |
56 … | +###### # # ##### # # #### | |
57 … | + # ##### # ##### # | |
58 … | +# # # # # # # # | |
59 … | + ##### # # ###### # #### | |
60 … | + | |
61 … | +""", | |
62 … | +"6" : """ | |
63 … | + | |
64 … | + | |
65 … | + | |
66 … | + ____ ______ | |
67 … | + / ___| | ___ \ | |
68 … | +/ /___ | |_/ /___ _ __ ___ | |
69 … | +| ___ \ | // _ \ '_ \/ __| | |
70 … | +| \_/ | | |\ \ __/ |_) \__ \\ | |
71 … | +\_____/ \_| \_\___| .__/|___/ | |
72 … | + | | | |
73 … | + |_| | |
74 … | +""", | |
75 … | +"7" : """ | |
76 … | + | |
77 … | + | |
78 … | + ______ ______ | |
79 … | +|___ / | ___ \ | |
80 … | + / / | |_/ /___ _ __ ___ | |
81 … | + / / | // _ \ '_ \/ __| | |
82 … | +./ / | |\ \ __/ |_) \__ \\ | |
83 … | +\_/ \_| \_\___| .__/|___/ | |
84 … | + | | | |
85 … | + |_| | |
86 … | +""", | |
87 … | + | |
88 … | +"8" : """ | |
89 … | + ___ | |
90 … | + ( _ ) _ __ ___ _ __ ___ | |
91 … | + / _ \ | '__/ _ \ '_ \/ __| | |
92 … | + | (_) | | | | __/ |_) \__ \\ | |
93 … | + \___/ |_| \___| .__/|___/ | |
94 … | + |_| | |
95 … | +""", | |
96 … | +"9" : """ | |
97 … | + | |
98 … | + | |
99 … | + _____ ______ | |
100 … | +| _ | | ___ \ | |
101 … | +| |_| | | |_/ /___ _ __ ___ | |
102 … | +\____ | | // _ \ '_ \/ __| | |
103 … | +.___/ / | |\ \ __/ |_) \__ \\ | |
104 … | +\____/ \_| \_\___| .__/|___/ | |
105 … | + | | | |
106 … | + |_| | |
107 … | + | |
108 … | + | |
109 … | +""", | |
110 … | +"10" : """ | |
111 … | + | |
112 … | + | |
113 … | + __ _____ ______ | |
114 … | +/ || _ | | ___ \ | |
115 … | +`| || |/' | | |_/ /___ _ __ ___ | |
116 … | + | || /| | | // _ \ '_ \/ __| | |
117 … | +_| |\ |_/ / | |\ \ __/ |_) \__ \\ | |
118 … | +\___/\___/ \_| \_\___| .__/|___/ | |
119 … | + | | | |
120 … | + |_| | |
121 … | + | |
122 … | + | |
123 … | +""" | |
124 … | +} |
components.py | ||
---|---|---|
@@ -1,32 +1,33 @@ | ||
1 | 1 … | import time |
2 | -from asanas import intertwingled | |
2 … | +from asanas import intertwingled, reps | |
3 | 3 … | |
4 | 4 … | #This defines what's being shown on the screen, based on the component chosen, and mostly here so i don't have to |
5 | 5 … | #write this all each time. |
6 | 6 … | |
7 | 7 … | def move_through1(duration, ascii_art): |
8 | - intertwingled.clear_screen() | |
8 … | + intertwingled.clear() | |
9 | 9 … | print('\n'*10) |
10 | 10 … | print(ascii_art) |
11 … | + intertwingled.sleep(duration) | |
11 | 12 … | intertwingled.firsttransition() |
12 | 13 … | |
13 | 14 … | def move_through2(duration, ascii_art): |
14 | - intertwingled.clear_screen() | |
15 … | + intertwingled.clear() | |
15 | 16 … | print('\n'*10) |
16 | 17 … | print(ascii_art) |
17 | 18 … | intertwingled.sleep(duration) |
18 | 19 … | intertwingled.secondtransition() |
19 | 20 … | |
20 | 21 … | def move_through3(duration, ascii_art): |
21 | - intertwingled.clear_screen() | |
22 … | + intertwingled.clear() | |
22 | 23 … | print('\n'*10) |
23 | 24 … | print(ascii_art) |
24 | 25 … | intertwingled.sleep(duration) |
25 | 26 … | intertwingled.thirdtransition() |
26 | 27 … | |
27 | 28 … | def move_through4(duration, ascii_art): |
28 | - intertwingled.clear_screen() | |
29 … | + intertwingled.clear() | |
29 | 30 … | print('\n'*10) |
30 | 31 … | print(ascii_art) |
31 | 32 … | intertwingled.sleep(duration) |
32 | 33 … | intertwingled.fourthtransition() |
@@ -34,8 +35,13 @@ | ||
34 | 35 … | class Components: |
35 | 36 … | |
36 | 37 … | |
37 | 38 … | def breathoffire(self, duration): |
39 … | + """ | |
40 … | + Breath of Fire: | |
41 … | + | |
42 … | + This is a sort of Pant, like a dog. but better! | |
43 … | + """ | |
38 | 44 … | ascii_art = """ |
39 | 45 … | 888888b. 888 888 |
40 | 46 … | 888 "88b 888 888 |
41 | 47 … | 888 .88P 888 888 |
@@ -59,8 +65,16 @@ | ||
59 | 65 … | move_through1(duration, ascii_art) |
60 | 66 … | |
61 | 67 … | |
62 | 68 … | def catcow(self, duration): |
69 … | + """ | |
70 … | + Cat Cow: | |
71 … | + Get onto your hands and knees, with your hands directly beneath your shoulders. | |
72 … | + Straighten your back, and keep your head down. | |
73 … | + Then, with the Inhale, Arch your back and look up. with the exhale, | |
74 … | + round your back and look down. | |
75 … | + Perform this VIGOROUSLY. | |
76 … | + """ | |
63 | 77 … | ascii_art = """ |
64 | 78 … | .d8888b. 888 |
65 | 79 … | d88P Y88b 888 |
66 | 80 … | 888 888 888 |
@@ -84,8 +98,17 @@ | ||
84 | 98 … | move_through2(duration, ascii_art) |
85 | 99 … | |
86 | 100 … | |
87 | 101 … | def hollowbody(self, duration): |
102 … | + """ | |
103 … | + Hollow Body: | |
104 … | + | |
105 … | + Lay flat on your back with your hands at your sides, then.. | |
106 … | + Lift your legs, your chest, and your head, keeping your hips on the ground. | |
107 … | + Stretch your arms towards your feet. | |
108 … | + Hold this pose until the synth swells. | |
109 … | + You can do this. | |
110 … | + """ | |
88 | 111 … | ascii_art = """ |
89 | 112 … | 888 888 888 888 |
90 | 113 … | 888 888 888 888 |
91 | 114 … | 888 888 888 888 |
@@ -112,8 +135,14 @@ | ||
112 | 135 … | move_through3(duration, ascii_art) |
113 | 136 … | |
114 | 137 … | |
115 | 138 … | def mantra(self, duration): |
139 … | + """ | |
140 … | + Mantra: | |
141 … | + | |
142 … | + This is a Freestyle! Choose whichever mantra is important. | |
143 … | + Repeat the mantra until the synth swells. | |
144 … | + """ | |
116 | 145 … | ascii_art = """ |
117 | 146 … | 888b d888 888 |
118 | 147 … | 8888b d8888 888 |
119 | 148 … | 88888b.d88888 888 |
@@ -126,8 +155,17 @@ | ||
126 | 155 … | move_through4(duration, ascii_art) |
127 | 156 … | |
128 | 157 … | |
129 | 158 … | def meditation(self, duration): |
159 … | + """ | |
160 … | + Meditation: | |
161 … | + | |
162 … | + Sit cross-legged, with straight tall back. Close your eyes. | |
163 … | + Now, focus on your breath as you inhale deeply and exhale fully. | |
164 … | + Let your mind clear of thoughts. Watch the thoughts as they appear, | |
165 … | + say hey, then disappear as quickly. Focus on your breath and focus | |
166 … | + on the light within you. | |
167 … | + """ | |
130 | 168 … | ascii_art = """ |
131 | 169 … | 888b d888 888 d8b 888 888 d8b |
132 | 170 … | 8888b d8888 888 Y8P 888 888 Y8P |
133 | 171 … | 88888b.d88888 888 888 888 |
@@ -174,8 +212,12 @@ | ||
174 | 212 … | move_through2(duration, ascii_art) |
175 | 213 … | |
176 | 214 … | |
177 | 215 … | def recliningheartopener(self, duration): |
216 … | + """ | |
217 … | + Reclining Heart Opener: | |
218 … | + Angelica is a SEXY woman. | |
219 … | + """ | |
178 | 220 … | ascii_art = """ |
179 | 221 … | 8888888b. 888 d8b d8b |
180 | 222 … | 888 Y88b 888 Y8P Y8P |
181 | 223 … | 888 888 888 |
@@ -321,4 +363,110 @@ | ||
321 | 363 … | Y8b d88P |
322 | 364 … | "Y88P" |
323 | 365 … | """ |
324 | 366 … | move_through4(duration, ascii_art) |
367 … | + @classmethod | |
368 … | + def twistyourbody(self, duration): | |
369 … | + ascii_art = """ | |
370 … | + | |
371 … | + | |
372 … | +88888888888 d8b 888 | |
373 … | + 888 Y8P 888 | |
374 … | + 888 888 | |
375 … | + 888 888 888 888 888 .d8888b 888888 | |
376 … | + 888 888 888 888 888 88K 888 | |
377 … | + 888 888 888 888 888 "Y8888b. 888 | |
378 … | + 888 Y88b 888 d88P 888 X88 Y88b. | |
379 … | + 888 "Y8888888P" 888 88888P' "Y888 | |
380 … | + | |
381 … | + | |
382 … | + | |
383 … | + Y88b d88P | |
384 … | + Y88b d88P | |
385 … | + Y88o88P | |
386 … | + Y888P .d88b. 888 888 888d888 | |
387 … | + 888 d88""88b 888 888 888P" | |
388 … | + 888 888 888 888 888 888 | |
389 … | + 888 Y88..88P Y88b 888 888 | |
390 … | + 888 "Y88P" "Y88888 888 | |
391 … | + | |
392 … | + | |
393 … | + | |
394 … | + 888888b. 888 | |
395 … | + 888 "88b 888 | |
396 … | + 888 .88P 888 | |
397 … | + 8888888K. .d88b. .d88888 888 888 | |
398 … | + 888 "Y88b d88""88b d88" 888 888 888 | |
399 … | + 888 888 888 888 888 888 888 888 | |
400 … | + 888 d88P Y88..88P Y88b 888 Y88b 888 | |
401 … | + 8888888P" "Y88P" "Y88888 "Y88888 | |
402 … | + 888 | |
403 … | + Y8b d88P | |
404 … | + "Y88P" | |
405 … | + | |
406 … | + | |
407 … | + """ | |
408 … | + move_through3(duration, ascii_art) | |
409 … | + | |
410 … | + @classmethod | |
411 … | + def sunsalutation(self, duration): | |
412 … | + ascii_art = """ | |
413 … | + .d8888b. | |
414 … | +d88P Y88b | |
415 … | +Y88b. | |
416 … | + "Y888b. 888 888 88888b. | |
417 … | + "Y88b. 888 888 888 "88b | |
418 … | + "888 888 888 888 888 | |
419 … | +Y88b d88P Y88b 888 888 888 | |
420 … | + "Y8888P" "Y88888 888 888 | |
421 … | + | |
422 … | + | |
423 … | + | |
424 … | + .d8888b. 888 888 888 d8b | |
425 … | +d88P Y88b 888 888 888 Y8P | |
426 … | +Y88b. 888 888 888 | |
427 … | + "Y888b. 8888b. 888 888 888 888888 8888b. 888888 888 .d88b. 88888b. | |
428 … | + "Y88b. "88b 888 888 888 888 "88b 888 888 d88""88b 888 "88b | |
429 … | + "888 .d888888 888 888 888 888 .d888888 888 888 888 888 888 888 | |
430 … | +Y88b d88P 888 888 888 Y88b 888 Y88b. 888 888 Y88b. 888 Y88..88P 888 888 | |
431 … | + "Y8888P" "Y888888 888 "Y88888 "Y888 "Y888888 "Y888 888 "Y88P" 888 888 | |
432 … | + """ | |
433 … | + intertwingled.clear() | |
434 … | + print(ascii_art) | |
435 … | + print(reps.dictionary[str(duration)]) | |
436 … | + print("\n"*10) | |
437 … | + keep_going = input("Press Enter to Contine.\n> ") | |
438 … | + if keep_going == '': | |
439 … | + print('excellent. cue synth swell!') | |
440 … | + intertwingled.fourthtransition() | |
441 … | + | |
442 … | + @classmethod | |
443 … | + def secondsunsalutation(self, duration): | |
444 … | + ascii_art = """ | |
445 … | + .d8888b. | |
446 … | +d88P Y88b | |
447 … | +Y88b. | |
448 … | + "Y888b. 888 888 88888b. | |
449 … | + "Y88b. 888 888 888 "88b | |
450 … | + "888 888 888 888 888 | |
451 … | +Y88b d88P Y88b 888 888 888 | |
452 … | + "Y8888P" "Y88888 888 888 | |
453 … | + | |
454 … | + | |
455 … | + | |
456 … | + .d8888b. 888 888 888 d8b | |
457 … | +d88P Y88b 888 888 888 Y8P | |
458 … | +Y88b. 888 888 888 | |
459 … | + "Y888b. 8888b. 888 888 888 888888 8888b. 888888 888 .d88b. 88888b. | |
460 … | + "Y88b. "88b 888 888 888 888 "88b 888 888 d88""88b 888 "88b | |
461 … | + "888 .d888888 888 888 888 888 .d888888 888 888 888 888 888 888 | |
462 … | +Y88b d88P 888 888 888 Y88b 888 Y88b. 888 888 Y88b. 888 Y88..88P 888 888 | |
463 … | + "Y8888P" "Y888888 888 "Y88888 "Y888 "Y888888 "Y888 888 "Y88P" 888 888 | |
464 … | + """ | |
465 … | + intertwingled.clear() | |
466 … | + print(ascii_art) | |
467 … | + print(reps.dictionary[str(duration)]) | |
468 … | + print("\n"*10) | |
469 … | + keep_going = input("Press Enter to Contine.\n> ") | |
470 … | + if keep_going == '': | |
471 … | + print('I knew you could do it. Another synth swell?') | |
472 … | + intertwingled.firsttransition() |
helper.py | ||
---|---|---|
@@ -1,55 +1,82 @@ | ||
1 … | +#! /usr/bin/env python3 | |
2 … | + | |
1 | 3 … | import time |
4 … | +import os | |
2 | 5 … | from sys import argv |
3 | 6 … | import configparser |
7 … | +import collections | |
4 | 8 … | |
5 | 9 … | from components import * |
6 | 10 … | from asanas import * |
7 | 11 … | import pyglet |
12 … | +import menu_screen | |
8 | 13 … | from transitions import * |
9 | 14 … | |
10 | -#bring in ini file to act as dictionary | |
11 | -script, ini_file = argv | |
12 | -config = configparser.ConfigParser() | |
13 | -config.read(ini_file) | |
15 … | +#Lists for Kriyas and where to find them | |
16 … | +kriya_dict = collections.OrderedDict() | |
17 … | +kriya_list = [] | |
18 … | +routine = None | |
14 | 19 … | |
15 | -# Make the single section in the ini file callable as a variable | |
16 | -def sectionintostring(): | |
17 | - for section in config.sections(): | |
18 | - str(section) | |
19 | - return section | |
20 | -routine = sectionintostring() | |
20 … | +def gather_kriyas(): | |
21 … | + global kriya_dict | |
22 … | + global kriya_list | |
23 … | + for file in os.listdir('kriyas'): | |
24 … | + kriya = 'kriyas/{}'.format(file) | |
25 … | + config = configparser.ConfigParser() | |
26 … | + config.read(kriya) | |
27 … | + for section in config.sections(): | |
28 … | + kriya_dict[section] = kriya | |
29 … | + kriya_list.append(section) | |
21 | 30 … | |
31 … | +def kriya_choice(choice): | |
32 … | + global routine | |
33 … | + try: | |
34 … | + option = int(choice) | |
35 … | + key = kriya_list[option - 1] | |
36 … | + routine = kriya_dict[key] | |
37 … | + except: | |
38 … | + routine = kriya_dict[choice] | |
39 … | + | |
40 … | +def menu(): | |
41 … | + ascii_art = """ | |
42 … | + _ _ _ | |
43 … | + | | | | (_) | |
44 … | + ___| |__ ___ ___ ___ ___ _ _ ___ _ _ _ __ | | ___ __ _ _ _ __ _ | |
45 … | + / __| '_ \ / _ \ / _ \/ __|/ _ \ | | | |/ _ \| | | | '__| | |/ / '__| | | | |/ _` | | |
46 … | + | (__| | | | (_) | (_) \__ \ __/ | |_| | (_) | |_| | | | <| | | | |_| | (_| | | |
47 … | + \___|_| |_|\___/ \___/|___/\___| \__, |\___/ \__,_|_| |_|\_\_| |_|\__, |\__,_| | |
48 … | + __/ | __/ | | |
49 … | + |___/ |___/ | |
50 … | + """ | |
51 … | + intertwingled.clear() | |
52 … | + print(ascii_art) | |
53 … | + for number, kriya in enumerate(kriya_list, start=1): | |
54 … | + print("{}) {}".format(number, kriya)) | |
55 … | + print("\n"+"="*30) | |
56 … | + choice = input("Choose your Kriya! Either type in the number or write out the kriya!\n> ").title() | |
57 … | + kriya_choice(choice) | |
58 … | + | |
59 … | + | |
22 | 60 … | # Opening Screen, then move through the kriya |
23 | 61 … | def main(): |
62 … | + gather_kriyas() | |
24 | 63 … | splashpage.main() |
25 | - intention(routine) | |
64 … | + menu() | |
65 … | + intention.main(routine) | |
66 … | + settle.main() | |
26 | 67 … | kriya(routine) |
27 | 68 … | closing_remark.main() |
28 | 69 … | |
29 | -def intention(ini): | |
30 | - """Summary of the components in your kriya, and how long you'll spend in each one""" | |
31 | - intertwingled.clear_screen() | |
32 | - print("\n"*15) | |
33 | - print("Hello. Today you will be doing:") | |
34 | - print("\n"*2) | |
35 | - for component, minutes in config.items(ini): | |
36 | - if str(minutes) != '1': | |
37 | - print(" "*8 + str(component) + " for " + str(minutes) + " minutes.") | |
38 | - else: | |
39 | - print(" "*8 + str(component) + " for " + str(minutes) + " minute.") | |
40 | - print('\n'*10) | |
41 | - print("Start your Kriya? [y/N]") | |
42 | - run = input("> ") | |
43 | - # only run if the user types y | |
44 | - if run == "y": | |
45 | - settle.main() | |
46 | - | |
47 | 70 … | def kriya(ini): |
48 | 71 … | """Run through poses and duration from ini file""" |
49 | - for pose, time in config.items(ini): | |
50 | - func = pose.replace(" ","") | |
51 | - func_to_run = getattr(Components, func) | |
52 | - func_to_run(int(time)) | |
53 | - | |
72 … | + config = configparser.ConfigParser() | |
73 … | + config.read(ini) | |
74 … | + for section in config.sections(): | |
75 … | + kriya = str(section) | |
76 … | + for pose, time in config.items(kriya): | |
77 … | + if pose != 'summary': | |
78 … | + func = pose.replace(" ","") | |
79 … | + func_to_run = getattr(Components, func) | |
80 … | + func_to_run(int(time)) | |
54 | 81 … | if __name__ == "__main__": |
55 | 82 … | main() |
kriyas/morning-kriya.ini | ||
---|---|---|
@@ -1,5 +1,6 @@ | ||
1 | 1 … | [Morning Kriya] |
2 … | +Summary = A quick way to charge up your morning and feel good! | |
2 | 3 … | Breath Of Fire = 1 |
3 | 4 … | hollow body = 1 |
4 | 5 … | cat cow = 3 |
5 | 6 … | mantra = 3 |
kriyas/angelicas-morning.ini | ||
---|---|---|
@@ -1,0 +1,6 @@ | ||
1 … | +[Angelica Morning] | |
2 … | + | |
3 … | +Twist Your Body = 1 | |
4 … | +Sun Salutation = 2 | |
5 … | +Meditation = 15 | |
6 … | +Second Sun Salutation = 6 |
kriyas/example-kriya.ini | ||
---|---|---|
@@ -1,4 +1,0 @@ | ||
1 | -[Example Kriya] | |
2 | -Hollow Body = 1 | |
3 | -Breath of Fire = 2 | |
4 | -Cat Cow = 1 |
kriyas/may-kriya.ini | ||
---|---|---|
@@ -1,6 +1,0 @@ | ||
1 | -[May Kriya] | |
2 | - | |
3 | -Bla Bla Bla = 5 | |
4 | -Breath of Fire = 1 | |
5 | -Hollow Body = 1 | |
6 | -Cat Cow = 1 |
kriyas/salutations.ini | ||
---|---|---|
@@ -1,0 +1,5 @@ | ||
1 … | +[Salutations] | |
2 … | + | |
3 … | +Sun Salutation = 5 | |
4 … | +Second Sun Salutation = 8 | |
5 … | + |
kriyas/powerful-morning.ini | ||
---|---|---|
@@ -1,9 +1,0 @@ | ||
1 | -[Powerful Morning] | |
2 | -; This kriya brings incredible energy and focus to your morning. | |
3 | -Meditation = 2 | |
4 | -;Meditate on anything you like. | |
5 | -Chest Thump = 1 | |
6 | -;pound your chest! | |
7 | -Hollow Body = 2 | |
8 | -;you can do it! | |
9 | -Mantra = 1 |
transitions/closing_remark.py | ||
---|---|---|
@@ -1,8 +1,8 @@ | ||
1 | 1 … | from asanas import intertwingled |
2 | 2 … | |
3 | 3 … | def main(): |
4 | - yag = """ | |
4 … | + ascii_art = """ | |
5 | 5 … | |
6 | 6 … | |
7 | 7 … | |
8 | 8 … | |
@@ -36,9 +36,9 @@ | ||
36 | 36 … | |
37 | 37 … | |
38 | 38 … | |
39 | 39 … | """ |
40 | - intertwingled.clear_screen() | |
41 | - print(yag) | |
40 … | + intertwingled.clear() | |
41 … | + print(ascii_art) | |
42 | 42 … | |
43 | 43 … | if __name__ == "__main__": |
44 | 44 … | main() |
transitions/settle.py | ||
---|---|---|
@@ -41,8 +41,9 @@ | ||
41 | 41 … | |
42 | 42 … | """ |
43 | 43 … | |
44 | 44 … | def main(): |
45 … | + intertwingled.clear() | |
45 | 46 … | print(sink_into_your_body) |
46 | 47 … | intertwingled.settle() |
47 | 48 … | |
48 | 49 … | if __name__ == "__main__": |
transitions/splashpage.py | ||
---|---|---|
@@ -41,8 +41,9 @@ | ||
41 | 41 … | |
42 | 42 … | |
43 | 43 … | |
44 | 44 … | """ |
45 … | + intertwingled.clear() | |
45 | 46 … | print(splashpage) |
46 | 47 … | begin = input("Press Enter > ") |
47 | 48 … | if begin == "": |
48 | 49 … | intertwingled.beginning() |
menu_screen.py | ||
---|---|---|
@@ -1,0 +1,28 @@ | ||
1 … | +from asanas import intertwingled | |
2 … | +from helper import kriya_dict | |
3 … | +from helper import kriya_list | |
4 … | + | |
5 … | +def kriya_choice(choice): | |
6 … | + global routine | |
7 … | + try: | |
8 … | + input = int(choice) | |
9 … | + key = kriya_list[input - 1] | |
10 … | + routine = kriya_dict[key] | |
11 … | + except: | |
12 … | + routine = kriya_dict[fun] | |
13 … | + | |
14 … | +def menu_screen(): | |
15 … | + intertwingled.clear() | |
16 … | + for number, kriya in enumerate(kriya_list, start=1): | |
17 … | + print("{}) {}".format(number, kriya)) | |
18 … | + print("\n"+"="*30) | |
19 … | + choice = input("Choose your Kriya! Either type in the number or write out the kriya!\n> ").title() | |
20 … | + kriya_choice(choice) | |
21 … | + | |
22 … | +def main(): | |
23 … | + menu_screen() | |
24 … | + kriya_choice(choice) | |
25 … | + | |
26 … | +if __name__ == "__main__": | |
27 … | + main() | |
28 … | + |
Built with git-ssb-web