Mercurial > code > home > repos > light9
view light9/curvecalc/client.py @ 1858:7772cc48e016
reformat all python
Ignore-this: 1135b78893f8b3d31badddda7f45678f
author | drewp@bigasterisk.com |
---|---|
date | Tue, 21 May 2019 23:56:12 +0000 |
parents | c756638275d6 |
children | f066d6e874db |
line wrap: on
line source
""" client code for talking to curvecalc """ import cyclone.httpclient from light9 import networking import urllib from run_local import log def sendLiveInputPoint(curve, value): f = cyclone.httpclient.fetch(networking.curveCalc.path('liveInputPoint'), method='POST', timeout=1, postdata=urllib.urlencode({ 'curve': curve, 'value': str(value), })) @f.addCallback def cb(result): if result.code // 100 != 2: raise ValueError("curveCalc said %s: %s", result.code, result.body) return f