mytimer 2.4__tar.gz → 2.5__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.
Files changed (60) hide show
  1. {mytimer-2.4 → mytimer-2.5}/CHANGELOG.md +17 -1
  2. {mytimer-2.4 → mytimer-2.5}/PKG-INFO +41 -9
  3. {mytimer-2.4 → mytimer-2.5}/README.md +22 -6
  4. {mytimer-2.4 → mytimer-2.5}/SECURITY.md +2 -2
  5. {mytimer-2.4 → mytimer-2.5}/dev-requirements.txt +1 -1
  6. mytimer-2.5/mytimer/__main__.py +7 -0
  7. {mytimer-2.4 → mytimer-2.5}/mytimer/functions.py +151 -33
  8. {mytimer-2.4 → mytimer-2.5}/mytimer/params.py +15 -1
  9. {mytimer-2.4 → mytimer-2.5}/mytimer.egg-info/PKG-INFO +41 -9
  10. mytimer-2.5/mytimer.egg-info/entry_points.txt +2 -0
  11. {mytimer-2.4 → mytimer-2.5}/setup.py +3 -3
  12. mytimer-2.4/mytimer/__main__.py +0 -87
  13. mytimer-2.4/mytimer.egg-info/entry_points.txt +0 -2
  14. {mytimer-2.4 → mytimer-2.5}/AUTHORS.md +0 -0
  15. {mytimer-2.4 → mytimer-2.5}/FACES.md +0 -0
  16. {mytimer-2.4 → mytimer-2.5}/LICENSE +0 -0
  17. {mytimer-2.4 → mytimer-2.5}/MANIFEST.in +0 -0
  18. {mytimer-2.4 → mytimer-2.5}/PROGRAMS.md +0 -0
  19. {mytimer-2.4 → mytimer-2.5}/TONES.md +0 -0
  20. {mytimer-2.4 → mytimer-2.5}/mytimer/__init__.py +0 -0
  21. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/1.wav +0 -0
  22. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/10.wav +0 -0
  23. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/11.wav +0 -0
  24. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/12.wav +0 -0
  25. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/13.wav +0 -0
  26. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/14.wav +0 -0
  27. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/15.wav +0 -0
  28. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/16.wav +0 -0
  29. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/17.wav +0 -0
  30. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/18.wav +0 -0
  31. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/19.wav +0 -0
  32. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/2.wav +0 -0
  33. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/20.wav +0 -0
  34. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/21.wav +0 -0
  35. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/22.wav +0 -0
  36. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/23.wav +0 -0
  37. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/24.wav +0 -0
  38. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/25.wav +0 -0
  39. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/26.wav +0 -0
  40. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/27.wav +0 -0
  41. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/28.wav +0 -0
  42. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/29.wav +0 -0
  43. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/3.wav +0 -0
  44. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/30.wav +0 -0
  45. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/31.wav +0 -0
  46. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/32.wav +0 -0
  47. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/33.wav +0 -0
  48. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/34.wav +0 -0
  49. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/4.wav +0 -0
  50. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/5.wav +0 -0
  51. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/6.wav +0 -0
  52. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/7.wav +0 -0
  53. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/8.wav +0 -0
  54. {mytimer-2.4 → mytimer-2.5}/mytimer/sounds/9.wav +0 -0
  55. {mytimer-2.4 → mytimer-2.5}/mytimer.egg-info/SOURCES.txt +0 -0
  56. {mytimer-2.4 → mytimer-2.5}/mytimer.egg-info/dependency_links.txt +0 -0
  57. {mytimer-2.4 → mytimer-2.5}/mytimer.egg-info/requires.txt +0 -0
  58. {mytimer-2.4 → mytimer-2.5}/mytimer.egg-info/top_level.txt +0 -0
  59. {mytimer-2.4 → mytimer-2.5}/requirements.txt +0 -0
  60. {mytimer-2.4 → mytimer-2.5}/setup.cfg +0 -0
@@ -5,6 +5,21 @@ 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.5] - 2026-02-10
9
+ ### Added
10
+ - `--intensity` argument
11
+ - Light colors
12
+ ### Changed
13
+ - `README.md` updated
14
+ - Test system modified
15
+ - Background color bug fixed
16
+ - `set_color` function modified
17
+ - `set_bg_color` function modified
18
+ - `run_timer` function modified
19
+ - Arguments moved to `handle_args` function
20
+ - `main` function moved to `functions.py`
21
+ - `--set-on` flag bug fixed
22
+ - Screen record updated
8
23
  ## [2.4] - 2025-12-04
