[mirrorbrain-commits] r7937 - /trunk/mirrordoctor/mb/geoip.py

From: <poeml_at_mirrorbrain.org>
Date: Tue, 22 Dec 2009 01:22:04 -0000
Author: poeml
Date: Tue Dec 22 02:22:03 2009
New Revision: 7937

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=7937&view=rev
Log:
mb.geoip: 
- use just as many digits of precision as we store in the database - then it's
  easier to compare numbers later on, to see whether something has changed.

Modified:
    trunk/mirrordoctor/mb/geoip.py

Modified: trunk/mirrordoctor/mb/geoip.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mirrordoctor/mb/geoip.py?rev=7937&r1=7936&r2=7937&view=diff
==============================================================================
--- trunk/mirrordoctor/mb/geoip.py (original)
+++ trunk/mirrordoctor/mb/geoip.py Tue Dec 22 02:22:03 2009
_at_@ -52,6 +52,11 @@
         if line.startswith('Longitude'):
             lng = float(line.split()[1])
             continue
+
+    # if the number of digits here matches the database declaration, we can
+    # compare the values and see whether they have changed
+    lat = round(lat, 3)
+    lng = round(lng, 3)
     return lat, lng
 
 




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Tue Dec 22 2009 - 01:22:05 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT