Stopwatch¶
Bases: Model
Stopwatch Model
Note
The stopwatch model is not a regular interface and instead is dynamically generated on
Access through the Card
.stopwatch
attribute. There is an override that intercepts
__getitem__
to return a Stopwatch
.
All Stopwatch
methods directly update the .stopwatch
attribute of the linked Card
instance.
Attributes:
Name | Type | Description |
---|---|---|
startedAt |
datetime
|
The start date of the stopwatch |
total |
int
|
The total time of the stopwatch (in seconds) |
_card |
Card
|
The card the stopwatch is associated with (Managed by the |
Source code in src/plankapy/models.py
621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 |
|
set(hours=0, minutes=0, seconds=0)
¶
Set an amount of time for the stopwatch
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hours
|
int
|
Hours to set |
0
|
minutes
|
int
|
Minutes to set |
0
|
seconds
|
int
|
Seconds to set |
0
|
Source code in src/plankapy/models.py
674 675 676 677 678 679 680 681 682 683 684 |
|
start()
¶
Starts the stopwatch
Source code in src/plankapy/models.py
652 653 654 655 656 657 658 659 |
|
start_time()
¶
Returns the datetime the stopwatch was started
Source code in src/plankapy/models.py
647 648 649 650 |
|
stop()
¶
Stops the stopwatch
Source code in src/plankapy/models.py
661 662 663 664 665 666 667 668 669 670 671 672 |
|