File: //usr/lib/python3/dist-packages/twisted/python/__pycache__/_tzhelper.cpython-38.pyc
U
�b8 � @ sN d Z ddlmZmZmZ ddlmZ ddgZ G dd� de�Z
e
�ddd�ZdS ) z
Time zone utilities.
� )�datetime� timedelta�tzinfo)�Optional�FixedOffsetTimeZone�UTCc @ s� e Zd ZdZdeee dd�dd�Zeee e d d�dd��Z
eed d �d
d��Zee
ed�d
d�Zee
ed�dd�Zee
ed�dd�ZdS )r a*
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 C s || _ || _dS )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)r r )�selfr r � r �:/usr/lib/python3/dist-packages/twisted/python/_tzhelper.py�__init__ s zFixedOffsetTimeZone.__init__)�sign�hours�minutesr
c C sL d|||f }|dkr$| }| }n|dkr:t d|����| t||d�|�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 )r r )�
ValueError� TimeDelta)�clsr r r r r r r
�fromSignHoursMinutes'