
    Ti+                         S SK JrJr  S SKJr  S SKJrJr  S SKJ	r	  S SK
Jr  S SKJrJrJrJrJrJr  \R&                  r " S S5      rg	)
    )IterableMapping)timezone)isclassismethod)uuid4)BaseTrigger)check_callable_argsconvert_to_datetimedatetime_reprget_callable_name
obj_to_ref
ref_to_objc                      ^  \ rS rSrSrSrSU 4S jjrS rS rS r	S r
S	 r\S
 5       rS rS rS rS rS rS rS rSrU =r$ )Job   a  
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.
)__weakref___jobstore_alias
_schedulerargscoalesceexecutorfuncfunc_refidkwargsmax_instancesmisfire_grace_timenamenext_run_timetriggerc                    > [         TU ]  5         Xl        S U l        U R                  " SSU=(       d    [        5       R                  0UD6  g )Nr    )super__init__r   r   _modifyr   hex)self	schedulerr   r   	__class__s       a/var/www/html/backend/Backoffice_Marketplace/venv/lib/python3.13/site-packages/apscheduler/job.pyr%   Job.__init__=   s:    ##4)egkk4V4    c                 j    U R                   R                  " U R                  U R                  40 UD6  U $ )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_jobr   r   )r(   changess     r+   modify
Job.modifyC   s,     	""477D,@,@LGLr-   c                 l    U R                   R                  " U R                  U R                  U40 UD6  U $ )z
Shortcut for switching the trigger on this job.

.. seealso:: :meth:`~apscheduler.schedulers.base.BaseScheduler.reschedule_job`

:return Job: this job instance

)r   reschedule_jobr   r   )r(   r!   trigger_argss      r+   
rescheduleJob.rescheduleQ   s6     	&&GGT))7	
6B	
 r-   c                 f    U R                   R                  U R                  U R                  5        U $ )z
Temporarily suspend the execution of this job.

.. seealso:: :meth:`~apscheduler.schedulers.base.BaseScheduler.pause_job`

:return Job: this job instance

)r   	pause_jobr   r   r(   s    r+   pause	Job.pause_   s'     	!!$''4+?+?@r-   c                 f    U R                   R                  U R                  U R                  5        U $ )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_jobr   r   r:   s    r+   resume
Job.resumek   s'     	""477D,@,@Ar-   c                 d    U R                   R                  U R                  U R                  5        g)z
Unschedules this job and removes it from its associated job store.

.. seealso:: :meth:`~apscheduler.schedulers.base.BaseScheduler.remove_job`

N)r   
remove_jobr   r   r:   s    r+   remove
Job.removew   s"     	""477D,@,@Ar-   c                     U R                   SL $ )zc
Returns ``True`` if the referenced job is still waiting to be added to its designated job
store.

N)r   r:   s    r+   pendingJob.pending   s     ##t++r-   c                 J   / nU R                   nU(       a  UR                  [        5      UR                  [        5      ::  aa  UR                  U5        U R                  R                  X15      nU(       a.  UR                  [        5      UR                  [        5      ::  a  Ma  U$ )z
Computes the scheduled run times between ``next_run_time`` and ``now`` (inclusive).

