mytimer 2.1__tar.gz → 2.2__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.1 → mytimer-2.2}/CHANGELOG.md +11 -1
- {mytimer-2.1 → mytimer-2.2}/PKG-INFO +26 -5
- {mytimer-2.1 → mytimer-2.2}/README.md +12 -2
- {mytimer-2.1 → mytimer-2.2}/SECURITY.md +2 -2
- {mytimer-2.1 → mytimer-2.2}/dev-requirements.txt +1 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/__main__.py +3 -1
- {mytimer-2.1 → mytimer-2.2}/mytimer/functions.py +43 -26
- {mytimer-2.1 → mytimer-2.2}/mytimer/params.py +13 -10
- {mytimer-2.1 → mytimer-2.2}/mytimer.egg-info/PKG-INFO +26 -5
- {mytimer-2.1 → mytimer-2.2}/mytimer.egg-info/requires.txt +1 -0
- {mytimer-2.1 → mytimer-2.2}/requirements.txt +1 -0
- {mytimer-2.1 → mytimer-2.2}/setup.py +2 -2
- {mytimer-2.1 → mytimer-2.2}/AUTHORS.md +0 -0
- {mytimer-2.1 → mytimer-2.2}/FACES.md +0 -0
- {mytimer-2.1 → mytimer-2.2}/LICENSE +0 -0
- {mytimer-2.1 → mytimer-2.2}/MANIFEST.in +0 -0
- {mytimer-2.1 → mytimer-2.2}/PROGRAMS.md +0 -0
- {mytimer-2.1 → mytimer-2.2}/TONES.md +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/__init__.py +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/1.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/10.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/11.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/12.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/13.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/14.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/15.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/16.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/17.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/18.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/19.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/2.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/20.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/21.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/22.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/23.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/24.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/25.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/26.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/27.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/28.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/29.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/3.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/30.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/31.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/32.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/33.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/34.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/4.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/5.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/6.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/7.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/8.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer/sounds/9.wav +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer.egg-info/SOURCES.txt +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer.egg-info/dependency_links.txt +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer.egg-info/entry_points.txt +0 -0
- {mytimer-2.1 → mytimer-2.2}/mytimer.egg-info/top_level.txt +0 -0
- {mytimer-2.1 → mytimer-2.2}/setup.cfg +0 -0
|
@@ -5,6 +5,15 @@ 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.2] - 2025-03-13
|
|
9
|
+
### Added
|
|
10
|
+
- `--date-system` argument
|
|
11
|
+
### Changed
|
|
12
|
+
- `README.md` updated
|
|
13
|
+
- Test system modified
|
|
14
|
+
- `countdown_timer` and `countup_timer` functions updated
|
|
15
|
+
- String templates modified
|
|
16
|
+
- Input case sensitivity bug fixed
|
|
8
17
|
## [2.1] - 2025-02-28
|
|
9
18
|
### Added
|
|
10
19
|
- 4 new tones
|
|
@@ -209,7 +218,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
209
218
|
- Count-up mode
|
|
210
219
|
- Alarm
|
|
211
220
|
|
|
212
|
-
[Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.
|
|
221
|
+
[Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.2...dev
|
|
222
|
+
[2.2]: https://github.com/sepandhaghighi/mytimer/compare/v2.1...v2.2
|
|
213
223
|
[2.1]: https://github.com/sepandhaghighi/mytimer/compare/v2.0...v2.1
|
|
214
224
|
[2.0]: https://github.com/sepandhaghighi/mytimer/compare/v1.9...v2.0
|
|
215
225
|
[1.9]: https://github.com/sepandhaghighi/mytimer/compare/v1.8...v1.9
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: mytimer
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2
|
|
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.2
|
|
7
7
|
Author: Sepand Haghighi
|
|
8
8
|
Author-email: me@sepand.tech
|
|
9
9
|
License: MIT
|
|
@@ -32,6 +32,7 @@ Description-Content-Type: text/markdown
|
|
|
32
32
|
License-File: LICENSE
|
|
33
33
|
License-File: AUTHORS.md
|
|
34
34
|
Requires-Dist: art>=5.3
|
|
35
|
+
Requires-Dist: jdatetime>=3.8.2
|
|
35
36
|
Requires-Dist: nava>=0.4
|
|
36
37
|
Dynamic: author
|
|
37
38
|
Dynamic: author-email
|
|
@@ -105,13 +106,13 @@ The main objective of <strong>MyTimer</strong> is to offer a minimalistic and di
|
|
|
105
106
|
## Installation
|
|
106
107
|
|
|
107
108
|
### Source Code
|
|
108
|
-
- Download [Version 2.
|
|
109
|
+
- Download [Version 2.2](https://github.com/sepandhaghighi/mytimer/archive/v2.2.zip) or [Latest Source](https://github.com/sepandhaghighi/mytimer/archive/dev.zip)
|
|
109
110
|
- `pip install .`
|
|
110
111
|
|
|
111
112
|
### PyPI
|
|
112
113
|
|
|
113
114
|
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
114
|
-
- `pip install mytimer==2.
|
|
115
|
+
- `pip install mytimer==2.2`
|
|
115
116
|
|
|
116
117
|
|
|
117
118
|
## Usage
|
|
@@ -247,6 +248,16 @@ In this mode, the date/time will not be shown
|
|
|
247
248
|
mytimer --minute=20 --hide-datetime
|
|
248
249
|
```
|
|
249
250
|
|
|
251
|
+
### Date System
|
|
252
|
+
|
|
253
|
+
ℹ️ Valid choices: [`gregorian`, `jalali`]
|
|
254
|
+
|
|
255
|
+
ℹ️ The default date system is `gregorian`
|
|
256
|
+
|
|
257
|
+
```console
|
|
258
|
+
mytimer --minute=20 --date-system=jalali
|
|
259
|
+
```
|
|
260
|
+
|
|
250
261
|
### Vertical Mode
|
|
251
262
|
|
|
252
263
|
```console
|
|
@@ -364,6 +375,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
364
375
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
365
376
|
|
|
366
377
|
## [Unreleased]
|
|
378
|
+
## [2.2] - 2025-03-13
|
|
379
|
+
### Added
|
|
380
|
+
- `--date-system` argument
|
|
381
|
+
### Changed
|
|
382
|
+
- `README.md` updated
|
|
383
|
+
- Test system modified
|
|
384
|
+
- `countdown_timer` and `countup_timer` functions updated
|
|
385
|
+
- String templates modified
|
|
386
|
+
- Input case sensitivity bug fixed
|
|
367
387
|
## [2.1] - 2025-02-28
|
|
368
388
|
### Added
|
|
369
389
|
- 4 new tones
|
|
@@ -568,7 +588,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
568
588
|
- Count-up mode
|
|
569
589
|
- Alarm
|
|
570
590
|
|
|
571
|
-
[Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.
|
|
591
|
+
[Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.2...dev
|
|
592
|
+
[2.2]: https://github.com/sepandhaghighi/mytimer/compare/v2.1...v2.2
|
|
572
593
|
[2.1]: https://github.com/sepandhaghighi/mytimer/compare/v2.0...v2.1
|
|
573
594
|
[2.0]: https://github.com/sepandhaghighi/mytimer/compare/v1.9...v2.0
|
|
574
595
|
[1.9]: https://github.com/sepandhaghighi/mytimer/compare/v1.8...v1.9
|
|
@@ -55,13 +55,13 @@ The main objective of <strong>MyTimer</strong> is to offer a minimalistic and di
|
|
|
55
55
|
## Installation
|
|
56
56
|
|
|
57
57
|
### Source Code
|
|
58
|
-
- Download [Version 2.
|
|
58
|
+
- Download [Version 2.2](https://github.com/sepandhaghighi/mytimer/archive/v2.2.zip) or [Latest Source](https://github.com/sepandhaghighi/mytimer/archive/dev.zip)
|
|
59
59
|
- `pip install .`
|
|
60
60
|
|
|
61
61
|
### PyPI
|
|
62
62
|
|
|
63
63
|
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
64
|
-
- `pip install mytimer==2.
|
|
64
|
+
- `pip install mytimer==2.2`
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
## Usage
|
|
@@ -197,6 +197,16 @@ In this mode, the date/time will not be shown
|
|
|
197
197
|
mytimer --minute=20 --hide-datetime
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
+
### Date System
|
|
201
|
+
|
|
202
|
+
ℹ️ Valid choices: [`gregorian`, `jalali`]
|
|
203
|
+
|
|
204
|
+
ℹ️ The default date system is `gregorian`
|
|
205
|
+
|
|
206
|
+
```console
|
|
207
|
+
mytimer --minute=20 --date-system=jalali
|
|
208
|
+
```
|
|
209
|
+
|
|
200
210
|
### Vertical Mode
|
|
201
211
|
|
|
202
212
|
```console
|
|
@@ -2,6 +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
6
|
from mytimer.functions import run_timer
|
|
6
7
|
import argparse
|
|
7
8
|
|
|
@@ -31,7 +32,7 @@ def main():
|
|
|
31
32
|
parser.add_argument(
|
|
32
33
|
'--program',
|
|
33
34
|
help='program',
|
|
34
|
-
type=str,
|
|
35
|
+
type=str.lower,
|
|
35
36
|
choices=sorted(PROGRAMS_MAP))
|
|
36
37
|
parser.add_argument(
|
|
37
38
|
'--sign',
|
|
@@ -58,6 +59,7 @@ def main():
|
|
|
58
59
|
parser.add_argument('--hide-second', help='hide second', nargs="?", const=1)
|
|
59
60
|
parser.add_argument('--hide-datetime', help='hide datetime', nargs="?", const=1)
|
|
60
61
|
parser.add_argument('--vertical', help='vertical mode', nargs="?", const=1)
|
|
62
|
+
parser.add_argument('--date-system', help='date system', type=str.lower, choices=DATE_SYSTEMS_LIST, default="gregorian")
|
|
61
63
|
parser.add_argument(
|
|
62
64
|
'--programs-list',
|
|
63
65
|
help='programs list',
|
|
@@ -4,6 +4,7 @@ import os
|
|
|
4
4
|
import sys
|
|
5
5
|
import time
|
|
6
6
|
import datetime
|
|
7
|
+
import jdatetime
|
|
7
8
|
import random
|
|
8
9
|
from nava import play
|
|
9
10
|
from mytimer.params import INPUT_ERROR_MESSAGE, SOUND_ERROR_MESSAGE
|
|
@@ -91,9 +92,9 @@ def show_programs_list():
|
|
|
91
92
|
for i, program in enumerate(sorted(PROGRAMS_MAP), 1):
|
|
92
93
|
print(
|
|
93
94
|
PROGRAMS_LIST_TEMPLATE.format(
|
|
94
|
-
i,
|
|
95
|
-
program,
|
|
96
|
-
PROGRAMS_MAP[program]['message']))
|
|
95
|
+
index=i,
|
|
96
|
+
program=program,
|
|
97
|
+
message=PROGRAMS_MAP[program]['message']))
|
|
97
98
|
|
|
98
99
|
|
|
99
100
|
def show_faces_list():
|
|
@@ -172,7 +173,8 @@ def input_handler(func):
|
|
|
172
173
|
sign,
|
|
173
174
|
hide_second,
|
|
174
175
|
hide_datetime,
|
|
175
|
-
vertical
|
|
176
|
+
vertical,
|
|
177
|
+
date_system):
|
|
176
178
|
"""
|
|
177
179
|
Inner function.
|
|
178
180
|
|
|
@@ -204,11 +206,13 @@ def input_handler(func):
|
|
|
204
206
|
:type hide_datetime: bool
|
|
205
207
|
:param vertical: vertical mode flag
|
|
206
208
|
:type vertical: bool
|
|
209
|
+
:param date_system: date system
|
|
210
|
+
:type date_system: str
|
|
207
211
|
:return: None
|
|
208
212
|
"""
|
|
209
213
|
message = message.strip()
|
|
210
214
|
if len(message) > 0:
|
|
211
|
-
message = MESSAGE_TEMPLATE.format(message)
|
|
215
|
+
message = MESSAGE_TEMPLATE.format(message=message)
|
|
212
216
|
if alarm_repeat < 1:
|
|
213
217
|
alarm_repeat = DEFAULT_PARAMS["alarm_repeat"]
|
|
214
218
|
if h_shift < 0:
|
|
@@ -237,7 +241,8 @@ def input_handler(func):
|
|
|
237
241
|
sign,
|
|
238
242
|
hide_second,
|
|
239
243
|
hide_datetime,
|
|
240
|
-
vertical
|
|
244
|
+
vertical,
|
|
245
|
+
date_system)
|
|
241
246
|
else:
|
|
242
247
|
print(INPUT_ERROR_MESSAGE)
|
|
243
248
|
print(INPUT_EXAMPLE)
|
|
@@ -343,15 +348,20 @@ def test_tone(tone, repeat):
|
|
|
343
348
|
print("Duration: {duration} s".format(duration=duration))
|
|
344
349
|
|
|
345
350
|
|
|
346
|
-
def print_date_time(h_shift):
|
|
351
|
+
def print_date_time(h_shift, date_system):
|
|
347
352
|
"""
|
|
348
353
|
Print date and time.
|
|
349
354
|
|
|
350
355
|
:param h_shift: horizontal shift
|
|
351
356
|
:type h_shift: int
|
|
357
|
+
:param date_system: date system
|
|
358
|
+
:type date_system: str
|
|
352
359
|
:return: None
|
|
353
360
|
"""
|
|
354
|
-
|
|
361
|
+
datetime_lib = datetime
|
|
362
|
+
if date_system == "jalali":
|
|
363
|
+
datetime_lib = jdatetime
|
|
364
|
+
datetime_now = datetime_lib.datetime.now()
|
|
355
365
|
current_time = datetime_now.strftime(CLOCK_FORMAT)
|
|
356
366
|
current_date = datetime_now.strftime(DATE_FORMAT)
|
|
357
367
|
print(" " * h_shift, end='')
|
|
@@ -377,7 +387,8 @@ def countup_timer(
|
|
|
377
387
|
sign=DEFAULT_PARAMS["sign"],
|
|
378
388
|
hide_second=DEFAULT_PARAMS["hide_second"],
|
|
379
389
|
hide_datetime=DEFAULT_PARAMS["hide_datetime"],
|
|
380
|
-
vertical=DEFAULT_PARAMS["vertical"]
|
|
390
|
+
vertical=DEFAULT_PARAMS["vertical"],
|
|
391
|
+
date_system=DEFAULT_PARAMS["date_system"]):
|
|
381
392
|
"""
|
|
382
393
|
Count-up timer function.
|
|
383
394
|
|
|
@@ -409,6 +420,8 @@ def countup_timer(
|
|
|
409
420
|
:type hide_datetime: bool
|
|
410
421
|
:param vertical: vertical mode flag
|
|
411
422
|
:type vertical: bool
|
|
423
|
+
:param date_system: date system
|
|
424
|
+
:type date_system: str
|
|
412
425
|
:return: None
|
|
413
426
|
"""
|
|
414
427
|
timer_second = 0
|
|
@@ -423,12 +436,12 @@ def countup_timer(
|
|
|
423
436
|
clear_screen()
|
|
424
437
|
print('\n' * v_shift, end='')
|
|
425
438
|
print(" " * h_shift, end='')
|
|
426
|
-
timer_params =
|
|
439
|
+
timer_params = {"sign": sign, "hour": timer_hour, "minute": timer_minute, "second": timer_second}
|
|
427
440
|
if hide_second:
|
|
428
|
-
|
|
429
|
-
tprint(timer_template.format(
|
|
441
|
+
del timer_params["second"]
|
|
442
|
+
tprint(timer_template.format(**timer_params), font=face, sep="\n" + " " * h_shift)
|
|
430
443
|
if not hide_datetime:
|
|
431
|
-
print_date_time(h_shift)
|
|
444
|
+
print_date_time(h_shift, date_system)
|
|
432
445
|
print(message)
|
|
433
446
|
if timer_hour == hour and timer_minute == minute and timer_second == second:
|
|
434
447
|
print(" " * h_shift, end='')
|
|
@@ -462,7 +475,8 @@ def countdown_timer(
|
|
|
462
475
|
sign=DEFAULT_PARAMS["sign"],
|
|
463
476
|
hide_second=DEFAULT_PARAMS["hide_second"],
|
|
464
477
|
hide_datetime=DEFAULT_PARAMS["hide_datetime"],
|
|
465
|
-
vertical=DEFAULT_PARAMS["vertical"]
|
|
478
|
+
vertical=DEFAULT_PARAMS["vertical"],
|
|
479
|
+
date_system=DEFAULT_PARAMS["date_system"]):
|
|
466
480
|
"""
|
|
467
481
|
Countdown timer function.
|
|
468
482
|
|
|
@@ -494,6 +508,8 @@ def countdown_timer(
|
|
|
494
508
|
:type hide_datetime: bool
|
|
495
509
|
:param vertical: vertical mode flag
|
|
496
510
|
:type vertical: bool
|
|
511
|
+
:param date_system: date system
|
|
512
|
+
:type date_system: str
|
|
497
513
|
:return: None
|
|
498
514
|
"""
|
|
499
515
|
face = get_face(face)
|
|
@@ -505,12 +521,12 @@ def countdown_timer(
|
|
|
505
521
|
clear_screen()
|
|
506
522
|
print('\n' * v_shift, end='')
|
|
507
523
|
print(" " * h_shift, end='')
|
|
508
|
-
timer_params =
|
|
524
|
+
timer_params = {"sign": sign, "hour": hour, "minute": minute, "second": second}
|
|
509
525
|
if hide_second:
|
|
510
|
-
|
|
511
|
-
tprint(timer_template.format(
|
|
526
|
+
del timer_params["second"]
|
|
527
|
+
tprint(timer_template.format(**timer_params), font=face, sep="\n" + " " * h_shift)
|
|
512
528
|
if not hide_datetime:
|
|
513
|
-
print_date_time(h_shift)
|
|
529
|
+
print_date_time(h_shift, date_system)
|
|
514
530
|
print(message)
|
|
515
531
|
second -= 1
|
|
516
532
|
if second == -1:
|
|
@@ -546,15 +562,15 @@ def pomodoro_timer(timer_func, params, long_break_params, short_break_params):
|
|
|
546
562
|
h_shift = params["h_shift"]
|
|
547
563
|
for index in range(4):
|
|
548
564
|
work_params = params.copy()
|
|
549
|
-
work_params["message"] += " {
|
|
565
|
+
work_params["message"] += " {round}/{repeat}".format(round=index + 1, repeat=4)
|
|
550
566
|
timer_func(**work_params)
|
|
551
567
|
if index == 3:
|
|
552
568
|
break
|
|
553
|
-
print_message(message=NEXT_PROGRAM_MESSAGE.format("Short break"), h_shift=h_shift, confirm=True)
|
|
569
|
+
print_message(message=NEXT_PROGRAM_MESSAGE.format(next_program="Short break"), h_shift=h_shift, confirm=True)
|
|
554
570
|
timer_func(**short_break_params)
|
|
555
571
|
print_message(message=NEXT_PROGRAM_MESSAGE.format(
|
|
556
|
-
"Work {
|
|
557
|
-
print_message(message=NEXT_PROGRAM_MESSAGE.format("Long break"), h_shift=h_shift, confirm=True)
|
|
572
|
+
next_program="Work {round}/{repeat}".format(round=index + 2, repeat=4)), h_shift=h_shift, confirm=True)
|
|
573
|
+
print_message(message=NEXT_PROGRAM_MESSAGE.format(next_program="Long break"), h_shift=h_shift, confirm=True)
|
|
558
574
|
timer_func(**long_break_params)
|
|
559
575
|
|
|
560
576
|
|
|
@@ -572,7 +588,7 @@ def two_step_timer(timer_func, params1, params2):
|
|
|
572
588
|
"""
|
|
573
589
|
h_shift = params1["h_shift"]
|
|
574
590
|
timer_func(**params1)
|
|
575
|
-
print_message(message=NEXT_PROGRAM_MESSAGE.format("Break"), h_shift=h_shift, confirm=True)
|
|
591
|
+
print_message(message=NEXT_PROGRAM_MESSAGE.format(next_program="Break"), h_shift=h_shift, confirm=True)
|
|
576
592
|
timer_func(**params2)
|
|
577
593
|
|
|
578
594
|
|
|
@@ -602,7 +618,7 @@ def update_set_on_params(params):
|
|
|
602
618
|
:return: timer params as dict
|
|
603
619
|
"""
|
|
604
620
|
if params["message"] == "":
|
|
605
|
-
params["message"] = SET_ON_MESSAGE.format(params["hour"], params["minute"], params["second"])
|
|
621
|
+
params["message"] = SET_ON_MESSAGE.format(hour=params["hour"], minute=params["minute"], second=params["second"])
|
|
606
622
|
time_now = datetime.datetime.now()
|
|
607
623
|
time_then = datetime.datetime(
|
|
608
624
|
time_now.year,
|
|
@@ -680,9 +696,10 @@ def run_timer(args):
|
|
|
680
696
|
two_step_timer(timer_func, params1=params, params2=break_params)
|
|
681
697
|
else:
|
|
682
698
|
timer_func(**params)
|
|
683
|
-
end_round_message = END_ROUND_MESSAGE.format(
|
|
699
|
+
end_round_message = END_ROUND_MESSAGE.format(
|
|
700
|
+
round="{round}/{repeat}".format(round=timer_round, repeat=args.repeat))
|
|
684
701
|
if args.repeat == -1:
|
|
685
|
-
end_round_message = END_ROUND_MESSAGE.format(timer_round)
|
|
702
|
+
end_round_message = END_ROUND_MESSAGE.format(round=timer_round)
|
|
686
703
|
if timer_round < args.repeat or args.repeat == -1:
|
|
687
704
|
print_message(
|
|
688
705
|
message=end_round_message,
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
"""mytimer params."""
|
|
3
3
|
|
|
4
|
-
MY_TIMER_VERSION = "2.
|
|
4
|
+
MY_TIMER_VERSION = "2.2"
|
|
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"
|
|
8
8
|
EXIT_MESSAGE = "See you. Bye!"
|
|
9
|
-
END_ROUND_MESSAGE = "Round {
|
|
10
|
-
NEXT_PROGRAM_MESSAGE = "Press `Enter` to continue (Next: {
|
|
11
|
-
PROGRAMS_LIST_TEMPLATE = "{
|
|
12
|
-
TIME_HMS_TEMPLATE_HORIZONTAL = "{
|
|
13
|
-
TIME_HM_TEMPLATE_HORIZONTAL = "{
|
|
14
|
-
TIME_HMS_TEMPLATE_VERTICAL = "{
|
|
15
|
-
TIME_HM_TEMPLATE_VERTICAL = "{
|
|
9
|
+
END_ROUND_MESSAGE = "Round {round} done! Press `Enter` to continue..."
|
|
10
|
+
NEXT_PROGRAM_MESSAGE = "Press `Enter` to continue (Next: {next_program})"
|
|
11
|
+
PROGRAMS_LIST_TEMPLATE = "{index}. `{program}` - {message}"
|
|
12
|
+
TIME_HMS_TEMPLATE_HORIZONTAL = "{sign}{hour:02} : {minute:02} : {second:02}"
|
|
13
|
+
TIME_HM_TEMPLATE_HORIZONTAL = "{sign}{hour:02} : {minute:02}"
|
|
14
|
+
TIME_HMS_TEMPLATE_VERTICAL = "{sign}\n{hour:02}\n{minute:02}\n{second:02}"
|
|
15
|
+
TIME_HM_TEMPLATE_VERTICAL = "{sign}\n{hour:02}\n{minute:02}"
|
|
16
16
|
FACES_LIST_EXAMPLE_MESSAGE = "12 : 34 : 56"
|
|
17
17
|
INPUT_EXAMPLE = "Example: mytimer --hour=1 --minute=1 --second=1"
|
|
18
18
|
TIME_ELEMENTS = ["minute", "second", "hour"]
|
|
19
|
-
MESSAGE_TEMPLATE = "Message: {
|
|
19
|
+
MESSAGE_TEMPLATE = "Message: {message}"
|
|
20
20
|
KEEP_ON_MESSAGE = " **Timeout!"
|
|
21
|
-
SET_ON_MESSAGE = "Timer set for {
|
|
21
|
+
SET_ON_MESSAGE = "Timer set for {hour:02d}:{minute:02d}:{second:02d}"
|
|
22
22
|
DATE_FORMAT = "%A, %B %d, %Y"
|
|
23
23
|
CLOCK_FORMAT = "%H:%M %p"
|
|
24
24
|
KEEP_ON_MAX = 10000000
|
|
@@ -106,6 +106,7 @@ DEFAULT_PARAMS = {
|
|
|
106
106
|
"alarm": 0,
|
|
107
107
|
"hide_second": 0,
|
|
108
108
|
"hide_datetime": 0,
|
|
109
|
+
"date_system": "gregorian",
|
|
109
110
|
"vertical": 0,
|
|
110
111
|
"alarm_repeat": 1,
|
|
111
112
|
"face": 1,
|
|
@@ -344,3 +345,5 @@ BREAKS_MAP = {
|
|
|
344
345
|
FACES_LIST = [-1] + sorted(FACES_MAP)
|
|
345
346
|
|
|
346
347
|
TONES_LIST = [-1] + sorted(TONES_MAP)
|
|
348
|
+
|
|
349
|
+
DATE_SYSTEMS_LIST = ["gregorian", "jalali"]
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: mytimer
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2
|
|
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.2
|
|
7
7
|
Author: Sepand Haghighi
|
|
8
8
|
Author-email: me@sepand.tech
|
|
9
9
|
License: MIT
|
|
@@ -32,6 +32,7 @@ Description-Content-Type: text/markdown
|
|
|
32
32
|
License-File: LICENSE
|
|
33
33
|
License-File: AUTHORS.md
|
|
34
34
|
Requires-Dist: art>=5.3
|
|
35
|
+
Requires-Dist: jdatetime>=3.8.2
|
|
35
36
|
Requires-Dist: nava>=0.4
|
|
36
37
|
Dynamic: author
|
|
37
38
|
Dynamic: author-email
|
|
@@ -105,13 +106,13 @@ The main objective of <strong>MyTimer</strong> is to offer a minimalistic and di
|
|
|
105
106
|
## Installation
|
|
106
107
|
|
|
107
108
|
### Source Code
|
|
108
|
-
- Download [Version 2.
|
|
109
|
+
- Download [Version 2.2](https://github.com/sepandhaghighi/mytimer/archive/v2.2.zip) or [Latest Source](https://github.com/sepandhaghighi/mytimer/archive/dev.zip)
|
|
109
110
|
- `pip install .`
|
|
110
111
|
|
|
111
112
|
### PyPI
|
|
112
113
|
|
|
113
114
|
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
114
|
-
- `pip install mytimer==2.
|
|
115
|
+
- `pip install mytimer==2.2`
|
|
115
116
|
|
|
116
117
|
|
|
117
118
|
## Usage
|
|
@@ -247,6 +248,16 @@ In this mode, the date/time will not be shown
|
|
|
247
248
|
mytimer --minute=20 --hide-datetime
|
|
248
249
|
```
|
|
249
250
|
|
|
251
|
+
### Date System
|
|
252
|
+
|
|
253
|
+
ℹ️ Valid choices: [`gregorian`, `jalali`]
|
|
254
|
+
|
|
255
|
+
ℹ️ The default date system is `gregorian`
|
|
256
|
+
|
|
257
|
+
```console
|
|
258
|
+
mytimer --minute=20 --date-system=jalali
|
|
259
|
+
```
|
|
260
|
+
|
|
250
261
|
### Vertical Mode
|
|
251
262
|
|
|
252
263
|
```console
|
|
@@ -364,6 +375,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
364
375
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
365
376
|
|
|
366
377
|
## [Unreleased]
|
|
378
|
+
## [2.2] - 2025-03-13
|
|
379
|
+
### Added
|
|
380
|
+
- `--date-system` argument
|
|
381
|
+
### Changed
|
|
382
|
+
- `README.md` updated
|
|
383
|
+
- Test system modified
|
|
384
|
+
- `countdown_timer` and `countup_timer` functions updated
|
|
385
|
+
- String templates modified
|
|
386
|
+
- Input case sensitivity bug fixed
|
|
367
387
|
## [2.1] - 2025-02-28
|
|
368
388
|
### Added
|
|
369
389
|
- 4 new tones
|
|
@@ -568,7 +588,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
568
588
|
- Count-up mode
|
|
569
589
|
- Alarm
|
|
570
590
|
|
|
571
|
-
[Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.
|
|
591
|
+
[Unreleased]: https://github.com/sepandhaghighi/mytimer/compare/v2.2...dev
|
|
592
|
+
[2.2]: https://github.com/sepandhaghighi/mytimer/compare/v2.1...v2.2
|
|
572
593
|
[2.1]: https://github.com/sepandhaghighi/mytimer/compare/v2.0...v2.1
|
|
573
594
|
[2.0]: https://github.com/sepandhaghighi/mytimer/compare/v1.9...v2.0
|
|
574
595
|
[1.9]: https://github.com/sepandhaghighi/mytimer/compare/v1.8...v1.9
|
|
@@ -29,7 +29,7 @@ def read_description():
|
|
|
29
29
|
setup(
|
|
30
30
|
name='mytimer',
|
|
31
31
|
packages=['mytimer'],
|
|
32
|
-
version='2.
|
|
32
|
+
version='2.2',
|
|
33
33
|
description='A Geeky Timer for Terminal Enthusiasts',
|
|
34
34
|
long_description=read_description(),
|
|
35
35
|
long_description_content_type='text/markdown',
|
|
@@ -37,7 +37,7 @@ setup(
|
|
|
37
37
|
author='Sepand Haghighi',
|
|
38
38
|
author_email='me@sepand.tech',
|
|
39
39
|
url='https://github.com/sepandhaghighi/mytimer',
|
|
40
|
-
download_url='https://github.com/sepandhaghighi/mytimer/tarball/v2.
|
|
40
|
+
download_url='https://github.com/sepandhaghighi/mytimer/tarball/v2.2',
|
|
41
41
|
keywords="timer time clock terminal stopwatch cli geek",
|
|
42
42
|
project_urls={
|
|
43
43
|
'Source': 'https://github.com/sepandhaghighi/mytimer'
|
|
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
|