Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2021
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. @cherrypy.expose
  2. @cherrypy.tools.json_out()
  3. @cherrypy.tools.json_in()
  4. def api(self):
  5. jsonIn = cherrypy.request.json
  6. print (jsonIn['method'])
  7. method = jsonIn['method'][0:16]
  8. method = re.sub(r'[^a-zA-Z0-9]','',method)
  9. method = 'SSAPI_' + method
  10. f = eval('self.' + method)
  11. f(jsonIn)
  12.  
  13. def SSAPI_test(self, params):
  14. print (params)
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement