�
ƺ[Q
� �V � d dl mZ d dlmZmZ d dlmZ G d� de� � Zd� Zd� Z dS ) � )�division)� timedelta�tzinfo)�deepcopyc �6 � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z dS ) �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 | � � |dk rt d� � �|dk r|dz }t ||�� � | _ dt t
| j � � � � z | _ dS )zK
Create a new FixedOffset instance with the given offset.
r zminutes must not be negative���)�hours�minutes�UTCN)r �__init__�
ValueErrorr �_FixedOffset__offset�timezone�timedelta_seconds�_FixedOffset__name)�selfr r s �1/usr/lib/python3/dist-packages/pyrfc3339/utils.pyr zFixedOffset.__init__( s| � �
�������Q�;�;��;�<�<�<��1�9�9��r�M�G�!��*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 �dstzFixedOffset.dst6 s � �
��|�|�r c � � | j S )z*
Return offset from UTC.
)r r s r � utcoffsetzFixedOffset.utcoffset= s � �
�}�r c � � | j S )z+
Return name of timezone.
)r r s r �tznamezFixedOffset.tznameD s � �
�{�r c �R � d� | � d � � � � S )Nz<{0}>)�formatr )r s r �__repr__zFixedOffset.__repr__K s � ��~�~�d�k�k�$�/�/�0�0�0r c �� � | j }|� |� � }||t | � � < |