HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/python/__pycache__/_tzhelper.cpython-38.pyc
U


W[x�@sBdZddlmZmZmZddgZGdd�de�Ze�ddd�ZdS)z
Time zone utilities.
�)�datetime�	timedelta�tzinfo�FixedOffsetTimeZone�UTCc@sJeZdZdZddd�Zedd��Zedd��Zd	d
�Zdd�Z	d
d�Z
dS)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.
    NcCs||_||_dS)a
        Construct a L{FixedOffsetTimeZone} with a fixed offset.

        @param offset: a delta representing the offset from UTC.
        @type offset: L{timedelta}

        @param name: A name to be given for this timezone.
        @type name: L{str} or L{None}
        N)�offset�name)�selfrr�r
�:/usr/lib/python3/dist-packages/twisted/python/_tzhelper.py�__init__s
zFixedOffsetTimeZone.__init__cCsLd|||f}|dkr$|}|}n|dkr:td|f��|t||d�|�S)am
        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.
        @type hours: L{int}

        @param minutes: The number of minutes in the offset
        @type minutes: L{int}

        @return: A time zone with the given offset, and a name describing the
            offset.
        @rtype: L{FixedOffsetTimeZone}
        z%s%02i:%02i�-�+zInvalid sign for timezone %r)�hours�minutes)�
ValueErrorr)�clsZsignrrrr
r
r�fromSignHoursMinutes+sz(FixedOffsetTimeZone.fromSignHoursMinutescCst�|�t�|�}||�S)a
        Create a time zone with a fixed offset corresponding to a time stamp in
        the system's locally configured time zone.

        @param timeStamp: a time stamp
        @type timeStamp: L{int}

        @return: a time zone
        @rtype: L{FixedOffsetTimeZone}
        )r�
fromtimestampZutcfromtimestamp)rZ	timeStamprr
r
r�fromLocalTimeStampIs

��z&FixedOffsetTimeZone.fromLocalTimeStampcCs|jS)z9
        Return this timezone's offset from UTC.
        )r�r	Zdtr
r
r�	utcoffset\szFixedOffsetTimeZone.utcoffsetcCstd�S)z|
        Return a zero C{datetime.timedelta} for the daylight saving time
        offset, since there is never one.
        r)rrr
r
r�dstcszFixedOffsetTimeZone.dstcCs&|jdk	r|jSt�d|�}|�d�S)z;
        Return a string describing this timezone.
        NrzUTC%z)rrr�strftimerr
r
r�tznameks
zFixedOffsetTimeZone.tzname)N)�__name__�
__module__�__qualname__�__doc__r�classmethodrrrrrr
r
r
rrs



rN)rrrr�__all__rrrr
r
r
r�<module>s�e