Your IP : 216.73.216.213
�IX32 � @ s� d Z d d l m Z d d l Z d d l m Z Gd d � d e � Z Gd d � d e � Z Gd d
� d
e � Z Gd d � d e � Z
Gd
d � d e � Z Gd d � d e � Z Gd d � d e � Z
Gd d � d e � Z Gd d � d e � Z d S)a&
Models
======
These classes provide models for the data returned by the GeoIP2
web service and databases.
The only difference between the City and Insights model classes is which
fields in each record may be populated. See
http://dev.maxmind.com/geoip/geoip2/web-services for more details.
� )�ABCMetaN)�SimpleEqualityc @ s1 e Z d Z d Z d d d � Z d d � Z d S)�CountryaC Model for the GeoIP2 Precision: Country and the GeoIP2 Country database.
This class provides the following attributes:
.. attribute:: continent
Continent object for the requested IP address.
:type: :py:class:`geoip2.records.Continent`
.. attribute:: country
Country object for the requested IP address. This record represents the
country where MaxMind believes the IP is located.
:type: :py:class:`geoip2.records.Country`
.. attribute:: maxmind
Information related to your MaxMind account.
:type: :py:class:`geoip2.records.MaxMind`
.. attribute:: registered_country
The registered country object for the requested IP address. This record
represents the country where the ISP has registered a given IP block in
and may differ from the user's country.
:type: :py:class:`geoip2.records.Country`
.. attribute:: represented_country
Object for the country represented by the users of the IP address
when that country is different than the country in ``country``. For
instance, the country represented by an overseas military base.
:type: :py:class:`geoip2.records.RepresentedCountry`
.. attribute:: traits
Object with the traits of the requested IP address.
:type: :py:class:`geoip2.records.Traits`
Nc C s� | d k r d g } | | _ t j j | | j d i � � | _ t j j | | j d i � � | _ t j j | | j d i � � | _ t j j | | j d i � � | _
t j j | j d i � � | _ t j j
| j d i � � | _ | | _ d S)NZen� continent�country�registered_country�represented_country�maxmind�traits)�_locales�geoip2�recordsZ Continent�getr r r r ZRepresentedCountryr ZMaxMindr ZTraitsr
�raw)�self�raw_response�locales� r �>/opt/alt/python35/lib/python3.5/site-packages/geoip2/models.py�__init__D s !!zCountry.__init__c C s1 d j d | j d | j j d | j d | j � S)Nz({module}.{class_name}({data}, {locales})�module�
class_name�datar )�format�
__module__� __class__�__name__r r )r r r r �__repr__] s
zCountry.__repr__)r r �__qualname__�__doc__r r r r r r r s .r c s+ e Z d Z d Z d � f d d � Z � S)�Citya� Model for the GeoIP2 Precision: City and the GeoIP2 City database.
.. attribute:: city
City object for the requested IP address.
:type: :py:class:`geoip2.records.City`
.. attribute:: continent
Continent object for the requested IP address.
:type: :py:class:`geoip2.records.Continent`
.. attribute:: country
Country object for the requested IP address. This record represents the
country where MaxMind believes the IP is located.
:type: :py:class:`geoip2.records.Country`
.. attribute:: location
Location object for the requested IP address.
.. attribute:: maxmind
Information related to your MaxMind account.
:type: :py:class:`geoip2.records.MaxMind`
.. attribute:: registered_country
The registered country object for the requested IP address. This record
represents the country where the ISP has registered a given IP block in
and may differ from the user's country.
:type: :py:class:`geoip2.records.Country`
.. attribute:: represented_country
Object for the country represented by the users of the IP address
when that country is different than the country in ``country``. For
instance, the country represented by an overseas military base.
:type: :py:class:`geoip2.records.RepresentedCountry`
.. attribute:: subdivisions
Object (tuple) representing the subdivisions of the country to which
the location of the requested IP address belongs.
:type: :py:class:`geoip2.records.Subdivisions`
.. attribute:: traits
Object with the traits of the requested IP address.
:type: :py:class:`geoip2.records.Traits`
Nc s� t t | � j | | � t j j | | j d i � � | _ t j j | j d i � � | _ t j j | j d i � � | _
t j j | | j d g � � | _ d S)N�city�location�postal�subdivisions)
�superr r r r
r r! ZLocationr"