o
    ÔèFh¥	  ã                   @   sb   d dl mZ zd dlZdZW n ey   dZY nw dZdd„ Zdd	„ Zd
d„ ZG dd„ dƒZ	dS )é    )ÚGeocoderParseErrorNTF)ÚTimezonec                   C   s   t stdƒ‚d S )Nz�pytz must be installed in order to locate timezones. If geopy has been installed with `pip`, then pytz can be installed with `pip install "geopy[timezone]"`.)Úpytz_availableÚImportError© r   r   úG/var/www/html/loop/nvenv/lib/python3.10/site-packages/geopy/timezone.pyÚensure_pytz_is_installed   s
   ÿÿr   c                 C   sT   t ƒ  zt | ¡}W n tjy   td|  ƒ‚ ty$   td| ƒ‚w t||ƒS )NzJpytz could not parse the timezone identifier (%s) returned by the service.z4geopy could not find a timezone in this response: %s)r   ÚpytzÚtimezoneÚUnknownTimeZoneErrorr   ÚKeyErrorr   )Útimezone_nameÚrawÚpytz_timezoner   r   r   Úfrom_timezone_name   s"   ÿÿÿÿÿ
r   c                 C   s   t ƒ  t | d ¡}t||ƒS )Né<   )r   r	   ÚFixedOffsetr   )Úgmt_offset_hoursr   r   r   r   r   Úfrom_fixed_gmt_offset)   s   
r   c                   @   sd   e Zd ZdZdZdd„ Zedd„ ƒZedd„ ƒZd	d
„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ ZdS )r   z‚
    Contains a parsed response for a timezone request, which is
    implemented in few geocoders which provide such lookups.
    ©Ú_pytz_timezoneÚ_rawc                 C   s   || _ || _d S ©Nr   )Úselfr   r   r   r   r   Ú__init__7   s   
zTimezone.__init__c                 C   ó   | j S )zZ
        pytz timezone instance.

        :rtype: :class:`pytz.tzinfo.BaseTzInfo`
        )r   ©r   r   r   r   r   ;   s   zTimezone.pytz_timezonec                 C   r   )z•
        Timezone's raw, unparsed geocoder response. For details on this,
        consult the service's documentation.

        :rtype: dict
        )r   r   r   r   r   r   D   s   zTimezone.rawc                 C   s
   t | jƒS r   )Ústrr   r   r   r   r   Ú__str__N   ó   
zTimezone.__str__c                 C   s   dt | jƒ S )NzTimezone(%s))Úreprr   r   r   r   r   Ú__repr__Q   s   zTimezone.__repr__c                 C   s   | j | jfS r   r   r   r   r   r   Ú__getstate__T   s   zTimezone.__getstate__c                 C   s   |\| _ | _d S r   r   )r   Ústater   r   r   Ú__setstate__W   s   zTimezone.__setstate__c                 C   s"   t |tƒo| j|jko| j|jkS r   )Ú
isinstancer   r   r   ©r   Úotherr   r   r   Ú__eq__Z   s
   

ÿ
ýzTimezone.__eq__c                 C   s
   | |k S r   r   r&   r   r   r   Ú__ne__a   r   zTimezone.__ne__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   Úpropertyr   r   r   r!   r"   r$   r(   r)   r   r   r   r   r   /   s    

	r   )
Ú	geopy.excr   r	   r   r   Ú__all__r   r   r   r   r   r   r   r   Ú<module>   s    ÿ	