%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/python/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/python/__pycache__/_tzhelper.cpython-312.pyc

�

Ϫ�fw��p�dZddlmZmZmZmZddlm	Z	ddgZ
Gd�de�Zejddd�Z
y)	z
Time zone utilities.
�)�datetime�	timedelta�timezone�tzinfo)�Optional�FixedOffsetTimeZone�UTCc	��eZdZdZddedeeddfd�Zedede	d	e	ddfd
��Z
ededdfd��Zd
ee
defd�Zd
ee
defd�Zd
ee
defd�Zy)ra*
    Represents a fixed timezone offset (without daylight saving time).

    @ivar name: A L{str} giving the name of this timezone; the name just
        includes how much time this offset represents.

    @ivar offset: A L{TimeDelta} giving the amount of time this timezone is
        offset.
    N�offset�name�returnc� �||_||_y)z�
        Construct a L{FixedOffsetTimeZone} with a fixed offset.

        @param offset: a delta representing the offset from UTC.
        @param name: A name to be given for this timezone.
        N)rr)�selfrrs   �:/usr/lib/python3/dist-packages/twisted/python/_tzhelper.py�__init__zFixedOffsetTimeZone.__init__"s�������	��sign�hours�minutesc�x�d|||fz}|dk(r|}|}n|dk7rtd|����|t||��|�S)a

        Construct a L{FixedOffsetTimeZone} from an offset described by sign
        ('+' or '-'), hours, and minutes.

        @note: For protocol compatibility with AMP, this method never uses 'Z'

        @param sign: A string describing the positive or negative-ness of the
            offset.
        @param hours: The number of hours in the offset.
        @param minutes: The number of minutes in the offset

        @return: A time zone with the given offset, and a name describing the
            offset.
        z%s%02i:%02i�-�+zInvalid sign for timezone )rr)�
ValueError�	TimeDelta)�clsrrrrs     r�fromSignHoursMinutesz(FixedOffsetTimeZone.fromSignHoursMinutes,sX��$��e�W�5�5���3�;��F�E��h�G�
�S�[��9�$��B�C�C��9�5�'�:�D�A�Ar�	timeStampc��tj|�tj|tj�j	d��z
}||�S)z�
        Create a time zone with a fixed offset corresponding to a time stamp in
        the system's locally configured time zone.
        N)r)�DateTime�
fromtimestampr�utc�replace)rrrs   r�fromLocalTimeStampz&FixedOffsetTimeZone.fromLocalTimeStampFsG���'�'�	�2�X�5K�5K��x�|�|�6
�
�'��'�
����6�{�r�dtc��|jS)z>
        Return the given timezone's offset from UTC.
        )r�rr$s  r�	utcoffsetzFixedOffsetTimeZone.utcoffsetQs���{�{�rc��td�S)zs
        Return a zero L{TimeDelta} for the daylight saving time
        offset, since there is never one.
        r)rr&s  r�dstzFixedOffsetTimeZone.dstWs��
��|�rc��|j�|jStjd|�}|jd�S)z;
        Return a string describing this timezone.
        rzUTC%z)rrr �strftimer&s  r�tznamezFixedOffsetTimeZone.tzname^s9���9�9� ��9�9��
�
#�
#�A�t�
,���{�{�7�#�#r)N)�__name__�
__module__�__qualname__�__doc__rr�strr�classmethod�intr�floatr#rr'r)r,�rrrrs�����y����
�����B��B�"�B�-0�B�	�B��B�2��5��5J�����H�X�.��9���h�x�(��Y��$��(�+�$��$rrN)r0rrrrrr�TZInfo�typingr�__all__rrr	r5rr�<module>r9sM��
�����	���O$�&�O$�d�.�.�s�A�q�9�r

Zerion Mini Shell 1.0