File tree Expand file tree Collapse file tree 4 files changed +8
-2
lines changed Expand file tree Collapse file tree 4 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 5
5
test.py
6
6
test_org.py
7
7
test_city.py
8
+ test_region.py
Original file line number Diff line number Diff line change @@ -10,10 +10,11 @@ Usage:
10
10
See test.py for example usage with GeoIP Country
11
11
See test_org.py for example usage with GeoIP ISP and Organization
12
12
See test_city.py for example usage with GeoIP City
13
+ See test_region.py for example usage with GeoIP Region
13
14
14
15
License:
15
16
16
- Copyright (c) 2003 MaxMind LLC
17
+ Copyright (c) 2005 MaxMind LLC
17
18
18
19
All rights reserved. This package is free software; it is licensed
19
20
under the GPL.
Original file line number Diff line number Diff line change 7
7
include_dirs = ['/usr/local/include' ])
8
8
9
9
setup (name = 'GeoIP-Python' ,
10
- version = '1.2.0 ' ,
10
+ version = '1.2.1 ' ,
11
11
description = 'This is a python wrapper to GeoIP' ,
12
12
ext_modules = [module1 ])
Original file line number Diff line number Diff line change 5
5
gi = GeoIP .open ("/usr/local/share/GeoIP/GeoIPRegion.dat" ,GeoIP .GEOIP_STANDARD )
6
6
7
7
gir = gi .region_by_name ("www.google.com" )
8
+ if gir != None :
9
+ print gir ['country_code' ]
10
+ print gir ['region' ]
8
11
12
+ gir = gi .region_by_addr ("24.24.24.24" )
9
13
if gir != None :
10
14
print gir ['country_code' ]
11
15
print gir ['region' ]
You can’t perform that action at this time.
0 commit comments