Skip to content

Commit c05c7ff

Browse files
committed
Removed city_isp_org() and omni()
1 parent 90b8aae commit c05c7ff

File tree

3 files changed

+7
-45
lines changed

3 files changed

+7
-45
lines changed

HISTORY.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ History
66
0.7.0 (2014-09-XX)
77
++++++++++++++++++
88

9-
- The ``geoip2.database.Reader`` lookup methods (e.g., ``city()``, ``isp()``)
9+
* IMPORTANT: The deprecated ``city_isp_org()`` and ``omni()`` methods have
10+
been removed.
11+
* The ``geoip2.database.Reader`` lookup methods (e.g., ``city()``, ``isp()``)
1012
now raise a ``TypeError`` if they are used with a database that does not
1113
match the method. In particular, doing a ``city()`` lookup on a GeoIP2
1214
Country database will result in an error and vice versa.
13-
- A ``metadata()`` method has been added to the ``geoip2.database.Reader``
15+
* A ``metadata()`` method has been added to the ``geoip2.database.Reader``
1416
class. This returns a ``maxminddb.reader.Metadata`` object with information
1517
about the database.
1618

geoip2/webservice.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,6 @@ def city(self, ip_address='me'):
108108
"""
109109
return self._response_for('city', geoip2.models.City, ip_address)
110110

111-
def city_isp_org(self, ip_address='me'):
112-
"""This method calls the GeoIP2 Precision: City endpoint.
113-
114-
:param ip_address: IPv4 or IPv6 address as a string. If no
115-
address is provided, the address that the web service is called
116-
from will be used.
117-
118-
:returns: :py:class:`geoip2.models.City` object
119-
120-
.. deprecated:: 0.6.0
121-
Use :py:method:`city` instead.
122-
123-
"""
124-
return self.city(ip_address)
125-
126111
def country(self, ip_address='me'):
127112
"""This method calls the GeoIP2 Country endpoint.
128113
@@ -152,21 +137,6 @@ def insights(self, ip_address='me'):
152137
return self._response_for('insights', geoip2.models.Insights,
153138
ip_address)
154139

155-
def omni(self, ip_address='me'):
156-
"""This method calls the GeoIP2 Precision: Insights endpoint.
157-
158-
:param ip_address: IPv4 or IPv6 address as a string. If no address
159-
is provided, the address that the web service is called from will
160-
be used.
161-
162-
:returns: :py:class:`geoip2.models.Insights` object
163-
164-
.. deprecated:: 0.6.0
165-
Use :py:method:`insights` instead.
166-
167-
"""
168-
return self.insights(ip_address)
169-
170140
def _response_for(self, path, model_class, ip_address):
171141
if ip_address != 'me':
172142
ip_address = str(ipaddress.ip_address(ip_address))

tests/webservice_test.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -253,25 +253,15 @@ def test_city_ok(self):
253253
self.assertEqual(type(city), geoip2.models.City,
254254
'return value of client.city')
255255

256-
def test_city_isp_org_ok(self):
257-
httpretty.register_uri(httpretty.GET,
258-
self.base_uri + 'city/1.2.3.4',
259-
body=json.dumps(self.country),
260-
status=200,
261-
content_type=self._content_type('country'))
262-
city_isp_org = self.client.city_isp_org('1.2.3.4')
263-
self.assertEqual(type(city_isp_org), geoip2.models.City,
264-
'return value of client.city_isp_org')
265-
266256
def test_insights_ok(self):
267257
httpretty.register_uri(httpretty.GET,
268258
self.base_uri + 'insights/1.2.3.4',
269259
body=json.dumps(self.country),
270260
status=200,
271261
content_type=self._content_type('country'))
272-
omni = self.client.insights('1.2.3.4')
273-
self.assertEqual(type(omni), geoip2.models.Insights,
274-
'return value of client.omni')
262+
insights = self.client.insights('1.2.3.4')
263+
self.assertEqual(type(insights), geoip2.models.Insights,
264+
'return value of client.insights')
275265

276266
def test_insights_ok(self):
277267
httpretty.register_uri(httpretty.GET,

0 commit comments

Comments
 (0)