ubersmith远程模块服务器
ubersmith-remote-module-server的Python项目详细描述
Ubersmith远程模块服务器
对提议的ubersmith webhook格式(method、params、env和callback)进行标准化, 这是一种将任何python对象服务为“bersmith远程模块”的简单方法。
任务
提供一种用python编写设备、订单和服务模块的简单方法,代码行越少越好。
视野
一个远程“hello world”设备模块应该能容纳20行以下。
值
- 每件事都应该经过检验,并且容易理解。
示例
>>> from ubersmith_remote_module_server import server >>> class MyDeviceModule(object): ... def hello(self, env): ... return "world" ... >>> s = server.Server({'my_device_module': MyDeviceModule()}) >>> s.run() * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)