File: //lib/python3/dist-packages/twisted/python/__pycache__/_tzhelper.cpython-310.pyc
o
�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 ZdZddedee ddfdd�Zeded e d
e dd fdd��Z
ed
edd fdd��Zdee
defdd�Zdee
defdd�Zdee
defdd�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�minutesc C sL d|||f }|dkr| }| }n|dkrt 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'