class NanomsgPublisher(Publisher):
    def __init__(self, addr):
        super(NanomsgPublisher, self)
        self.chan = Channel(addr, 'Pub', True)

    def pub(self, msg):
        self.chan.send(msg)
Example #2
0
class NanomsgRequester(Requester):
    def __init__(self, addr):
        super(NanomsgRequester, self)
        self._chan = Channel(addr, 'Pair', False)

    def req(self, msg):
        return self._chan.send(msg)

    def recv(self):
        return self._chan.recv()
class NanomsgSubscriber(Subscriber):
    def __init__(self, addr):
        super(NanomsgSubscriber, self)
        self.chan = Channel(addr, 'Sub', False)

    def update(self):
        return self.chan.recv(blocking=False)
Example #4
0
class NanomsgResponser(Responser):
    def __init__(self, addr):
        super(NanomsgResponser, self)
        self._chan = Channel(addr, 'Pair', True)

    def rep(self, msg):
        raise NotImplementedError

    def recv(self):
        return self._chan.recv()
Example #5
0
 def __init__(self, eventModel, mongoClient, user, emotes, actionQueue):
     self._event = eventModel
     self._user = user
     self._identityUtil = IdentityUtil()
     self._randomUtil = Random()
     self._banUtil = Ban()
     self._channelUtil = Channel()
     self._mongoUtil = Mongo(mongoClient)
     self._triggerUtil = Trigger(eventModel)
     self._emoteUtil = Emote(emotes)
     self._queue = actionQueue
 def __init__(self, addr):
     super(NanomsgPublisher, self)
     self.chan = Channel(addr, 'Pub', True)
 def __init__(self, addr):
     super(NanomsgSubscriber, self)
     self.chan = Channel(addr, 'Sub', False)
Example #8
0
import time
from gui.GUI.widgets import *
from utils.channel import Channel

sub = Channel()


class Extractor_GUI():
    def __init__(self, width, height):
        self.__init_gui(width, height)
        # self.__init_model()

    def __init_gui(self, width, height):
        self.width = width
        self.height = height

        self.window = tk.Tk()
        self.window.wm_title('识人模型演示')
        self.window.config(background='#FFFFFF')
        # self.window.geometry("960x640")    # 窗体大小
        self.window.geometry("1077x640")  # 窗体大小

        self.canvas = ICanvas(self.window, width=width, height=height)
        self.canvas.grid(row=0, column=0)

        self.fm_control = tk.Frame(self.window,
                                   width=800,
                                   height=100,
                                   background='#FFFFFF')
        self.fm_control.grid(row=1, column=0, padx=10, pady=2)
        self.btn_prev_frame = tk.Button(self.fm_control,
Example #9
0
 def __init__(self, addr):
     super(NanomsgResponser, self)
     self._chan = Channel(addr, 'Pair', True)
Example #10
0
 def __init__(self, addr):
     super(NanomsgRequester, self)
     self._chan = Channel(addr, 'Pair', False)