
    i                         d dl mZmZ d dlZd dlZ G d de          Z G d de          Z G d de          Z	 G d	 d
 ej
        e                    ZdS )    )ABCMetaabstractmethodNc                   "     e Zd ZdZ fdZ xZS )JobLookupErrorzBRaised when the job store cannot find a job for update or removal.c                 ^    t          t          |                               d|z             d S )Nz No job by the id of %s was found)superr   __init__selfjob_id	__class__s     `/var/www/html/crypto-bot/backend/venv/lib/python3.11/site-packages/apscheduler/jobstores/base.pyr	   zJobLookupError.__init__
   s.    nd##,,-PSY-YZZZZZ    __name__
__module____qualname____doc__r	   __classcell__r   s   @r   r   r      sG        LL[ [ [ [ [ [ [ [ [r   r   c                   "     e Zd ZdZ fdZ xZS )ConflictingIdErrorz8Raised when the uniqueness of job IDs is being violated.c                 ^    t          t          |                               d|z             d S )Nz2Job identifier (%s) conflicts with an existing job)r   r   r	   r
   s     r   r	   zConflictingIdError.__init__   s=     $''00AFJ	L 	L 	L 	L 	Lr   r   r   s   @r   r   r      sG        BBL L L L L L L L Lr   r   c                   "     e Zd ZdZ fdZ xZS )TransientJobErrorzs
    Raised when an attempt to add transient (with no func_ref) job to a persistent job store is
    detected.
    c                 ^    t          t          |                               d|z             d S )NzgJob (%s) cannot be added to this job store because a reference to the callable could not be determined.)r   r   r	   r
   s     r   r	   zTransientJobError.__init__   s=    &&//(*01	2 	2 	2 	2 	2r   r   r   s   @r   r   r      sB         
2 2 2 2 2 2 2 2 2r   r   c                      e Zd ZdZdZdZ ej        d          Zd Z	d Z
d Zed             Zed             Zed	             Zed
             Zed             Zed             Zed             Zed             Zd ZdS )BaseJobStorezSAbstract base class that defines the interface that every job store must implement.Nzapscheduler.jobstoresc                 Z    || _         || _        t          j        d|z            | _        dS )ax  
        Called by the scheduler when the scheduler is being started or when the job store is being
        added to an already running scheduler.

        :param apscheduler.schedulers.base.BaseScheduler scheduler: the scheduler that is starting
            this job store
        :param str|unicode alias: alias of this job store as it was assigned to the scheduler
        zapscheduler.jobstores.%sN)
_scheduler_aliaslogging	getLogger_logger)r   	scheduleraliass      r   startzBaseJobStore.start)   s.     $()Ce)KLLr   c                     dS )z2Frees any resources still bound to this job store.N r   s    r   shutdownzBaseJobStore.shutdown7         r   c                     t          |          D ]9\  }}|j        -|dk    r$|d |         }|d |= |                    |            d S :d S )Nr   )	enumeratenext_run_timeextend)r   jobsijobpaused_jobss        r   _fix_paused_jobs_sortingz%BaseJobStore._fix_paused_jobs_sorting:   sm    oo 	 	FAs ,q55"&rr(KRaRKK,,, -	 	r   c                     dS )aG  
        Returns a specific job, or ``None`` if it isn't found..

        The job store is responsible for setting the ``scheduler`` and ``jobstore`` attributes of
        the returned job to point to the scheduler and itself, respectively.

        :param str|unicode job_id: identifier of the job
        :rtype: Job
        Nr)   r   r   s     r   
lookup_jobzBaseJobStore.lookup_jobC   r,   r   c                     dS )a  
        Returns the list of jobs that have ``next_run_time`` earlier or equal to ``now``.
        The returned jobs must be sorted by next run time (ascending).

        :param datetime.datetime now: the current (timezone aware) datetime
        :rtype: list[Job]
        Nr)   )r   nows     r   get_due_jobszBaseJobStore.get_due_jobsO   r,   r   c                     dS )z
        Returns the earliest run time of all the jobs stored in this job store, or ``None`` if
        there are no active jobs.

        :rtype: datetime.datetime
        Nr)   r*   s    r   get_next_run_timezBaseJobStore.get_next_run_timeY   r,   r   c                     dS )a  
        Returns a list of all jobs in this job store.
        The returned jobs should be sorted by next run time (ascending).
        Paused jobs (next_run_time == None) should be sorted last.

        The job store is responsible for setting the ``scheduler`` and ``jobstore`` attributes of
        the returned jobs to point to the scheduler and itself, respectively.

        :rtype: list[Job]
        Nr)   r*   s    r   get_all_jobszBaseJobStore.get_all_jobsb   r,   r   c                     dS )z
        Adds the given job to this store.

        :param Job job: the job to add
        :raises ConflictingIdError: if there is another job in this store with the same ID
        Nr)   r   r3   s     r   add_jobzBaseJobStore.add_jobo   r,   r   c                     dS )z
        Replaces the job in the store with the given newer version.

        :param Job job: the job to update
        :raises JobLookupError: if the job does not exist
        Nr)   rA   s     r   
update_jobzBaseJobStore.update_jobx   r,   r   c                     dS )z
        Removes the given job from this store.

        :param str|unicode job_id: identifier of the job
        :raises JobLookupError: if the job does not exist
        Nr)   r7   s     r   
remove_jobzBaseJobStore.remove_job   r,   r   c                     dS )z!Removes all jobs from this store.Nr)   r*   s    r   remove_all_jobszBaseJobStore.remove_all_jobs   r,   r   c                      d| j         j        z  S )Nz<%s>)r   r   r*   s    r   __repr__zBaseJobStore.__repr__   s    ///r   )r   r   r   r   r    r!   r"   r#   r$   r'   r+   r5   r   r8   r;   r=   r?   rB   rD   rF   rH   rJ   r)   r   r   r   r   "   sQ       ]]JFg 788GM M MA A A   	 	 ^	   ^   ^ 
 
 ^
   ^   ^   ^ 0 0 ^00 0 0 0 0r   r   )abcr   r   r"   sixKeyErrorr   r   
ValueErrorr   with_metaclassr   r)   r   r   <module>rP      s	   ' ' ' ' ' ' ' '  



[ [ [ [ [X [ [ [L L L L L L L L	2 	2 	2 	2 	2
 	2 	2 	2m0 m0 m0 m0 m0%3%g.. m0 m0 m0 m0 m0r   