Beispiel #1
0
 def remove_classifications(self):
     q = Classification.all(keys_only=True)
     q.filter('tileset',self.ts) 
     if q.count():
         db.delete(q.fetch(INDEX_BATCH_SIZE))
         self.write("<b>Remove Classifications:</b>Removing, refresh until done.<br />")
     else:
         self.write("<b>Remove Classifications: DONE.</b><br />")
Beispiel #2
0
 def real_get(self):
     ts = self.ts
     if ts:
         self.write("Found TileSet: "+ts.name)
         self.write("<br />")
         img_src = '/o.png?ts='+ts.name
         if self.request.get('cl'):
             img_src+= '&cl='+self.request.get('cl')
         if self.request.get('cs'):
             img_src+= '&cs='+self.request.get('cs')
         gmap = self.request.url.replace('/m/','/gmap/')
         self.write("<a href='%s'><img src='%s' /></a><br />"%(gmap,img_src))
         args = {}
         args['name'] = ts.name
         args['pub'] = "Public" if ts.public else "Private"
         args['cLat'] = ts.cLat
         args['cLng'] = ts.cLng
         args['maxZoom'] = ts.maxZoom
         self.write("<b>%(name)s</b> is a <b>%(pub)s</b> TileSet with a centriod of <b>(%(cLng).4f , %(cLat).4f)\
                     </b> and a maximium zoom level of <b>%(maxZoom)d</b>.<br />"%args)
         self.write("Notes: %s<br />"%ts.notes)
         self.write("Source: %s<br />"%ts.source)
         self.write("ID Spreadsheet: <a href='/ids.csv?ts=%s'>ids.csv </a>"%ts.name)
         self.write('<br><br><hr>')
         self.write('<a href="classify?ts=%s">Classify this Tile Set.</a>'%ts.name)
         q = Classification.all(keys_only=True)
         q.filter('tileset',ts)
         q.filter('public',True)
         if q.count():
             self.write("Classifications for this TileSet:<br>")
         #q.filter('expires',Flase)
         for cl_key in q:
             cl = Classification.get(cl_key)
             if cl.name:
                 cl = cl.name
             else:
                 cl = 'key_%s'%cl_key
             self.write('<A href="/m/?ts=%s&cl=%s">%s</a><br>'%(ts.name,cl,cl))