Current File : //proc/self/root/usr/lib/python3/dist-packages/pyrfc3339/__pycache__/utils.cpython-312.pyc |
�
ƺ[Q
� �N � d dl mZ d dlmZmZ d dlmZ G d� de� Zd� Zd� Z y) � )�division)� timedelta�tzinfo)�deepcopyc �4 � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z y) �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 | _ y)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��r�M�G�!��*1�3��
��h�'8����'G�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 �B � dj | j d � � S )Nz<{0}>)�formatr )r s r �__repr__zFixedOffset.__repr__K s � ��~�~�d�k�k�$�/�0�0r c �� � | j }|j |� }||t | � <