# HG changeset patch
# User fknauft
# Date 1297862523 -3600
# Node ID f87dda6f05d65d0f0c96fbdee8b4acfa305223ee
# Parent f080901d8163982feeeabfb4003e761cd8ac72c7
corrected links in desc (RestDbGisApi)
diff -r f080901d8163 -r f87dda6f05d6 RestDbGisApi.py
--- a/RestDbGisApi.py Wed Feb 16 13:56:06 2011 +0100
+++ b/RestDbGisApi.py Wed Feb 16 14:22:03 2011 +0100
@@ -296,10 +296,25 @@
val = "%s: %s"%(name, value)
value=unicode(value)
+
+ # If there is a link within the description data, create a valid href
if value.find('http://')>-1:
- link_str=value[value.find('http://'):value.find(' ',value.find('http://'))]
- val =name+": "+value[0:value.find('http://')]+'" ' + link_str + ' "' + value[value.find(' ',value.find('http://')):]
-
+ link_str_beg=value.find('http://')
+ link_str_end = -1
+ link_str_end0=value.find(' ',link_str_beg)
+ link_str_end1=value.find('>',link_str_beg)
+ if link_str_end0 -1:
+ link_str=value[link_str_beg:link_str_end]
+ val =name+": "+value[0:link_str_beg]+'" ' + link_str + ' "' + value[link_str_end:]
+ else:
+ link_str=value[link_str_beg:]
+ val =name+": "+value[0:link_str_beg]+'" ' + link_str + ' "'
+
+
#desc += kmlEncode(val)
desc += val
desc += '
\n'