cylindertransport-web.py

changeset 19
32de35694e56
parent 18
ff1941c85fd3
child 21
41083328ca82
equal deleted inserted replaced
18:ff1941c85fd3 19:32de35694e56
27 buffer = cStringIO.StringIO() 27 buffer = cStringIO.StringIO()
28 image.save(buffer, format="PNG") 28 image.save(buffer, format="PNG")
29 img_str = base64.b64encode(buffer.getvalue()) 29 img_str = base64.b64encode(buffer.getvalue())
30 print json.dumps({ 30 print json.dumps({
31 "objects": calc.circles, 31 "objects": calc.circles,
32 "offset": (calc.width - (2 * calc.margin)) / 2,
32 "scale3d": config.SCALE3D, 33 "scale3d": config.SCALE3D,
33 "image": img_str 34 "image": img_str
34 }) 35 })
35 else: 36 else:
36 print "unknown Action %s" % args["action"].value 37 print "unknown Action %s" % args["action"].value

mercurial