Example #1
0
 def get(self):
     wellwish = json.loads(self.request.get('wish'))
     name = wellwish['name']
     try:
         wishargs = wellwish['wishargs']
     except:
         wishargs = None
     if name == 'myPixel':
         grant = wish.myPixel()
     elif name == 'aSession':
         grant = wish.aSession()
     elif name == 'rPulse':
         if wishargs:
             if isinstance(wishargs, dict):
                 wish.PulseRouter(wishargs)
                 grant = wish.myPixel()       
             else:
                 pass
         else:
             pass
     elif name == 'fAllPixelIDs':
         if wishargs:
             grant = wish.fAllPixelIDs(wishargs)
         else:
             grant = wish.fAllPixels()
     elif name == 'updateLoc':
         if wishargs:
             grant = wish.updateLoc(wishargs)
         else:
             grant = 'Need arguments yo!'
     elif name == 'censusUpdate':
         if wishargs:
             grant = loc.UpdateLocations(wishargs).test()
         else:
             grant = 'Need arguments yo!'
     elif name == 'getCensus':
         grant = loc.UpdateLocations().getCachedCensus()
     elif name == 'getStoredCensus':
         grant = loc.UpdateLocations().getStoredCensus()
     else:
         grant = 'wish not granted'
     #cpix.grant = wish#['name']
     #cpix.anothertest = 'anothertest'
     self.response.out.write(jsonify(grant))
Example #2
0
 def get(self):
     sesh = wish.aSession()
     self.response.out.write(jsonify(sesh))