X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=bin%2Fplc-kml.py;h=417ef15ba44a0d38354edb2dd0f91d485ee0ff3a;hb=9767039754a9a61f1a720f172b0138573a72f817;hp=b246300ed2eced4dfca89ae71fb77bfafa9a63fa;hpb=dbf0fc19b34d57bbb2645c03739d326fb07ba8be;p=myplc.git
diff --git a/bin/plc-kml.py b/bin/plc-kml.py
index b246300..417ef15 100755
--- a/bin/plc-kml.py
+++ b/bin/plc-kml.py
@@ -34,32 +34,18 @@ class KmlMap:
def write(self,string):
self.output.write(string.encode("UTF-8"))
- # mention local last
- @staticmethod
- def site_compare (s1,s2):
- p1 = p2 = 0
- if s1['peer_id']: p1=s1['peer_id']
- if s2['peer_id']: p2=s2['peer_id']
- return p2-p1
-
- def refresh (self):
- self.open()
- self.write_header()
- # cache peers
- peers = GetPeers()
- all_sites = GetSites({'enabled':True,'is_public':True})
- all_sites.sort(KmlMap.site_compare)
- for site in all_sites:
- self.write_site(site,peers)
- self.write_footer()
- self.close()
-
# initial placement is for europe - dunno how to tune that yet
def write_header (self):
+ if not self.options.nodegroup:
+ title="%s sites"%api.config.PLC_NAME
+ detailed="All the sites known to the %s testbed"%api.config.PLC_NAME
+ else:
+ title="Nodegroup %s"%self.options.nodegroup
+ detailed="All sites involved in nodegroup %s"%self.options.nodegroup
self.write("""
" - description += "Testbed" - description += " | " + description += " | |||||||||||||||
Testbed | " (peername,peerurl) = self.peer_info (site,peers) - description += " %(peername)s "%locals() - #description += "[description]"%locals() - description += ""
- description += " | "
+ description += "
| "
# URL
if site['url']:
site_url=site['url']
- description += "||||||||||||||
" - description += "Website" - description += " | " + description += " | |||||||||||||||
Website | " + description += "" description += " %(site_url)s "%locals() - description += " | |||||||||||||||
Nodegroup | " + description += "" + description += " %(nodegroup)s "%locals() + description += " | " + description += "|||||||||||||||
Usage details: | ||||||||||||||||
Usage | " + + # encapsulate usage in a table of its own + description += ""
+ description += "
|