9
24
  ### Added
10
25
  - `--color` argument
@@ -244,7 +259,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
244
259
  - Count-up mode
245
260
  - Alarm
246
261
 
247
- [Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.4...dev
262
+ [Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.5...dev
263
+ [2.5]: https://github.com/sepandhaghighi/mytimer/compare/v2.4...v2.5
248
264
  [2.4]: https://github.com/sepandhaghighi/mytimer/compare/v2.3...v2.4
249
265
  [2.3]: https://github.com/sepandhaghighi/mytimer/compare/v2.2...v2.3
250
266
  [2.2]: https://github.com/sepandhaghighi/mytimer/compare/v2.1...v2.2
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mytimer
3
- Version: 2.4
3
+ Version: 2.5
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.4
6
+ Download-URL: https://github.com/sepandhaghighi/mytimer/tarball/v2.5
7
7
  Author: Sepand Haghighi
8
8
  Author-email: me@sepand.tech
9
9
  License: MIT
@@ -98,8 +98,8 @@ The main objective of <strong>MyTimer</strong> is to offer a minimalistic and di
98
98
  <table>
99
99
  <tr>
100
100
  <td align="center">Code Quality</td>
101
- <td align="center"><a href="https://www.codefactor.io/repository/github/sepandhaghighi/mytimer"><img src="https://www.codefactor.io/repository/github/sepandhaghighi/mytimer/badge" alt="CodeFactor" /></a></td>
102
- <td><a href="https://app.codacy.com/gh/sepandhaghighi/mytimer/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/1bf28500431a498998ac79891cd79cda"/></a></td>
101
+ <td align="center"><a href="https://www.codefactor.io/repository/github/sepandhaghighi/mytimer"><img src="https://www.codefactor.io/repository/github/sepandhaghighi/mytimer/badge" alt="CodeFactor"></a></td>
102
+ <td><a href="https://app.codacy.com/gh/sepandhaghighi/mytimer/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/1bf28500431a498998ac79891cd79cda"></a></td>
103
103
  </tr>
104
104
  </table>
105
105
 
@@ -107,13 +107,13 @@ The main objective of <strong>MyTimer</strong> is to offer a minimalistic and di
107
107
  ## Installation
108
108
 
109
109
  ### Source Code
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)
110
+ - Download [Version 2.5](https://github.com/sepandhaghighi/mytimer/archive/v2.5.zip) or [Latest Source](https://github.com/sepandhaghighi/mytimer/archive/dev.zip)
111
111
  - `pip install .`
112
112
 
113
113
  ### PyPI
114
114
 
115
115
  - Check [Python Packaging User Guide](https://packaging.python.org/installing/)
116
- - `pip install mytimer==2.4`
116
+ - `pip install mytimer==2.5`
117
117
 
118
118
 
119
119
  ## Usage
@@ -292,7 +292,9 @@ mytimer --minute=7 --second=30 --message="Test message"
292
292
 
293
293
  ### Color
294
294
 
295
- ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`]
295
+ ⚠️ This mode may not be supported on all systems
296
+
297
+ ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `lightblack`, `lightred`, `lightgreen`, `lightyellow`, `lightblue`, `lightmagenta`, `lightcyan`, `lightwhite`]
296
298
 
297
299
  ℹ️ The default color is `white`
298
300
 
@@ -302,7 +304,9 @@ mytimer --minute=7 --second=30 --color="red"
302
304
 
303
305
  ### Background Color
304
306
 
305
- ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`]
307
+ ⚠️ This mode may not be supported on all systems
308
+
309
+ ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `lightblack`, `lightred`, `lightgreen`, `lightyellow`, `lightblue`, `lightmagenta`, `lightcyan`, `lightwhite`]
306
310
 
307
311
  ℹ️ The default background color is `black`
308
312
 
@@ -310,6 +314,18 @@ mytimer --minute=7 --second=30 --color="red"
310
314
  mytimer --minute=7 --second=30 --bg-color="blue"
311
315
  ```
312
316
 
317
+ ### Intensity
318
+
319
+ ⚠️ This mode may not be supported on all systems
320
+
321
+ ℹ️ Valid choices: [`normal`, `bright`, `dim`]
322
+
323
+ ℹ️ The default intensity is `normal`
324
+
325
+ ```console
326
+ mytimer --minute=7 --second=30 --intensity="bright"
327
+ ```
328
+
313
329
  ## Screen Record
314
330
 
315
331
  <div align="center">
@@ -396,6 +412,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
396
412
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
397
413
 
398
414
  ## [Unreleased]
415
+ ## [2.5] - 2026-02-10
416
+ ### Added
417
+ - `--intensity` argument
418
+ - Light colors
419
+ ### Changed
420
+ - `README.md` updated
421
+ - Test system modified
422
+ - Background color bug fixed
423
+ - `set_color` function modified
424
+ - `set_bg_color` function modified
425
+ - `run_timer` function modified
426
+ - Arguments moved to `handle_args` function
427
+ - `main` function moved to `functions.py`
428
+ - `--set-on` flag bug fixed
429
+ - Screen record updated
399
430
  ## [2.4] - 2025-12-04
400
431
  ### Added
401
432
  - `--color` argument
@@ -635,7 +666,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
635
666
  - Count-up mode
636
667
  - Alarm
637
668
 
638
- [Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.4...dev
669
+ [Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.5...dev
670
+ [2.5]: https://github.com/sepandhaghighi/mytimer/compare/v2.4...v2.5
639
671
  [2.4]: https://github.com/sepandhaghighi/mytimer/compare/v2.3...v2.4
640
672
  [2.3]: https://github.com/sepandhaghighi/mytimer/compare/v2.2...v2.3
641
673
  [2.2]: https://github.com/sepandhaghighi/mytimer/compare/v2.1...v2.2
@@ -45,8 +45,8 @@ The main objective of <strong>MyTimer</strong> is to offer a minimalistic and di
45
45
  <table>
46
46
  <tr>
47
47
  <td align="center">Code Quality</td>
48
- <td align="center"><a href="https://www.codefactor.io/repository/github/sepandhaghighi/mytimer"><img src="https://www.codefactor.io/repository/github/sepandhaghighi/mytimer/badge" alt="CodeFactor" /></a></td>
49
- <td><a href="https://app.codacy.com/gh/sepandhaghighi/mytimer/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/1bf28500431a498998ac79891cd79cda"/></a></td>
48
+ <td align="center"><a href="https://www.codefactor.io/repository/github/sepandhaghighi/mytimer"><img src="https://www.codefactor.io/repository/github/sepandhaghighi/mytimer/badge" alt="CodeFactor"></a></td>
49
+ <td><a href="https://app.codacy.com/gh/sepandhaghighi/mytimer/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/1bf28500431a498998ac79891cd79cda"></a></td>
50
50
  </tr>
51
51
  </table>
52
52
 
@@ -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.4](https://github.com/sepandhaghighi/mytimer/archive/v2.4.zip) or [Latest Source](https://github.com/sepandhaghighi/mytimer/archive/dev.zip)
57
+ - Download [Version 2.5](https://github.com/sepandhaghighi/mytimer/archive/v2.5.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.4`
63
+ - `pip install mytimer==2.5`
64
64
 
65
65
 
66
66
  ## Usage
@@ -239,7 +239,9 @@ mytimer --minute=7 --second=30 --message="Test message"
239
239
 
240
240
  ### Color
241
241
 
242
- ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`]
242
+ ⚠️ This mode may not be supported on all systems
243
+
244
+ ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `lightblack`, `lightred`, `lightgreen`, `lightyellow`, `lightblue`, `lightmagenta`, `lightcyan`, `lightwhite`]
243
245
 
244
246
  ℹ️ The default color is `white`
245
247
 
@@ -249,7 +251,9 @@ mytimer --minute=7 --second=30 --color="red"
249
251
 
250
252
  ### Background Color
251
253
 
252
- ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`]
254
+ ⚠️ This mode may not be supported on all systems
255
+
256
+ ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `lightblack`, `lightred`, `lightgreen`, `lightyellow`, `lightblue`, `lightmagenta`, `lightcyan`, `lightwhite`]
253
257
 
