
    T-fQ                     V    d dl mZ d dlmZmZ d dlmZ  G d de          Zd Zd Z	dS )	    )division)	timedeltatzinfo)deepcopyc                   6    e Zd ZdZd Zd Zd Zd Zd Zd Z	dS )	FixedOffseta  
    Represent a timezone with a fixed offset from UTC and no adjustment for
    DST.

    >>> FixedOffset(4,0)
    <UTC+04:00>
    >>> FixedOffset(-4,0)
    <UTC-04:00>
    >>> FixedOffset(4,30)
    <UTC+04:30>

    >>> tz = FixedOffset(-5,0)
    >>> tz.dst(None)
    datetime.timedelta(0)

    The class tries to do the right thing with the sign
    of the time zone offset:

    >>> FixedOffset(-9,30)
    <UTC-09:30>
    >>> FixedOffset(-9,-30)
    Traceback (most recent call last):
    ...
    ValueError: minutes must not be negative

    Offsets must thus be normalized so that the minute value is positive:

    >>> FixedOffset(-8,30)
    <UTC-08:30>

    c                     t          j        |            |dk     rt          d          |dk     r|dz  }t          ||          | _        dt          t          | j                            z   | _        dS )zK
        Create a new FixedOffset instance with the given offset.

        r   zminutes must not be negative)hoursminutesUTCN)r   __init__
ValueErrorr   _FixedOffset__offsettimezonetimedelta_seconds_FixedOffset__name)selfr   r   s      ^/home/cdr/domains/dharristours.com/map/certbot/lib/python3.11/site-packages/pyrfc3339/utils.pyr   zFixedOffset.__init__(   s|    
 	Q;;;<<<199rMG!*13 3 3h'8'G'GHHH    c                      t          d          S )zG
        Return offset for DST.  Always returns timedelta(0).

        r   )r   r   dts     r   dstzFixedOffset.dst6   s    
 ||r   c                     | j         S )z*
        Return offset from UTC.

        )r   r   s     r   	utcoffsetzFixedOffset.utcoffset=   s    
 }r   c                     | j         S )z+
        Return name of timezone.

        )r   r   s     r   tznamezFixedOffset.tznameD   s    
 {r   c                 R    d                     |                     d                     S )Nz<{0}>)formatr   )r   s    r   __repr__zFixedOffset.__repr__K   s     ~~dkk$//000r   c           	          | j         }|                    |          }||t          |           <   | j                                        D ]$\  }}t          ||t          ||                     %|S )N)	__class____new__id__dict__itemssetattrr   )r   memoclsresultkvs         r   __deepcopy__zFixedOffset.__deepcopy__N   sn    nS!!RXXM'')) 	2 	2DAqFAx4001111r   N)
__name__
__module____qualname____doc__r   r   r   r   r!   r.    r   r   r   r      s|         @I I I      1 1 1    r   r   c                     	 t          t          |                                                     S # t          $ r@ | j        }| j        }| j        }t          t          |dz  |z   |dz  z                       cY S w xY w)a  
    Return the offset stored by a :class:`datetime.timedelta` object as an
    integer number of seconds.  Microseconds, if present, are rounded to
    the nearest second.

    Delegates to
    :meth:`timedelta.total_seconds() <datetime.timedelta.total_seconds()>`
    if available.

    >>> timedelta_seconds(timedelta(hours=1))
    3600
    >>> timedelta_seconds(timedelta(hours=-1))
    -3600
    >>> timedelta_seconds(timedelta(hours=1, minutes=30))
    5400
    >>> timedelta_seconds(timedelta(hours=1, minutes=30,
    ... microseconds=300000))
    5400
    >>> timedelta_seconds(timedelta(hours=1, minutes=30,
    ...	microseconds=900000))
    5401

    iQ i@B )introundtotal_secondsAttributeErrordayssecondsmicroseconds)tdr9   r:   r;   s       r   r   r   W   s    2O5))++,,--- O O Ow*5$,'1\G5KLMMNNNNNOs   -0 AA:9A:c                     t          t          |           d          \  }}t          t          |          dz            }| dk    rd}nd}d                    |t          |          t          |                    S )z
    Return a string representing the timezone offset.
    Remaining seconds are rounded to the nearest minute.

    >>> timezone(3600)
    '+01:00'
    >>> timezone(5400)
    '+01:30'
    >>> timezone(-28800)
    '-08:00'

    i  <   r   +-z{0}{1:02d}:{2:02d})divmodabsr6   floatr    r5   )r   r   r:   r   signs        r   r   r   z   sn     C	NND11NE7E'NNR'((GA~~&&tSZZWFFFr   N)

__future__r   datetimer   r   copyr   r   r   r   r3   r   r   <module>rH      s          & & & & & & & &      M M M M M& M M M` O  O  OFG G G G Gr   