:type now: datetime.datetime
:rtype: list[datetime.datetime]

)r    
astimezoneUTCappendr!   get_next_fire_time)r(   now	run_timesr    s       r+   _get_run_timesJob._get_run_times   s~     	** 8 8 =PSAT T]+ LL;;MOM  8 8 =PSAT T r-   c                    0 nSU;   aQ  UR                  S5      n[        U[        5      (       d  [        S5      e[	        U S5      (       a  [        S5      eX2S'   SU;   d  SU;   d  SU;   Gal  SU;   a  UR                  S5      OU R                  nSU;   a  UR                  S5      OU R                  nSU;   a  UR                  S5      OU R                  n[        U[        5      (       a  Un[        U5      nO([        U5      (       a   [        U5      nO[        S5      e[	        U S	5      (       d!  UR                  S	S5      c  [        U5      US	'   [        U[        5      (       d  [        U[        5      (       d  [        S
5      e[        U[        5      (       d  [        U[        5      (       d  [        S5      e[!        XEU5        XBS'   XrS'   XRS'   XbS'   S	U;   a<  UR                  S	5      nU(       a  [        U[        5      (       d  [        S5      eX2S	'   SU;   a>  UR                  S5      nUb&  [        U["        5      (       a  US::  a  [        S5      eX2S'   SU;   a  [%        UR                  S5      5      nX2S'   SU;   a;  UR                  S5      n[        U["        5      (       a  US::  a  [        S5      eX2S'   SU;   aM  UR                  S5      n[        U[&        5      (       d#  [        SUR(                  R*                   S35      eXS'   SU;   a5  UR                  S5      n[        U[        5      (       d  [        S5      eX2S'   SU;   a4  UR                  S5      n[-        X0R.                  R0                  S5      US'   U(       a)  [3        SR5                  SR7                  U5      5      5      eUR9                  5        H  u  p[;        X	U5        M     g! [
         a    Sn GNf = f)zd
Validates the changes to the Job and makes the modifications if and only if all of them
validate.

r   zid must be a nonempty stringzThe job ID may not be changedr   r   r   Nz5func must be a callable or a textual reference to oner   z"args must be a non-string iterablez!kwargs must be a dict-like objectr   zname must be a nonempty stringr   r   z<misfire_grace_time must be either None or a positive integerr   r   z(max_instances must be a positive integerr!   z!Expected a trigger instance, got z insteadr   zexecutor must be a stringr    z6The following are not modifiable attributes of Job: {}, )pop
isinstancestr	TypeErrorhasattr
ValueErrorr   r   r   r   callabler   getr   r   r   r
   intboolr	   r*   __name__r   r   r   AttributeErrorformatjoinitemssetattr)
r(   r0   approvedvaluer   r   r   r   r!   keys
             r+   r&   Job._modify   s    7?KK%EeS)) >??tT"" !@AA"TNW' 1X5H*0G*;7;;v&D*0G*;7;;v&D.6'.AW[[*t{{F$$$!$'$$)$/H
   WXX4((W[[-F-N"3D"9$$$JtX,F,F DEE&#&&j.I.I CDDF3#V#+Z #V!'XWKK'E
5# 6 6 @AA$V7*KK 45E *UC*@*@EQJR  .3)* Z01E#(Z g%KK0EeS))UaZ JKK(-_%kk),Gg{3378I8I8R8R7SS[\  #*Y KK
+EeS)) ;<<#(Z g%KK0E(;//)H_%  HOOIIg&  #..*JCDu% +S " $#H$s   
O" "O21O2c                 <   U R                   (       d  [        SU R                  < S35      eU R                  n[        U5      (       aW  [	        UR
                  5      (       d=  [        U5      U R                   :X  a$  UR
                  4[        U R                  5      -   nOU R                  nSU R                  U R                   U R                  U R                  UU R                  U R                  U R                  U R                  U R                   U R"                  S.$ )NzCThis Job cannot be serialized since the reference to its callable (z^) could not be determined. Consider giving a textual reference (module:function name) instead.   )versionr   r   r!   r   r   r   r   r   r   r   r    )r   rX   r   r   r   __self__r   tupler   r   r!   r   r   r   r   r   r   r    )r(   r   r   s      r+   __getstate__Job.__getstate__  s    }}UVZV_V_Ub c   yyTNNDMM**4 DMM1MM#eDII&66D99D ''MM||kkII"&"9"9!//!//
 	
r-   c                 d   UR                  SS5      S:  a  [        SUS    S35      eUS   U l        US   U l        [	        U R                  5      U l        US   U l        US   U l        US	   U l        US
   U l	        US   U l
        US   U l        US   U l        US   U l        US   U l        g )Nri   rh   zJob has version z#, but only version 1 can be handledr   r   r!   r   r   r   r   r   r   r   r    )rZ   rX   r   r   r   r   r!   r   r   r   r   r   r   r   r    )r(   states     r+   __setstate__Job.__setstate__(  s    99Y"Q&"5#3"44WX  +ft}}-	Y'j)&M	Ho&M	"'(<"=j)"?3"?3r-   c                 j    [        U[        5      (       a  U R                  UR                  :H  $ [        $ N)rT   r   r   NotImplemented)r(   others     r+   __eq__
Job.__eq__;  s(    eS!!77ehh&&r-   c                 <    SU R                    SU R                   S3$ )Nz	<Job (id=z name=z)>)r   r   r:   s    r+   __repr__Job.__repr__@  s    477)6$))B77r-   c                     [        U S5      (       a,  U R                  (       a  S[        U R                  5      -   OSnOSnU R                   SU R                   SU S3$ )Nr    znext run at: pausedrF   z (trigger: rR   ))rW   r    r   r   r!   )r(   statuss     r+   __str__Job.__str__C  s_    4)) %%  -0B0B"CC  F))K~RxqAAr-   )r   r   r   r   r   r   r   r   r   r   r   r   r    r!   rs   )r]   
__module____qualname____firstlineno____doc__	__slots__r%   r1   r6   r;   r?   rC   propertyrF   rO   r&   rl   rp   rv   ry   r   __static_attributes____classcell__)r*   s   @r+   r   r      so    .I$5

B , , e&N"
H4&
8
B 
Br-   r   N)collections.abcr   r   datetimer   inspectr   r   uuidr   apscheduler.triggers.baser	   apscheduler.utilr
   r   r   r   r   r   utcrJ   r   r#   r-   r+   <module>r      s7    -  %  1  llzB zBr-   