254
258
  ℹ️ The default background color is `black`
255
259
 
@@ -257,6 +261,18 @@ mytimer --minute=7 --second=30 --color="red"
257
261
  mytimer --minute=7 --second=30 --bg-color="blue"
258
262
  ```
259
263
 
264
+ ### Intensity
265
+
266
+ ⚠️ This mode may not be supported on all systems
267
+
268
+ ℹ️ Valid choices: [`normal`, `bright`, `dim`]
269
+
270
+ ℹ️ The default intensity is `normal`
271
+
272
+ ```console
273
+ mytimer --minute=7 --second=30 --intensity="bright"
274
+ ```
275
+
260
276
  ## Screen Record
261
277
 
262
278
  <div align="center">
@@ -4,8 +4,8 @@
4
4
 
5
5
  | Version | Supported |
6
6
  | ------------- | ------------------ |
7
- | 2.4 | :white_check_mark: |
8
- | < 2.4 | :x: |
7
+ | 2.5 | :white_check_mark: |
8
+ | < 2.5 | :x: |
9
9
 
10
10
  ## Reporting a Vulnerability
11
11
 
@@ -1,4 +1,4 @@
1
- nava==0.7
1
+ nava==0.8
2
2
  art==6.5
3
3
  jdatetime==5.2.0
4
4
  colorama==0.4.6
@@ -0,0 +1,7 @@
1
+ # -*- coding: utf-8 -*-
2
+ """mytimer main."""
3
+ from mytimer.functions import main
4
+
5
+
6
+ if __name__ == "__main__":
7
+ main()
@@ -9,11 +9,11 @@ import jdatetime
9
9
  import random
10
10
  import argparse
11
11
  from nava import play
12
- from colorama import Fore, Back
12
+ from colorama import Fore, Back, Style
13
13
  from mytimer.params import INPUT_ERROR_MESSAGE, SOUND_ERROR_MESSAGE
14
14
  from mytimer.params import INPUT_EXAMPLE, TIME_ELEMENTS, MESSAGE_TEMPLATE
15
15
  from mytimer.params import FACES_MAP, PROGRAMS_MAP, BREAKS_MAP, TONES_MAP
16
- from mytimer.params import MY_TIMER_VERSION, PROGRAMS_LIST_TEMPLATE
16
+ from mytimer.params import MY_TIMER_VERSION, PROGRAMS_LIST_TEMPLATE, EXIT_MESSAGE
17
17
  from mytimer.params import FACES_LIST_EXAMPLE_MESSAGE
18
18
  from mytimer.params import DEFAULT_PARAMS, PROGRAMS_DEFAULTS, BREAKS_DEFAULTS
19
19
  from mytimer.params import NEXT_PROGRAM_MESSAGE, END_ROUND_MESSAGE
@@ -23,6 +23,9 @@ from mytimer.params import MY_TIMER_OVERVIEW, MY_TIMER_REPO
23
23
  from mytimer.params import TIME_HMS_TEMPLATE_HORIZONTAL, TIME_HM_TEMPLATE_HORIZONTAL
24
24
  from mytimer.params import TIME_HMS_TEMPLATE_VERTICAL, TIME_HM_TEMPLATE_VERTICAL
25
25
  from mytimer.params import CLOCK_FORMAT, DATE_FORMAT
26
+ from mytimer.params import FACES_LIST, TONES_LIST
27
+ from mytimer.params import ADDITIONAL_INFO, SIGNS_LIST
28
+ from mytimer.params import DATE_SYSTEMS_LIST, COLORS_LIST, INTENSITY_LIST
26
29
  from art import tprint
27
30
 
28
31
 
@@ -239,6 +242,8 @@ def set_color(color: str) -> None:
239
242
  """
240
243
  if color:
241
244
  color = color.strip().upper()
245
+ if color.startswith("LIGHT"):
246
+ color += "_EX"
242
247
  print(getattr(Fore, color, ""), end="")
243
248
 
244
249
 
@@ -250,7 +255,20 @@ def set_bg_color(bg_color: str) -> None:
250
255
  """
251
256
  if bg_color:
252
257
  bg_color = bg_color.strip().upper()
253
- print(getattr(Back, bg_color, ""), end="")
258
+ if bg_color.startswith("LIGHT"):
259
+ bg_color += "_EX"
260
+ print(getattr(Back, bg_color, ""))
261
+
262
+
263
+ def set_intensity(intensity: str) -> None:
264
+ """
265
+ Set text intensity.
266
+
267
+ :param intensity: intensity name
268
+ """
269
+ if intensity:
270
+ intensity = intensity.strip().upper()
271
+ print(getattr(Style, intensity, ""), end="")
254
272
 
255
273
 
256
274
  def get_tone(index: int) -> str:
@@ -589,17 +607,132 @@ def select_timer_function(args: argparse.Namespace, params: Dict[str, Any]) -> T
589
607
  return timer_function, params
590
608
 
591
609
 
592
- def run_timer(args: argparse.Namespace) -> None:
610
+ def handle_args() -> argparse.Namespace:
611
+ """Handle CLI arguments."""
612
+ parser = argparse.ArgumentParser()
613
+ parser.epilog = ADDITIONAL_INFO
614
+ parser.add_argument('--minute', help='minute', type=int)
615
+ parser.add_argument('--second', help='second', type=int)
616
+ parser.add_argument('--hour', help='hour', type=int)
617
+ parser.add_argument('--message', help='message', type=str)
618
+ parser.add_argument(
619
+ '--face',
620
+ help='face',
621
+ type=int,
622
+ choices=FACES_LIST)
623
+ parser.add_argument(
624
+ '--color',
625
+ help='text color',
626
+ type=str.lower,
627
+ choices=COLORS_LIST)
628
+ parser.add_argument(
629
+ '--bg-color',
630
+ help='background color',
631
+ type=str.lower,
632
+ choices=COLORS_LIST)
633
+ parser.add_argument(
634
+ '--intensity',
635
+ help='text intensity',
636
+ type=str.lower,
637
+ choices=INTENSITY_LIST)
638
+ parser.add_argument(
639
+ '--tone',
640
+ help='alarm tone',
641
+ type=int,
642
+ choices=TONES_LIST)
643
+ parser.add_argument(
644
+ '--program',
645
+ help='program',
646
+ type=str.lower,
647
+ choices=sorted(PROGRAMS_MAP))
648
+ parser.add_argument(
649
+ '--sign',
650
+ help='timer sign',
651
+ type=str,
652
+ choices=SIGNS_LIST)
653
+ parser.add_argument('--alarm-repeat', help='alarm repeat', type=int)
654
+ parser.add_argument('--v-shift', help='vertical shift', type=int)
655
+ parser.add_argument('--h-shift', help='horizontal shift', type=int)
656
+ parser.add_argument('--repeat', help='number of repeats', type=int, default=1)
657
+ parser.add_argument(
658
+ '--countdown',
659
+ help='countdown timer',
660
+ nargs="?",
661
+ const=1)
662
+ parser.add_argument('--countup', help='countup timer', nargs="?", const=1)
663
+ parser.add_argument('--alarm', help='alarm', nargs="?", const=1)
664
+ parser.add_argument('--keep-on', help='keep-on', nargs="?", const=1)
665
+ parser.add_argument('--set-on', help='set-on', nargs="?", const=1)
666
+ parser.add_argument('--test-tone', help='test tone', nargs="?", const=1)
667
+ parser.add_argument('--faces-list', help='faces list', nargs="?", const=1)
668
+ parser.add_argument('--version', help='version', nargs="?", const=1)
669
+ parser.add_argument('--info', help='info', nargs="?", const=1)
670
+ parser.add_argument('--hide-second', help='hide second', nargs="?", const=1)
671
+ parser.add_argument('--hide-datetime', help='hide datetime', nargs="?", const=1)
672
+ parser.add_argument('--vertical', help='vertical mode', nargs="?", const=1)
673
+ parser.add_argument(
674
+ '--date-system',
675
+ help='date system',
676
+ type=str.lower,
677
+ choices=DATE_SYSTEMS_LIST,
678
+ default="gregorian")
679
+ parser.add_argument(
680
+ '--programs-list',
681
+ help='programs list',
682
+ nargs="?",
683
+ const=1)
684
+ args = parser.parse_args()
685
+ return args
686
+
687
+
688
+ def run_timer(timer_function: Callable, params: Dict[str, dict], repeat: int, program: str, keep_on: bool) -> None:
593
689
  """
594
690
  Run timer.
595
691
 
596
- :param args: input arguments
692
+ :param timer_function: timer function
693
+ :param params: timer and breaks params
694
+ :param repeat: number of repeats
695
+ :param program: program name
696
+ :param keep_on: keep-on flag
597
697
  """
698
+ try:
699
+ timer_round = 1
700
+ while timer_round <= repeat or repeat == -1:
701
+ if program == "pomodoro":
702
+ pomodoro_timer(
703
+ timer_function,
704
+ params=params["timer"],
705
+ long_break_params=params["long_break"],
706
+ short_break_params=params["short_break"])
707
+ elif program in ["52-17", "112-26", "animedoro"]:
708
+ two_step_timer(timer_function, params1=params["timer"], params2=params["break"])
709
+ else:
710
+ timer_function(**params["timer"])
711
+ end_round_message = END_ROUND_MESSAGE.format(
712
+ round="{round}/{repeat}".format(round=timer_round, repeat=repeat))
713
+ if repeat == -1:
714
+ end_round_message = END_ROUND_MESSAGE.format(round=timer_round)
715
+ if timer_round < repeat or repeat == -1:
716
+ print_message(
717
+ message=end_round_message,
718
+ h_shift=params["timer"]["h_shift"],
719
+ confirm=True)
720
+ timer_round += 1
721
+ if keep_on:
722
+ keep_on_timer(params["timer"])
723
+ except (KeyboardInterrupt, EOFError):
724
+ print(EXIT_MESSAGE)
725
+
726
+
727
+ def main() -> None:
728
+ """CLI main function."""
729
+ args = handle_args()
598
730
  set_color(color=args.color)
599
731
  set_bg_color(bg_color=args.bg_color)
732
+ set_intensity(intensity=args.intensity)
600
733
  params = load_params(args)
601
734
  timer_function, params = select_timer_function(args, params)
602
- if args.set_on:
735
+ if args.set_on and not args.program:
603
736
  params = update_set_on_params(params)
604
737
  if args.version:
605
738
  print(MY_TIMER_VERSION)
@@ -612,30 +745,15 @@ def run_timer(args: argparse.Namespace) -> None:
612
745
  elif args.test_tone:
613
746
  test_tone(params["tone"], params["alarm_repeat"])
614
747
  else:
615
- timer_round = 1
616
- while timer_round <= args.repeat or args.repeat == -1:
617
- if args.program == "pomodoro":
618
- short_break_params = load_params(args, program="pomodoro-short-break", is_break=True)
619
- long_break_params = load_params(args, program="pomodoro-long-break", is_break=True)
620
- pomodoro_timer(
621
- timer_function,
622
- params=params,
623
- long_break_params=long_break_params,
624
- short_break_params=short_break_params)
625
- elif args.program in ["52-17", "112-26", "animedoro"]:
626
- break_params = load_params(args, is_break=True)
627
- two_step_timer(timer_function, params1=params, params2=break_params)
628
- else:
629
- timer_function(**params)
630
- end_round_message = END_ROUND_MESSAGE.format(
631
- round="{round}/{repeat}".format(round=timer_round, repeat=args.repeat))
632
- if args.repeat == -1:
633
- end_round_message = END_ROUND_MESSAGE.format(round=timer_round)
634
- if timer_round < args.repeat or args.repeat == -1:
635
- print_message(
636
- message=end_round_message,
637
- h_shift=params["h_shift"],
638
- confirm=True)
639
- timer_round += 1
640
- if args.keep_on:
641
- keep_on_timer(params)
748
+ params_dict = {"timer": params}
749
+ if args.program == "pomodoro":
750
+ params_dict["short_break"] = load_params(args, program="pomodoro-short-break", is_break=True)
751
+ params_dict["long_break"] = load_params(args, program="pomodoro-long-break", is_break=True)
752
+ elif args.program in ["52-17", "112-26", "animedoro"]:
753
+ params_dict["break"] = load_params(args, is_break=True)
754
+ run_timer(
755
+ timer_function=timer_function,
756
+ params=params_dict,
757
+ repeat=args.repeat,
758
+ program=args.program,
759
+ keep_on=args.keep_on)
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """mytimer params."""
3
3
 
4
- MY_TIMER_VERSION = "2.4"
4
+ MY_TIMER_VERSION = "2.5"
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"
@@ -369,4 +369,18 @@ COLORS_LIST = [
369
369
  "magenta",
370
370
  "cyan",
371
371
  "white",
372
+ "lightblack",
373
+ "lightred",
374
+ "lightgreen",
375
+ "lightyellow",
376
+ "lightblue",
377
+ "lightmagenta",
378
+ "lightcyan",
379
+ "lightwhite",
380
+ ]
381
+
382
+ INTENSITY_LIST = [
383
+ "normal",
384
+ "bright",
385
+ "dim",
372
386
  ]
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mytimer
3
- Version: 2.4
3
+ Version: 2.5
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.4
6
+ Download-URL: https://github.com/sepandhaghighi/mytimer/tarball/v2.5
7
7
  Author: Sepand Haghighi
8
8
  Author-email: me@sepand.tech
9
9
  License: MIT
@@ -98,8 +98,8 @@ The main objective of <strong>MyTimer</strong> is to offer a minimalistic and di
98
98
  <table>
99
99
  <tr>
100
100
  <td align="center">Code Quality</td>
101
- <td align="center"><a href="https://www.codefactor.io/repository/github/sepandhaghighi/mytimer"><img src="https://www.codefactor.io/repository/github/sepandhaghighi/mytimer/badge" alt="CodeFactor" /></a></td>
102
- <td><a href="https://app.codacy.com/gh/sepandhaghighi/mytimer/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/1bf28500431a498998ac79891cd79cda"/></a></td>
101
+ <td align="center"><a href="https://www.codefactor.io/repository/github/sepandhaghighi/mytimer"><img src="https://www.codefactor.io/repository/github/sepandhaghighi/mytimer/badge" alt="CodeFactor"></a></td>
102
+ <td><a href="https://app.codacy.com/gh/sepandhaghighi/mytimer/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/1bf28500431a498998ac79891cd79cda"></a></td>
103
103
  </tr>
104
104
  </table>
105
105
 
@@ -107,13 +107,13 @@ The main objective of <strong>MyTimer</strong> is to offer a minimalistic and di
107
107
  ## Installation
108
108
 
109
109
  ### Source Code
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)
110
+ - Download [Version 2.5](https://github.com/sepandhaghighi/mytimer/archive/v2.5.zip) or [Latest Source](https://github.com/sepandhaghighi/mytimer/archive/dev.zip)
111
111
  - `pip install .`
112
112
 
113
113
  ### PyPI
114
114
 
115
115
  - Check [Python Packaging User Guide](https://packaging.python.org/installing/)
116
- - `pip install mytimer==2.4`
116
+ - `pip install mytimer==2.5`
117
117
 
118
118
 
119
119
  ## Usage
@@ -292,7 +292,9 @@ mytimer --minute=7 --second=30 --message="Test message"
292
292
 
293
293
  ### Color
294
294
 
295
- ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`]
295
+ ⚠️ This mode may not be supported on all systems
296
+
297
+ ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `lightblack`, `lightred`, `lightgreen`, `lightyellow`, `lightblue`, `lightmagenta`, `lightcyan`, `lightwhite`]
296
298
 
