Beispiel #1
0
 def __init__(self, config_file="config/config.yaml"):
     self.s_utrcClient = TYFiberBot_Mang_NATS_UTRClient_Instance(
         config_file)
     self.strMyFBotID = CTylb_Bot_Exec_Frame.ReadIniSectionValue(
         config_file, Share_UTRC_CfgDef.g_str_section_FBot,
         Share_UTRC_CfgDef.g_str_key_myid, "")
     self.Prepare()
class PyFiber_FBotClient_Test1:
    '''
    用例交互协议说明:

    Test1向Test2发送会话1。ID1000,Test2收到后,回复1001。 本地收到1001后,继续发送1000,重新循环

    '''
    def __init__(self):
        self.s_timeIdentify = CSkBot_Common_Share.CSkBot_TimeIdentify()
        self.s_utrcClient = TYFiberBot_Mang_NATS_UTRClient_Instance()

    def Prepare(self):
        self.s_utrcClient.AddFiberUnit(MyAppFiber_FBotExecClient_Test())

    def start(self):
        self.s_utrcClient.Run()
Beispiel #3
0
class PyFiber_PyBrainCore:
    def __init__(self, config_file="config/config.yaml"):
        self.s_utrcClient = TYFiberBot_Mang_NATS_UTRClient_Instance(
            config_file)
        self.strMyFBotID = CTylb_Bot_Exec_Frame.ReadIniSectionValue(
            config_file, Share_UTRC_CfgDef.g_str_section_FBot,
            Share_UTRC_CfgDef.g_str_key_myid, "")
        self.Prepare()

    def Prepare(self):
        # 准备,增加
        self.ExecAPICallFiber = Exec_API_CallFiber(self.strMyFBotID)
        self.s_utrcClient.AddFiberUnit(self.ExecAPICallFiber)
        pass

    def TimerCheck(self):
        self.s_utrcClient.LoopEventCallBack()
class PyFiberTest1:
    '''
    用例交互协议说明:

    Test1向Test2发送会话1。ID1000,Test2收到后,回复1001。 本地收到1001后,继续发送1000,重新循环

    '''

    def __init__(self):
        self.s_timeIdentify = CSkBot_Common_Share.CSkBot_TimeIdentify()
        self.s_utrcClient = TYFiberBot_Mang_NATS_UTRClient_Instance()

    '''
    def HandleRecv_100(self, value, param1, param2, is_last_package):
        #CTYLB_Log.ShowLog(0,'hello', "recv-1001")
        retCTUnitArray = []
        if(is_last_package):
            if(self.timeIdentify.CheckShow()):
                sendCTUnit = FBot.make_package(100, "", "", "testzhuangshiqi")
                retCTUnitArray = [sendCTUnit]
        return retCTUnitArray


    def HandleRecv_200(self, value, param1, param2, is_last_package):
        CTYLB_Log.ShowLog(0,'hello', "recv-1000")

        retCTUnitArray = []
        #if(is_last_package):
        #    sendCTUnit = FBot.make_package(1001, "aa", "bb", "testzhuangshiqi-test2")
        #    retCTUnitArray = [sendCTUnit]
        return retCTUnitArray
    '''

    def Prepare(self):
        self.s_utrcClient.AddFiberUnit(MyAppFiber_Sub_First())


    def start(self):
        self.s_utrcClient.Run()
        '''
Beispiel #5
0
 def Run():
     timeIdentify = CSkBot_Common_Share.CSkBot_TimeIdentify()
     utrcClinet = TYFiberBot_Mang_NATS_UTRClient_Instance()
     utrcClinet.AddFiberUnit(AIOSWebOSFiber())
     utrcClinet.Run()
 def __init__(self):
     self.s_timeIdentify = CSkBot_Common_Share.CSkBot_TimeIdentify()
     self.s_utrcClient = TYFiberBot_Mang_NATS_UTRClient_Instance()
Beispiel #7
0
 def __init__(self, config_file="config/config.yaml", funcCallBack=None):
     TYFiberBot_Mang_NATS_UTRClient_Instance.__init__(self, config_file, funcCallBack)