\L i+pddlmZmZddlmZmZddlmZddlm Z ddl m Z m Z m Z mZmZmZGddZy) )IterableMapping)isclassismethod)uuid4) BaseTrigger)check_callable_argsconvert_to_datetime datetime_reprget_callable_name obj_to_ref ref_to_objceZdZdZdZdfd ZdZdZdZdZ dZ e d Z d Z d Zd Zd ZdZdZdZxZS)Joba Contains the options given when scheduling callables and its current schedule and other state. This class should never be instantiated by the user. :var str id: the unique identifier of this job :var str name: the description of this job :var func: the callable to execute :var tuple|list args: positional arguments to the callable :var dict kwargs: keyword arguments to the callable :var bool coalesce: whether to only run the job once when several run times are due :var trigger: the trigger object that controls the schedule of this job :var str executor: the name of the executor that will run this job :var int misfire_grace_time: the time (in seconds) how much this job's execution is allowed to be late (``None`` means "allow the job to run no matter how late it is") :var int max_instances: the maximum number of concurrently executing instances allowed for this job :var datetime.datetime next_run_time: the next scheduled run time of this job .. note:: The ``misfire_grace_time`` has some non-obvious effects on job execution. See the :ref:`missed-job-executions` section in the documentation for an in-depth explanation. ) _scheduler_jobstore_aliasidtriggerexecutorfuncfunc_refargskwargsnamemisfire_grace_timecoalesce max_instances next_run_time __weakref__c t|||_d|_|jdd|xst j i|y)Nr)super__init__rr_modifyrhex)self schedulerrr __class__s U/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/apscheduler/job.pyr#z Job.__init__:s> ## 4)egkk4V4c j|jj|j|jfi||S)a- Makes the given changes to this job and saves it in the associated job store. Accepted keyword arguments are the same as the variables on this class. .. seealso:: :meth:`~apscheduler.schedulers.base.BaseScheduler.modify_job` :return Job: this job instance )r modify_jobrr)r&changess r)modifyz Job.modify@s. #""477D,@,@LGL r*c l|jj|j|j|fi||S)z Shortcut for switching the trigger on this job. .. seealso:: :meth:`~apscheduler.schedulers.base.BaseScheduler.reschedule_job` :return Job: this job instance )rreschedule_jobrr)r&r trigger_argss r) reschedulezJob.rescheduleNs8 '&& GGT))7 6B  r*cf|jj|j|j|S)z Temporarily suspend the execution of this job. .. seealso:: :meth:`~apscheduler.schedulers.base.BaseScheduler.pause_job` :return Job: this job instance )r pause_jobrrr&s r)pausez Job.pause\s' !!$''4+?+?@ r*cf|jj|j|j|S)z Resume the schedule of this job if previously paused. .. seealso:: :meth:`~apscheduler.schedulers.base.BaseScheduler.resume_job` :return Job: this job instance )r resume_jobrrr5s r)resumez Job.resumehs' ""477D,@,@A r*cd|jj|j|jy)z Unschedules this job and removes it from its associated job store. .. seealso:: :meth:`~apscheduler.schedulers.base.BaseScheduler.remove_job` N)r remove_jobrrr5s r)removez Job.removets" ""477D,@,@Ar*c|jduS)z{ Returns ``True`` if the referenced job is still waiting to be added to its designated job store. N)rr5s r)pendingz Job.pending}s##t++r*cg}|j}|r:||kr5|j||jj||}|r||kr5|S)z Computes the scheduled run times between ``next_run_time`` and ``now`` (inclusive). :type now: datetime.datetime :rtype: list[datetime.datetime] )rappendrget_next_fire_time)r&now run_timesrs r)_get_run_timeszJob._get_run_timessV **   4   ] + LL;;M3OM  4r*c "i}d|vrH|jd}t|ts tdt |dr t d||d<d|vs d|vsd|vrGd|vr|jdn |j }d|vr|jdn |j}d|vr|jdn |j}t|tr|}t|}n#t|r t|}n tdt |d s |jd dt||d <t|tst|ts td t|tst|ts td t!|||||d<||d <||d<||d<d |vr3|jd }|rt|ts td ||d <d|vr8|jd}| t|t"r|dkr td||d<d|vrt%|jd}||d<d|vr6|jd}t|t"r|dkr td||d<d|vrI|jd}t|t&s#td|j(j*d||d<d|vr1|jd}t|ts td||d<d|vr5|jd}t-||j.j0d|d<|r)t3dj5dj7||j9D]\} }t;|| |y#t $rd}YwxYw)z| Validates the changes to the Job and makes the modifications if and only if all of them validate. rzid must be a nonempty stringzThe job ID may not be changedrrrNz5func must be a callable or a textual reference to onerz"args must be a non-string iterablez!kwargs must be a dict-like objectrzname must be a nonempty stringrrz??tT" !@AA"HTN W ' 1X5H*0G*;7;;v&D*0G*;7;;v&D.6'.AW[[*t{{F$$!$'$$)$/H  WXX4(W[[-F-N"3D"9$$JtX,F DEE&#&j.I CDD dF 3#HV #+HZ #HV !'HX  W KK'E 5# 6 @AA$HV  7 *KK 45E *UC*@EQJR.3H) *  Z01E#(HZ g %KK0EeS)UaZ JKK(-H_ %  kk),Gg{378I8I8R8R7SS[\#*HY   KK +EeS) ;<<#(HZ g %KK0E(;t//)H_ %  HOOIIg&  #..* &JC D#u % &S"$#H$s) M?? N Nc |jstd|jd|j}t|rQt |j s)rrr5s r)__repr__z Job.__repr__=s477)6$))B77r*ct|dr'|jrdt|jznd}nd}|jd|jd|dS)Nrz next run at: pausedr>z (trigger: rF))rKrr rr)r&statuss r)__str__z Job.__str__@s\ 4 )%% -0B0B"CC  F))K ~RxqAAr*re)rQ __module__ __qualname____doc__ __slots__r#r.r2r6r9r<propertyr>rDr$r`rcrhrjro __classcell__)r(s@r)rrsi.I$5    B,, e&N" H4& 8 Br*rN)collections.abcrrinspectrruuidrapscheduler.triggers.baserapscheduler.utilr r r r r rrr!r*r)r{s)-%1zBzBr*