Add text to the title if the text is given below the coordinates.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 25 Sep 2011 14:00:12 +0000 (14:00 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 25 Sep 2011 14:00:12 +0000 (14:00 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/trunk/wrpylib@924 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrpylib/mwmarkup.py
wrpylib/wrmwcache.py

index 88f8add9c055cc1af1a5197224439be0e41e51c2..d0543e0ea7c82a6fabc7c33dddefe327a05f8cdd 100644 (file)
@@ -197,13 +197,14 @@ def parse_googlemap(wikitext):
         # Handle a coordinate
         if is_coord(line):
             lon, lat, symbol, title = parse_coord(line)
-            coords.append((lon, lat, symbol, title))
             while i < len(lines):
                 line = lines[i].strip()
                 i += 1
                 if is_path(line) or is_coord(line):
                     i -= 1
                     break
+                if len(line) > 0 and title is None: title = line
+            coords.append((lon, lat, symbol, title))
             continue
 
         raise RuntimeError(u'Unknown line syntax: ' + line)
index 941f0d28463fb648110de7ebdbf8f3d17926b080..431e005ac497f02adbb668d221636252347cdbbc 100644 (file)
@@ -192,7 +192,7 @@ def update_wrmapcache(connection):
                         if not point_types.has_key(point_type): raise RuntimeError(u'Unknown point type {0}'.format(point_type))
                         point_type = point_types[point_type]
                         sql = u'insert into wrmappointcache (page_id, type, point, label) values (%s, %s, POINT(%s, %s), %s)'
-                        connection.execute(sql, (sledrun_page.page_id, point_type, lon, lat, None))
+                        connection.execute(sql, (sledrun_page.page_id, point_type, lon, lat, label))
                 # Paths
                 for path_type, coords in paths:
                     path_type = path_type.lower()