297
299
  ℹ️ The default color is `white`
298
300
 
@@ -302,7 +304,9 @@ mytimer --minute=7 --second=30 --color="red"
302
304
 
303
305
  ### Background Color
304
306
 
305
- ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`]
307
+ ⚠️ This mode may not be supported on all systems
308
+
309
+ ℹ️ Valid choices: [`black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `lightblack`, `lightred`, `lightgreen`, `lightyellow`, `lightblue`, `lightmagenta`, `lightcyan`, `lightwhite`]
306
310
 
307
311
  ℹ️ The default background color is `black`
308
312
 
@@ -310,6 +314,18 @@ mytimer --minute=7 --second=30 --color="red"
310
314
  mytimer --minute=7 --second=30 --bg-color="blue"
311
315
  ```
312
316
 
317
+ ### Intensity
318
+
319
+ ⚠️ This mode may not be supported on all systems
320
+
321
+ ℹ️ Valid choices: [`normal`, `bright`, `dim`]
322
+
323
+ ℹ️ The default intensity is `normal`
324
+
325
+ ```console
326
+ mytimer --minute=7 --second=30 --intensity="bright"
327
+ ```
328
+
313
329
  ## Screen Record
314
330
 
315
331
  <div align="center">
@@ -396,6 +412,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
396
412
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
397
413
 
398
414
  ## [Unreleased]
415
+ ## [2.5] - 2026-02-10
416
+ ### Added
417
+ - `--intensity` argument
418
+ - Light colors
419
+ ### Changed
420
+ - `README.md` updated
421
+ - Test system modified
422
+ - Background color bug fixed
423
+ - `set_color` function modified
424
+ - `set_bg_color` function modified
425
+ - `run_timer` function modified
426
+ - Arguments moved to `handle_args` function
427
+ - `main` function moved to `functions.py`
428
+ - `--set-on` flag bug fixed
429
+ - Screen record updated
399
430
  ## [2.4] - 2025-12-04
400
431
  ### Added
401
432
  - `--color` argument
@@ -635,7 +666,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
635
666
  - Count-up mode
636
667
  - Alarm
637
668
 
638
- [Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.4...dev
669
+ [Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.5...dev
670
+ [2.5]: https://github.com/sepandhaghighi/mytimer/compare/v2.4...v2.5
639
671
  [2.4]: https://github.com/sepandhaghighi/mytimer/compare/v2.3...v2.4
640
672
  [2.3]: https://github.com/sepandhaghighi/mytimer/compare/v2.2...v2.3
641
673
  [2.2]: https://github.com/sepandhaghighi/mytimer/compare/v2.1...v2.2
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ mytimer = mytimer.functions:main
@@ -30,7 +30,7 @@ def read_description() -> str:
30
30
  setup(
31
31
  name='mytimer',
32
32
  packages=['mytimer'],
33
- version='2.4',
33
+ version='2.5',
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.4',
41
+ download_url='https://github.com/sepandhaghighi/mytimer/tarball/v2.5',
42
42
  keywords="timer time clock terminal stopwatch cli geek",
43
43
  project_urls={
44
44
  'Source': 'https://github.com/sepandhaghighi/mytimer'
@@ -68,7 +68,7 @@ setup(
68
68
  license='MIT',
69
69
  entry_points={
70
70
  'console_scripts': [
71
- 'mytimer = mytimer.__main__:main',
71
+ 'mytimer = mytimer.functions:main',
72
72
  ]
73
73
  }
74
74
  )
@@ -1,87 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- """mytimer main."""
3
- from mytimer.params import FACES_LIST, PROGRAMS_MAP, TONES_LIST
4
- from mytimer.params import EXIT_MESSAGE, ADDITIONAL_INFO, SIGNS_LIST
5
- from mytimer.params import DATE_SYSTEMS_LIST, COLORS_LIST
6
- from mytimer.functions import run_timer
7
- import argparse
8
-
9
-
10
- def main() -> None:
11
- """CLI main function."""
12
- parser = argparse.ArgumentParser()
13
- parser.epilog = ADDITIONAL_INFO
14
- parser.add_argument('--minute', help='minute', type=int)
15
- parser.add_argument('--second', help='second', type=int)
16
- parser.add_argument('--hour', help='hour', type=int)
17
- parser.add_argument('--message', help='message', type=str)
18
- parser.add_argument(
19
- '--face',
20
- help='face',
21
- type=int,
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)
33
- parser.add_argument(
34
- '--tone',
35
- help='alarm tone',
36
- type=int,
37
- choices=TONES_LIST)
38
- parser.add_argument(
39
- '--program',
40
- help='program',
41
- type=str.lower,
42
- choices=sorted(PROGRAMS_MAP))
43
- parser.add_argument(
44
- '--sign',
45
- help='timer sign',
46
- type=str,
47
- choices=SIGNS_LIST)
48
- parser.add_argument('--alarm-repeat', help='alarm repeat', type=int)
49
- parser.add_argument('--v-shift', help='vertical shift', type=int)
50
- parser.add_argument('--h-shift', help='horizontal shift', type=int)
51
- parser.add_argument('--repeat', help='number of repeats', type=int, default=1)
52
- parser.add_argument(
53
- '--countdown',
54
- help='countdown timer',
55
- nargs="?",
56
- const=1)
57
- parser.add_argument('--countup', help='countup timer', nargs="?", const=1)
58
- parser.add_argument('--alarm', help='alarm', nargs="?", const=1)
59
- parser.add_argument('--keep-on', help='keep-on', nargs="?", const=1)
60
- parser.add_argument('--set-on', help='set-on', nargs="?", const=1)
61
- parser.add_argument('--test-tone', help='test tone', nargs="?", const=1)
62
- parser.add_argument('--faces-list', help='faces list', nargs="?", const=1)
63
- parser.add_argument('--version', help='version', nargs="?", const=1)
64
- parser.add_argument('--info', help='info', nargs="?", const=1)
65
- parser.add_argument('--hide-second', help='hide second', nargs="?", const=1)
66
- parser.add_argument('--hide-datetime', help='hide datetime', nargs="?", const=1)
67
- parser.add_argument('--vertical', help='vertical mode', nargs="?", const=1)
68
- parser.add_argument(
69
- '--date-system',
70
- help='date system',
71
- type=str.lower,
72
- choices=DATE_SYSTEMS_LIST,
73
- default="gregorian")
74
- parser.add_argument(
75
- '--programs-list',
76
- help='programs list',
77
- nargs="?",
78
- const=1)
79
- args = parser.parse_args()
80
- try:
81
- run_timer(args)
82
- except (KeyboardInterrupt, EOFError):
83
- print(EXIT_MESSAGE)
84
-
85
-
86
- if __name__ == "__main__":
87
- main()
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- mytimer = mytimer.__main__:main
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