
    Cj                        S SK Jr  S SKJr  S SKJr  S SKr\R                  R                  SS9 " S S5      5       r
 " S	 S
\
5      rg)    )annotations)	monotonic)CallableNT)angularc                  \    \ rS rSrSr\S.SS jjrSS jrSS jrSS jr	\
SS j5       rS	rg
)Clock	   zAn object to get relative time.

The `time` attribute of clock will return the time in seconds since the
Clock was created or reset.

get_timec               :    Xl         U R                  5       U l        g)zCreate a clock.

Args:
    get_time: A callable to get time in seconds.
    start: Start the clock (time is 0 unless clock has been started).
N	_get_time_start_time)selfr   s     _/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/textual/clock.py__init__Clock.__init__   s     ">>+    c              #  (   #    U R                   v   g 7fN)timer   s    r   __rich_repr__Clock.__rich_repr__   s     iis   c                (    [        U R                  S9$ )z)Clone the Clock with an independent time.r
   )r   r   r   s    r   cloneClock.clone   s    dnn--r   c                .    U R                  5       U l        g)zReset the clock.Nr   r   s    r   resetClock.reset#   s    >>+r   c                <    U R                  5       U R                  -
  $ zTime since creation or reset.r   r   s    r   r   
Clock.time'   s     ~~$"2"222r   r   N)r   zCallable[[], float]returnNone)r$   zrich.repr.Result)r$   r   r$   r%   r$   float)__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   propertyr   __static_attributes__ r   r   r   r   	   s5     ;D ,., 3 3r   r   c                  f   ^  \ rS rSrSrS	S
U 4S jjjrSS jrSS jrS
S jr\	SS j5       r
SrU =r$ )	MockClock-   z9A mock clock object where the time may be explicitly set.c                8   >^  UT l         [        TT ]	  U 4S jS9  g)zConstruct a mock clock.c                    > T R                   $ r   _timer   s   r   <lambda>$MockClock.__init__.<locals>.<lambda>3   s	    $**r   r
   N)r7   superr   )r   r   	__class__s   ` r   r   MockClock.__init__0   s    
"45r   c                t    [        U R                  5      nU R                  Ul        U R                  Ul        U$ )zEClone the mocked clock (clone will return the same time as original).)r2   r7   r   )r   clocks     r   r   MockClock.clone5   s+    $**%..jjr   c                    g)z@A null-op because it doesn't make sense to reset a mocked clock.Nr0   r   s    r   r   MockClock.reset<   s    r   c                    Xl         g)z:Set the time for the clock.

Args:
    time: Time to set.
Nr6   )r   r   s     r   set_timeMockClock.set_time?   s	     
r   c                "    U R                  5       $ r"   )r   r   s    r   r   MockClock.timeG   s     ~~r   r6   )g        )r   r(   r$   r%   )r$   r2   r&   r'   )r)   r*   r+   r,   r-   r   r   r   rC   r.   r   r/   __classcell__)r;   s   @r   r2   r2   -   s4    C6 6
O    r   r2   )
__future__r   r   r   typingr   	rich.reprrichreprautor   r2   r0   r   r   <module>rN      sF    "     3  3  3F   r   