[tor-commits] [ooni-probe/master] Set the tor_state GeoIP class attribute on startup

art at torproject.org art at torproject.org
Tue Apr 30 13:01:44 UTC 2013


commit a63b1b1893d3de4c7e7899c7f47bc1e807f4c4e7
Author: Arturo Filastò <art at fuffa.org>
Date:   Mon Apr 22 16:23:01 2013 +0200

    Set the tor_state GeoIP class attribute on startup
---
 ooni/geoip.py |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/ooni/geoip.py b/ooni/geoip.py
index 0f8335f..1e6f6e9 100644
--- a/ooni/geoip.py
+++ b/ooni/geoip.py
@@ -109,12 +109,14 @@ class MaxMindGeoIP(HTTPGeoIPLookupper):
 
 class ProbeIP(object):
     strategy = None
-    geoIPServices = {'ubuntu': UbuntuGeoIP,
-        'torproject': TorProjectGeoIP,
-        'maxmind': MaxMindGeoIP
-    }
     address = None
-    tor_state = config.tor_state
+
+    def __init__(self):
+        self.tor_state = config.tor_state
+        self.geoIPServices = {'ubuntu': UbuntuGeoIP,
+            'torproject': TorProjectGeoIP,
+            'maxmind': MaxMindGeoIP
+        }
 
     @defer.inlineCallbacks
     def lookup(self):





More information about the tor-commits mailing list