mytimer 2.3__tar.gz → 2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mytimer-2.3 → mytimer-2.4}/CHANGELOG.md +16 -1
- {mytimer-2.3 → mytimer-2.4}/PKG-INFO +42 -5
- {mytimer-2.3 → mytimer-2.4}/README.md +22 -2
- {mytimer-2.3 → mytimer-2.4}/SECURITY.md +2 -2
- {mytimer-2.3 → mytimer-2.4}/dev-requirements.txt +1 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/__main__.py +11 -1
- {mytimer-2.3 → mytimer-2.4}/mytimer/functions.py +61 -36
- {mytimer-2.3 → mytimer-2.4}/mytimer/params.py +12 -1
- {mytimer-2.3 → mytimer-2.4}/mytimer.egg-info/PKG-INFO +42 -5
- {mytimer-2.3 → mytimer-2.4}/mytimer.egg-info/requires.txt +1 -0
- {mytimer-2.3 → mytimer-2.4}/requirements.txt +1 -0
- {mytimer-2.3 → mytimer-2.4}/setup.py +3 -2
- {mytimer-2.3 → mytimer-2.4}/AUTHORS.md +0 -0
- {mytimer-2.3 → mytimer-2.4}/FACES.md +0 -0
- {mytimer-2.3 → mytimer-2.4}/LICENSE +0 -0
- {mytimer-2.3 → mytimer-2.4}/MANIFEST.in +0 -0
- {mytimer-2.3 → mytimer-2.4}/PROGRAMS.md +0 -0
- {mytimer-2.3 → mytimer-2.4}/TONES.md +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/__init__.py +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/1.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/10.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/11.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/12.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/13.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/14.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/15.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/16.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/17.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/18.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/19.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/2.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/20.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/21.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/22.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/23.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/24.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/25.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/26.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/27.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/28.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/29.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/3.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/30.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/31.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/32.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/33.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/34.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/4.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/5.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/6.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/7.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/8.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer/sounds/9.wav +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer.egg-info/SOURCES.txt +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer.egg-info/dependency_links.txt +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer.egg-info/entry_points.txt +0 -0
- {mytimer-2.3 → mytimer-2.4}/mytimer.egg-info/top_level.txt +0 -0
- {mytimer-2.3 → mytimer-2.4}/setup.cfg +0 -0
|
@@ -5,6 +5,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
|
+
## [2.4] - 2025-12-04
|
|
9
|
+
### Added
|
|
10
|
+
- `--color` argument
|
|
11
|
+
- `--bg-color` argument
|
|
12
|
+
### Changed
|
|
13
|
+
- `load_program_params` function modified
|
|
14
|
+
- `pomodoro_timer` function modified
|
|
15
|
+
- `two_step_timer` function modified
|
|
16
|
+
- `select_timer_func` function renamed to `select_timer_function`
|
|
17
|
+
- `mytimer_info` function renamed to `print_mytimer_info`
|
|
18
|
+
- `run_timer` function modified
|
|
19
|
+
- `Python 3.14` added to `test.yml`
|
|
20
|
+
- `README.md` updated
|
|
21
|
+
- Test system modified
|
|
8
22
|
## [2.3] - 2025-07-17
|
|
9
23
|
### Added
|
|
10
24
|
- 2 new programs
|
|
@@ -230,7 +244,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
230
244
|
- Count-up mode
|
|
231
245
|
- Alarm
|
|
232
246
|
|
|
233
|
-
[Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.
|
|
247
|
+
[Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.4...dev
|
|
248
|
+
[2.4]: https://github.com/sepandhaghighi/mytimer/compare/v2.3...v2.4
|
|
234
249
|
[2.3]: https://github.com/sepandhaghighi/mytimer/compare/v2.2...v2.3
|
|
235
250
|
[2.2]: https://github.com/sepandhaghighi/mytimer/compare/v2.1...v2.2
|
|
236
251
|
[2.1]: https://github.com/sepandhaghighi/mytimer/compare/v2.0...v2.1
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mytimer
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4
|
|
4
4
|
Summary: A Geeky Timer for Terminal Enthusiasts
|
|
5
5
|
Home-page: https://github.com/sepandhaghighi/mytimer
|
|
6
|
-
Download-URL: https://github.com/sepandhaghighi/mytimer/tarball/v2.
|
|
6
|
+
Download-URL: https://github.com/sepandhaghighi/mytimer/tarball/v2.4
|
|
7
7
|
Author: Sepand Haghighi
|
|
8
8
|
Author-email: me@sepand.tech
|
|
9
9
|
License: MIT
|
|
@@ -20,6 +20,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
24
|
Classifier: Intended Audience :: Developers
|
|
24
25
|
Classifier: Intended Audience :: Education
|
|
25
26
|
Classifier: Intended Audience :: End Users/Desktop
|
|
@@ -33,6 +34,7 @@ License-File: AUTHORS.md
|
|
|
33
34
|
Requires-Dist: art>=5.3
|
|
34
35
|
Requires-Dist: jdatetime>=3.8.2
|
|
35
36
|
Requires-Dist: nava>=0.4
|
|
37
|
+
Requires-Dist: colorama>=0.4.5
|
|
36
38
|
Dynamic: author
|
|
37
39
|
Dynamic: author-email
|
|
38
40
|
Dynamic: classifier
|
|
@@ -105,13 +107,13 @@ The main objective of <strong>MyTimer</strong> is to offer a minimalistic and di
|
|
|
105
107
|
## Installation
|
|
106
108
|
|
|
107
109
|
### Source Code
|
|
108
|
-
- Download [Version 2.
|
|
110
|
+
- Download [Version 2.4](https://github.com/sepandhaghighi/mytimer/archive/v2.4.zip) or [Latest Source](https://github.com/sepandhaghighi/mytimer/archive/dev.zip)
|
|
109
111
|
- `pip install .`
|
|
110
112
|
|
|
111
113
|
### PyPI
|
|
112
114
|
|
|
113
115
|
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
114
|
-
- `pip install mytimer==2.
|
|
116
|
+
- `pip install mytimer==2.4`
|
|
115
117
|
|
|
116
118
|
|
|
117
119
|
## Usage
|
|
@@ -288,6 +290,26 @@ mytimer --program=black-tea
|
|
|
288
290
|
mytimer --minute=7 --second=30 --message="Test message"
|
|
289
291
|
```
|
|
290
292
|
|
|
293
|
+
### Color
|
|
294
|
+
|
|
295
|
+
ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`]
|
|
296
|
+
|
|
297
|
+
ℹ️ The default color is `white`
|
|
298
|
+
|
|
299
|
+
```console
|
|
300
|
+
mytimer --minute=7 --second=30 --color="red"
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Background Color
|
|
304
|
+
|
|
305
|
+
ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`]
|
|
306
|
+
|
|
307
|
+
ℹ️ The default background color is `black`
|
|
308
|
+
|
|
309
|
+
```console
|
|
310
|
+
mytimer --minute=7 --second=30 --bg-color="blue"
|
|
311
|
+
```
|
|
312
|
+
|
|
291
313
|
## Screen Record
|
|
292
314
|
|
|
293
315
|
<div align="center">
|
|
@@ -374,6 +396,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
374
396
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
375
397
|
|
|
376
398
|
## [Unreleased]
|
|
399
|
+
## [2.4] - 2025-12-04
|
|
400
|
+
### Added
|
|
401
|
+
- `--color` argument
|
|
402
|
+
- `--bg-color` argument
|
|
403
|
+
### Changed
|
|
404
|
+
- `load_program_params` function modified
|
|
405
|
+
- `pomodoro_timer` function modified
|
|
406
|
+
- `two_step_timer` function modified
|
|
407
|
+
- `select_timer_func` function renamed to `select_timer_function`
|
|
408
|
+
- `mytimer_info` function renamed to `print_mytimer_info`
|
|
409
|
+
- `run_timer` function modified
|
|
410
|
+
- `Python 3.14` added to `test.yml`
|
|
411
|
+
- `README.md` updated
|
|
412
|
+
- Test system modified
|
|
377
413
|
## [2.3] - 2025-07-17
|
|
378
414
|
### Added
|
|
379
415
|
- 2 new programs
|
|
@@ -599,7 +635,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
599
635
|
- Count-up mode
|
|
600
636
|
- Alarm
|
|
601
637
|
|
|
602
|
-
[Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.
|
|
638
|
+
[Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.4...dev
|
|
639
|
+
[2.4]: https://github.com/sepandhaghighi/mytimer/compare/v2.3...v2.4
|
|
603
640
|
[2.3]: https://github.com/sepandhaghighi/mytimer/compare/v2.2...v2.3
|
|
604
641
|
[2.2]: https://github.com/sepandhaghighi/mytimer/compare/v2.1...v2.2
|
|
605
642
|
[2.1]: https://github.com/sepandhaghighi/mytimer/compare/v2.0...v2.1
|
|
@@ -54,13 +54,13 @@ The main objective of <strong>MyTimer</strong> is to offer a minimalistic and di
|
|
|
54
54
|
## Installation
|
|
55
55
|
|
|
56
56
|
### Source Code
|
|
57
|
-
- Download [Version 2.
|
|
57
|
+
- Download [Version 2.4](https://github.com/sepandhaghighi/mytimer/archive/v2.4.zip) or [Latest Source](https://github.com/sepandhaghighi/mytimer/archive/dev.zip)
|
|
58
58
|
- `pip install .`
|
|
59
59
|
|
|
60
60
|
### PyPI
|
|
61
61
|
|
|
62
62
|
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
63
|
-
- `pip install mytimer==2.
|
|
63
|
+
- `pip install mytimer==2.4`
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
## Usage
|
|
@@ -237,6 +237,26 @@ mytimer --program=black-tea
|
|
|
237
237
|
mytimer --minute=7 --second=30 --message="Test message"
|
|
238
238
|
```
|
|
239
239
|
|
|
240
|
+
### Color
|
|
241
|
+
|
|
242
|
+
ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`]
|
|
243
|
+
|
|
244
|
+
ℹ️ The default color is `white`
|
|
245
|
+
|
|
246
|
+
```console
|
|
247
|
+
mytimer --minute=7 --second=30 --color="red"
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Background Color
|
|
251
|
+
|
|
252
|
+
ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`]
|
|
253
|
+
|
|
254
|
+
ℹ️ The default background color is `black`
|
|
255
|
+
|
|
256
|
+
```console
|
|
257
|
+
mytimer --minute=7 --second=30 --bg-color="blue"
|
|
258
|
+
```
|
|
259
|
+
|
|
240
260
|
## Screen Record
|
|
241
261
|
|
|
242
262
|
<div align="center">
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"""mytimer main."""
|
|
3
3
|
from mytimer.params import FACES_LIST, PROGRAMS_MAP, TONES_LIST
|
|
4
4
|
from mytimer.params import EXIT_MESSAGE, ADDITIONAL_INFO, SIGNS_LIST
|
|
5
|
-
from mytimer.params import DATE_SYSTEMS_LIST
|
|
5
|
+
from mytimer.params import DATE_SYSTEMS_LIST, COLORS_LIST
|
|
6
6
|
from mytimer.functions import run_timer
|
|
7
7
|
import argparse
|
|
8
8
|
|
|
@@ -20,6 +20,16 @@ def main() -> None:
|
|
|
20
20
|
help='face',
|
|
21
21
|
type=int,
|
|
22
22
|
choices=FACES_LIST)
|
|
23
|
+
parser.add_argument(
|
|
24
|
+
'--color',
|
|
25
|
+
help='text color',
|
|
26
|
+
type=str.lower,
|
|
27
|
+
choices=COLORS_LIST)
|
|
28
|
+
parser.add_argument(
|
|
29
|
+
'--bg-color',
|
|
30
|
+
help='background color',
|
|
31
|
+
type=str.lower,
|
|
32
|
+
choices=COLORS_LIST)
|
|
23
33
|
parser.add_argument(
|
|
24
34
|
'--tone',
|
|
25
35
|
help='alarm tone',
|
|
@@ -9,6 +9,7 @@ import jdatetime
|
|
|
9
9
|
import random
|
|
10
10
|
import argparse
|
|
11
11
|
from nava import play
|
|
12
|
+
from colorama import Fore, Back
|
|
12
13
|
from mytimer.params import INPUT_ERROR_MESSAGE, SOUND_ERROR_MESSAGE
|
|
13
14
|
from mytimer.params import INPUT_EXAMPLE, TIME_ELEMENTS, MESSAGE_TEMPLATE
|
|
14
15
|
from mytimer.params import FACES_MAP, PROGRAMS_MAP, BREAKS_MAP, TONES_MAP
|
|
@@ -38,15 +39,15 @@ def print_message(
|
|
|
38
39
|
:param h_shift: horizontal shift
|
|
39
40
|
:param confirm: confirm flag
|
|
40
41
|
"""
|
|
41
|
-
|
|
42
|
+
function = print
|
|
42
43
|
if confirm:
|
|
43
|
-
|
|
44
|
+
function = input
|
|
44
45
|
print('\n' * v_shift, end='')
|
|
45
|
-
|
|
46
|
+
function(h_shift * " " + message)
|
|
46
47
|
|
|
47
48
|
|
|
48
|
-
def
|
|
49
|
-
"""Print mytimer
|
|
49
|
+
def print_mytimer_info() -> None:
|
|
50
|
+
"""Print mytimer info."""
|
|
50
51
|
tprint("MyTimer")
|
|
51
52
|
tprint("V:" + MY_TIMER_VERSION)
|
|
52
53
|
print(MY_TIMER_OVERVIEW)
|
|
@@ -61,16 +62,16 @@ def load_program_params(program_name: str, is_break: bool = False) -> Dict[str,
|
|
|
61
62
|
:param is_break: break flag
|
|
62
63
|
"""
|
|
63
64
|
program_params = dict()
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
reference_map = PROGRAMS_MAP
|
|
66
|
+
reference_defaults = PROGRAMS_DEFAULTS
|
|
66
67
|
if is_break:
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
reference_map = BREAKS_MAP
|
|
69
|
+
reference_defaults = BREAKS_DEFAULTS
|
|
69
70
|
for item in DEFAULT_PARAMS:
|
|
70
|
-
if item in
|
|
71
|
-
program_params[item] =
|
|
72
|
-
elif item in
|
|
73
|
-
program_params[item] =
|
|
71
|
+
if item in reference_map[program_name]:
|
|
72
|
+
program_params[item] = reference_map[program_name][item]
|
|
73
|
+
elif item in reference_defaults:
|
|
74
|
+
program_params[item] = reference_defaults[item]
|
|
74
75
|
else:
|
|
75
76
|
program_params[item] = DEFAULT_PARAMS[item]
|
|
76
77
|
return program_params
|
|
@@ -131,11 +132,11 @@ def load_params(args: argparse.Namespace, program: str = None, is_break: bool =
|
|
|
131
132
|
return params
|
|
132
133
|
|
|
133
134
|
|
|
134
|
-
def input_handler(
|
|
135
|
+
def input_handler(function: Callable) -> Callable:
|
|
135
136
|
"""
|
|
136
137
|
Input handler decorator for timer functions.
|
|
137
138
|
|
|
138
|
-
:param
|
|
139
|
+
:param function: input function
|
|
139
140
|
"""
|
|
140
141
|
def inner_function(
|
|
141
142
|
hour: int,
|
|
@@ -189,7 +190,7 @@ def input_handler(func: Callable) -> Callable:
|
|
|
189
190
|
if minute >= 60:
|
|
190
191
|
hour += minute // 60
|
|
191
192
|
minute %= 60
|
|
192
|
-
|
|
193
|
+
function(
|
|
193
194
|
hour,
|
|
194
195
|
minute,
|
|
195
196
|
second,
|
|
@@ -230,6 +231,28 @@ def get_face(index: int) -> str:
|
|
|
230
231
|
return FACES_MAP[index]
|
|
231
232
|
|
|
232
233
|
|
|
234
|
+
def set_color(color: str) -> None:
|
|
235
|
+
"""
|
|
236
|
+
Set text color.
|
|
237
|
+
|
|
238
|
+
:param color: color name
|
|
239
|
+
"""
|
|
240
|
+
if color:
|
|
241
|
+
color = color.strip().upper()
|
|
242
|
+
print(getattr(Fore, color, ""), end="")
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
def set_bg_color(bg_color: str) -> None:
|
|
246
|
+
"""
|
|
247
|
+
Set background color.
|
|
248
|
+
|
|
249
|
+
:param bg_color: background color name
|
|
250
|
+
"""
|
|
251
|
+
if bg_color:
|
|
252
|
+
bg_color = bg_color.strip().upper()
|
|
253
|
+
print(getattr(Back, bg_color, ""), end="")
|
|
254
|
+
|
|
255
|
+
|
|
233
256
|
def get_tone(index: int) -> str:
|
|
234
257
|
"""
|
|
235
258
|
Return tone file name.
|
|
@@ -466,14 +489,14 @@ def countdown_timer(
|
|
|
466
489
|
|
|
467
490
|
|
|
468
491
|
def pomodoro_timer(
|
|
469
|
-
|
|
492
|
+
timer_function: Callable,
|
|
470
493
|
params: Dict[str, Any],
|
|
471
494
|
long_break_params: Dict[str, Any],
|
|
472
495
|
short_break_params: Dict[str, Any]) -> None:
|
|
473
496
|
"""
|
|
474
497
|
Pomodoro timer function.
|
|
475
498
|
|
|
476
|
-
:param
|
|
499
|
+
:param timer_function: timer function
|
|
477
500
|
:param params: program params
|
|
478
501
|
:param long_break_params: long break params
|
|
479
502
|
:param short_break_params: short break params
|
|
@@ -482,29 +505,29 @@ def pomodoro_timer(
|
|
|
482
505
|
for index in range(4):
|
|
483
506
|
work_params = params.copy()
|
|
484
507
|
work_params["message"] += " {round}/{repeat}".format(round=index + 1, repeat=4)
|
|
485
|
-
|
|
508
|
+
timer_function(**work_params)
|
|
486
509
|
if index == 3:
|
|
487
510
|
break
|
|
488
511
|
print_message(message=NEXT_PROGRAM_MESSAGE.format(next_program="Short break"), h_shift=h_shift, confirm=True)
|
|
489
|
-
|
|
512
|
+
timer_function(**short_break_params)
|
|
490
513
|
print_message(message=NEXT_PROGRAM_MESSAGE.format(
|
|
491
514
|
next_program="Work {round}/{repeat}".format(round=index + 2, repeat=4)), h_shift=h_shift, confirm=True)
|
|
492
515
|
print_message(message=NEXT_PROGRAM_MESSAGE.format(next_program="Long break"), h_shift=h_shift, confirm=True)
|
|
493
|
-
|
|
516
|
+
timer_function(**long_break_params)
|
|
494
517
|
|
|
495
518
|
|
|
496
|
-
def two_step_timer(
|
|
519
|
+
def two_step_timer(timer_function: Callable, params1: Dict[str, Any], params2: Dict[str, Any]) -> None:
|
|
497
520
|
"""
|
|
498
521
|
Two step timer function.
|
|
499
522
|
|
|
500
|
-
:param
|
|
523
|
+
:param timer_function: timer function
|
|
501
524
|
:param params1: program-1 params
|
|
502
525
|
:param params2: program-2 params
|
|
503
526
|
"""
|
|
504
527
|
h_shift = params1["h_shift"]
|
|
505
|
-
|
|
528
|
+
timer_function(**params1)
|
|
506
529
|
print_message(message=NEXT_PROGRAM_MESSAGE.format(next_program="Break"), h_shift=h_shift, confirm=True)
|
|
507
|
-
|
|
530
|
+
timer_function(**params2)
|
|
508
531
|
|
|
509
532
|
|
|
510
533
|
def keep_on_timer(params: Dict[str, Any]) -> None:
|
|
@@ -547,23 +570,23 @@ def update_set_on_params(params: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
547
570
|
return params
|
|
548
571
|
|
|
549
572
|
|
|
550
|
-
def
|
|
573
|
+
def select_timer_function(args: argparse.Namespace, params: Dict[str, Any]) -> Tuple[Callable, Dict[str, Any]]:
|
|
551
574
|
"""
|
|
552
575
|
Select timer function and parameters.
|
|
553
576
|
|
|
554
577
|
:param args: input arguments
|
|
555
578
|
:param params: timer params
|
|
556
579
|
"""
|
|
557
|
-
|
|
580
|
+
timer_function = countdown_timer
|
|
558
581
|
if args.countup:
|
|
559
|
-
|
|
582
|
+
timer_function = countup_timer
|
|
560
583
|
if args.countdown:
|
|
561
|
-
|
|
584
|
+
timer_function = countdown_timer
|
|
562
585
|
else:
|
|
563
586
|
if check_null_time(args) and not args.program:
|
|
564
587
|
params["hour"] = KEEP_ON_MAX
|
|
565
|
-
|
|
566
|
-
return
|
|
588
|
+
timer_function = countup_timer
|
|
589
|
+
return timer_function, params
|
|
567
590
|
|
|
568
591
|
|
|
569
592
|
def run_timer(args: argparse.Namespace) -> None:
|
|
@@ -572,14 +595,16 @@ def run_timer(args: argparse.Namespace) -> None:
|
|
|
572
595
|
|
|
573
596
|
:param args: input arguments
|
|
574
597
|
"""
|
|
598
|
+
set_color(color=args.color)
|
|
599
|
+
set_bg_color(bg_color=args.bg_color)
|
|
575
600
|
params = load_params(args)
|
|
576
|
-
|
|
601
|
+
timer_function, params = select_timer_function(args, params)
|
|
577
602
|
if args.set_on:
|
|
578
603
|
params = update_set_on_params(params)
|
|
579
604
|
if args.version:
|
|
580
605
|
print(MY_TIMER_VERSION)
|
|
581
606
|
elif args.info:
|
|
582
|
-
|
|
607
|
+
print_mytimer_info()
|
|
583
608
|
elif args.faces_list:
|
|
584
609
|
show_faces_list()
|
|
585
610
|
elif args.programs_list:
|
|
@@ -593,15 +618,15 @@ def run_timer(args: argparse.Namespace) -> None:
|
|
|
593
618
|
short_break_params = load_params(args, program="pomodoro-short-break", is_break=True)
|
|
594
619
|
long_break_params = load_params(args, program="pomodoro-long-break", is_break=True)
|
|
595
620
|
pomodoro_timer(
|
|
596
|
-
|
|
621
|
+
timer_function,
|
|
597
622
|
params=params,
|
|
598
623
|
long_break_params=long_break_params,
|
|
599
624
|
short_break_params=short_break_params)
|
|
600
625
|
elif args.program in ["52-17", "112-26", "animedoro"]:
|
|
601
626
|
break_params = load_params(args, is_break=True)
|
|
602
|
-
two_step_timer(
|
|
627
|
+
two_step_timer(timer_function, params1=params, params2=break_params)
|
|
603
628
|
else:
|
|
604
|
-
|
|
629
|
+
timer_function(**params)
|
|
605
630
|
end_round_message = END_ROUND_MESSAGE.format(
|
|
606
631
|
round="{round}/{repeat}".format(round=timer_round, repeat=args.repeat))
|
|
607
632
|
if args.repeat == -1:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
"""mytimer params."""
|
|
3
3
|
|
|
4
|
-
MY_TIMER_VERSION = "2.
|
|
4
|
+
MY_TIMER_VERSION = "2.4"
|
|
5
5
|
ADDITIONAL_INFO = "Additional information: Press `Ctrl+C` to exit."
|
|
6
6
|
INPUT_ERROR_MESSAGE = "[Error] Wrong input"
|
|
7
7
|
SOUND_ERROR_MESSAGE = "[Error] Unable to play sound"
|
|
@@ -359,3 +359,14 @@ FACES_LIST = [-1] + sorted(FACES_MAP)
|
|
|
359
359
|
TONES_LIST = [-1] + sorted(TONES_MAP)
|
|
360
360
|
|
|
361
361
|
DATE_SYSTEMS_LIST = ["gregorian", "jalali"]
|
|
362
|
+
|
|
363
|
+
COLORS_LIST = [
|
|
364
|
+
"black",
|
|
365
|
+
"red",
|
|
366
|
+
"green",
|
|
367
|
+
"yellow",
|
|
368
|
+
"blue",
|
|
369
|
+
"magenta",
|
|
370
|
+
"cyan",
|
|
371
|
+
"white",
|
|
372
|
+
]
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mytimer
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4
|
|
4
4
|
Summary: A Geeky Timer for Terminal Enthusiasts
|
|
5
5
|
Home-page: https://github.com/sepandhaghighi/mytimer
|
|
6
|
-
Download-URL: https://github.com/sepandhaghighi/mytimer/tarball/v2.
|
|
6
|
+
Download-URL: https://github.com/sepandhaghighi/mytimer/tarball/v2.4
|
|
7
7
|
Author: Sepand Haghighi
|
|
8
8
|
Author-email: me@sepand.tech
|
|
9
9
|
License: MIT
|
|
@@ -20,6 +20,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
24
|
Classifier: Intended Audience :: Developers
|
|
24
25
|
Classifier: Intended Audience :: Education
|
|
25
26
|
Classifier: Intended Audience :: End Users/Desktop
|
|
@@ -33,6 +34,7 @@ License-File: AUTHORS.md
|
|
|
33
34
|
Requires-Dist: art>=5.3
|
|
34
35
|
Requires-Dist: jdatetime>=3.8.2
|
|
35
36
|
Requires-Dist: nava>=0.4
|
|
37
|
+
Requires-Dist: colorama>=0.4.5
|
|
36
38
|
Dynamic: author
|
|
37
39
|
Dynamic: author-email
|
|
38
40
|
Dynamic: classifier
|
|
@@ -105,13 +107,13 @@ The main objective of <strong>MyTimer</strong> is to offer a minimalistic and di
|
|
|
105
107
|
## Installation
|
|
106
108
|
|
|
107
109
|
### Source Code
|
|
108
|
-
- Download [Version 2.
|
|
110
|
+
- Download [Version 2.4](https://github.com/sepandhaghighi/mytimer/archive/v2.4.zip) or [Latest Source](https://github.com/sepandhaghighi/mytimer/archive/dev.zip)
|
|
109
111
|
- `pip install .`
|
|
110
112
|
|
|
111
113
|
### PyPI
|
|
112
114
|
|
|
113
115
|
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
114
|
-
- `pip install mytimer==2.
|
|
116
|
+
- `pip install mytimer==2.4`
|
|
115
117
|
|
|
116
118
|
|
|
117
119
|
## Usage
|
|
@@ -288,6 +290,26 @@ mytimer --program=black-tea
|
|
|
288
290
|
mytimer --minute=7 --second=30 --message="Test message"
|
|
289
291
|
```
|
|
290
292
|
|
|
293
|
+
### Color
|
|
294
|
+
|
|
295
|
+
ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`]
|
|
296
|
+
|
|
297
|
+
ℹ️ The default color is `white`
|
|
298
|
+
|
|
299
|
+
```console
|
|
300
|
+
mytimer --minute=7 --second=30 --color="red"
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Background Color
|
|
304
|
+
|
|
305
|
+
ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`]
|
|
306
|
+
|
|
307
|
+
ℹ️ The default background color is `black`
|
|
308
|
+
|
|
309
|
+
```console
|
|
310
|
+
mytimer --minute=7 --second=30 --bg-color="blue"
|
|
311
|
+
```
|
|
312
|
+
|
|
291
313
|
## Screen Record
|
|
292
314
|
|
|
293
315
|
<div align="center">
|
|
@@ -374,6 +396,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
374
396
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
375
397
|
|
|
376
398
|
## [Unreleased]
|
|
399
|
+
## [2.4] - 2025-12-04
|
|
400
|
+
### Added
|
|
401
|
+
- `--color` argument
|
|
402
|
+
- `--bg-color` argument
|
|
403
|
+
### Changed
|
|
404
|
+
- `load_program_params` function modified
|
|
405
|
+
- `pomodoro_timer` function modified
|
|
406
|
+
- `two_step_timer` function modified
|
|
407
|
+
- `select_timer_func` function renamed to `select_timer_function`
|
|
408
|
+
- `mytimer_info` function renamed to `print_mytimer_info`
|
|
409
|
+
- `run_timer` function modified
|
|
410
|
+
- `Python 3.14` added to `test.yml`
|
|
411
|
+
- `README.md` updated
|
|
412
|
+
- Test system modified
|
|
377
413
|
## [2.3] - 2025-07-17
|
|
378
414
|
### Added
|
|
379
415
|
- 2 new programs
|
|
@@ -599,7 +635,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
599
635
|
- Count-up mode
|
|
600
636
|
- Alarm
|
|
601
637
|
|
|
602
|
-
[Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.
|
|
638
|
+
[Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.4...dev
|
|
639
|
+
[2.4]: https://github.com/sepandhaghighi/mytimer/compare/v2.3...v2.4
|
|
603
640
|
[2.3]: https://github.com/sepandhaghighi/mytimer/compare/v2.2...v2.3
|
|
604
641
|
[2.2]: https://github.com/sepandhaghighi/mytimer/compare/v2.1...v2.2
|
|
605
642
|
[2.1]: https://github.com/sepandhaghighi/mytimer/compare/v2.0...v2.1
|
|
@@ -30,7 +30,7 @@ def read_description() -> str:
|
|
|
30
30
|
setup(
|
|
31
31
|
name='mytimer',
|
|
32
32
|
packages=['mytimer'],
|
|
33
|
-
version='2.
|
|
33
|
+
version='2.4',
|
|
34
34
|
description='A Geeky Timer for Terminal Enthusiasts',
|
|
35
35
|
long_description=read_description(),
|
|
36
36
|
long_description_content_type='text/markdown',
|
|
@@ -38,7 +38,7 @@ setup(
|
|
|
38
38
|
author='Sepand Haghighi',
|
|
39
39
|
author_email='me@sepand.tech',
|
|
40
40
|
url='https://github.com/sepandhaghighi/mytimer',
|
|
41
|
-
download_url='https://github.com/sepandhaghighi/mytimer/tarball/v2.
|
|
41
|
+
download_url='https://github.com/sepandhaghighi/mytimer/tarball/v2.4',
|
|
42
42
|
keywords="timer time clock terminal stopwatch cli geek",
|
|
43
43
|
project_urls={
|
|
44
44
|
'Source': 'https://github.com/sepandhaghighi/mytimer'
|
|
@@ -57,6 +57,7 @@ setup(
|
|
|
57
57
|
'Programming Language :: Python :: 3.11',
|
|
58
58
|
'Programming Language :: Python :: 3.12',
|
|
59
59
|
'Programming Language :: Python :: 3.13',
|
|
60
|
+
'Programming Language :: Python :: 3.14',
|
|
60
61
|
'Intended Audience :: Developers',
|
|
61
62
|
'Intended Audience :: Education',
|
|
62
63
|
'Intended Audience :: End Users/Desktop',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|