Пример #1
0
 def h(self,id):
     hashCheck = shorturl.shortURL(self.metadata)
     res = hashCheck.getDataFromHash(id)
     if( len(res) > 0 ):
         return self.index(True,res)
     else:
         return self.index(False,res)
Пример #2
0
 def h(self, id):
     hashCheck = shorturl.shortURL(self.metadata)
     res = hashCheck.getDataFromHash(id)
     if (len(res) > 0):
         return self.index(True, res)
     else:
         return self.index(False, res)
Пример #3
0
 def addhash(self,mlon,mlat,zoom,slon,slat,dlon,dlat,saddress,daddress,time):
     cherrypy.response.headers['Content-Type']= 'application/json'
     hashAdd = shorturl.shortURL(self.metadata)
     hmd5 =hashAdd.addRouteToDatabase(mlon,mlat,zoom,slon,slat,dlon,dlat,saddress,daddress, time)
     if( len(hmd5) > 0 ):
         return json.dumps({ 'h': hmd5 })
     else:
         return '{"error": "Add to DB failed"}'
Пример #4
0
 def addhash(self, mlon, mlat, zoom, slon, slat, dlon, dlat, saddress,
             daddress, time):
     cherrypy.response.headers['Content-Type'] = 'application/json'
     hashAdd = shorturl.shortURL(self.metadata)
     hmd5 = hashAdd.addRouteToDatabase(mlon, mlat, zoom, slon, slat, dlon,
                                       dlat, saddress, daddress, time)
     if (len(hmd5) > 0):
         ret = {'h': hmd5}
         return json.dumps(ret)
     else:
         return '{"error": "Add to DB failed"}'