示例#1
0
    def __init__(self,serviceName,childManager = ChildsManager()):
        """初始化根节点
        """
        pb.Root()

        self.service = services.Service(serviceName)
        self.childsmanager = childManager
示例#2
0
文件: ComMeth.py 项目: 5BF/API_python
 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
示例#3
0
文件: app.py 项目: carzil/portcullis
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()
示例#4
0
#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测试')
示例#5
0
文件: ComMeth.py 项目: 5BF/API_python
 def logout(self):
     try:
         response = services.Service().logout()
         return (response)
     except Exception as ex:
         raise ex
示例#6
0
文件: ComMeth.py 项目: 5BF/API_python
 def Klines(self, symbolId, type):
     try:
         response = services.Service().Klines(symbolId, type)
         return (response)
     except Exception as ex:
         raise ex
示例#7
0
文件: ComMeth.py 项目: 5BF/API_python
 def trade(self, symbol, type, price, amount, source):
     response = services.Service().trade(symbol, type, price, amount,
                                         source)
     print(response)
示例#8
0
文件: views.py 项目: exildev/grit
def confirmar_validable_form(request):
	service = services.Service()
	form = service.confirmar_validable_form(request)
	return render(request, 'validable/confirmar_validable.html', {'form': form})
示例#9
0
文件: views.py 项目: exildev/grit
def confirmar_validable(request):
	service = services.Service()
	status, resp = service.confirmar_validable(request)
	return HttpResponse(resp, status = status)
#end def