[mirrorbrain-commits] r8198 - /trunk/mb/mb/conn.py

From: <poeml_at_mirrorbrain.org>
Date: Fri, 05 Nov 2010 19:22:00 -0000
Author: poeml
Date: Fri Nov  5 20:22:00 2010
New Revision: 8198

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8198&view=rev
Log:
mb:
- show geographical coordinates, and allow editing them.

Modified:
    trunk/mb/mb/conn.py

Modified: trunk/mb/mb/conn.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mb/mb/conn.py?rev=8198&r1=8197&r2=8198&view=diff
==============================================================================
--- trunk/mb/mb/conn.py (original)
+++ trunk/mb/mb/conn.py Fri Nov  5 20:22:00 2010
_at_@ -15,6 +15,7 @@
 country        : %(country)s
 asn            : %(asn)s
 prefix         : %(prefix)s
+lat,lng        : %(lat)s,%(lng)s
 regionOnly     : %(regionOnly)s
 countryOnly    : %(countryOnly)s
 asOnly         : %(asOnly)s
_at_@ -40,6 +41,8 @@
                           'country',
                           'asn',
                           'prefix',
+                          'lat',
+                          'lng',
                           'regionOnly',
                           'countryOnly',
                           'asOnly',
_at_@ -265,6 +268,12 @@
     comment_delim = '---------- comments ----------'
     new_attrs['comment'] = s.split(comment_delim)[1].strip('\n')
 
+    # latitude/longitude are in one line:
+    m = re.search(r'^lat,lng *: *(.*),(.*)', s, re.MULTILINE)
+    if m:
+        new_attrs['lat'] = m.group(1)
+        new_attrs['lng'] = m.group(2)
+
     return new_attrs
     
 




_______________________________________________
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 Fri Nov 05 2010 - 19:22:01 GMT

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