def __init__(self,serviceName,childManager = ChildsManager()): """初始化根节点 """ pb.Root() self.service = services.Service(serviceName) self.childsmanager = childManager
def login(self, name): try: response = services.Service().login(name, Common.pwdOne) token = response['data']['token'] Utils.Utils.headers['headerToken'] = token print(token) #return response return ("用户的ID是:", DB.DB().get_userid(name)) except Exception as ex: raise ex
def patch_service(name, data): if name in services.all: print('Patching', name, data) services.all[name].config = data['config'] services.all[name].handler = data['handler'] services.all[name].reload() else: print('Creating', name, data) serv = services.Service(name, data['config'], data['handler']) services.all[name] = serv serv.start()
#coding:utf8 ''' Created on 2011-10-17 @author: lan ''' import services from distributed.root import PBRoot, BilateralFactory from twisted.internet import reactor from twisted.python import log import sys reactor = reactor log.startLogging(sys.stdout) root = PBRoot() ser = services.Service('test') root.addServiceChannel(ser) def serviceHandle(target): '''服务处理 @param target: func Object ''' ser.mapTarget(target) @serviceHandle def printData1(data, data1): print data, data1 print "############################" # d = root.callChildByName("test_node",1,u'Root测试')
def logout(self): try: response = services.Service().logout() return (response) except Exception as ex: raise ex
def Klines(self, symbolId, type): try: response = services.Service().Klines(symbolId, type) return (response) except Exception as ex: raise ex
def trade(self, symbol, type, price, amount, source): response = services.Service().trade(symbol, type, price, amount, source) print(response)
def confirmar_validable_form(request): service = services.Service() form = service.confirmar_validable_form(request) return render(request, 'validable/confirmar_validable.html', {'form': form})
def confirmar_validable(request): service = services.Service() status, resp = service.confirmar_validable(request) return HttpResponse(resp, status = status) #end def