| Server IP : 198.38.94.13 / Your IP : 216.73.217.33 Web Server : Apache System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : revivere ( 1140) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /opt/saltstack/salt/lib/python3.10/site-packages/tempora/__pycache__/ |
Upload File : |
o
;jv � @ s� d Z ddlZddlZddlZddlZddlZdd� Zdd� ZG dd� dej�ZG d d
� d
e�Z G dd� de �Z
G d
d� d�ZG dd� de�ZG dd� de�Z
dS )a�
Classes for calling functions a schedule. Has time zone support.
For example, to run a job at 08:00 every morning in 'Asia/Calcutta':
>>> job = lambda: print("time is now", datetime.datetime())
>>> time = datetime.time(8, tzinfo=pytz.timezone('Asia/Calcutta'))
>>> cmd = PeriodicCommandFixedDelay.daily_at(time, job)
>>> sched = InvokeScheduler()
>>> sched.add(cmd)
>>> while True: # doctest: +SKIP
... sched.run_pending()
... time.sleep(.1)
� Nc C s t j �tj�S )u�
Provide the current timezone-aware datetime.
A client may override this function to change the default behavior,
such as to use local time or timezone-naïve times.
)�datetime�now�pytz�utc� r r �D/opt/saltstack/salt/lib/python3.10/site-packages/tempora/schedule.pyr s r c C s t j �| tj�S )u�
Convert a numeric timestamp to a timezone-aware datetime.
A client may override this function to change the default behavior,
such as to use local time or timezone-naïve times.
)r �
fromtimestampr r )�tsr r r �from_timestamp"