def __init__(self, master=None): global currentFrame self.thisMaster = master self.thisPublisher = publishSubscribe.Publisher(5557) self.subthread = SubscriberThread() self.subthread.start() self.widget = Frame(master) self.widget.pack() frame = ImageTk.PhotoImage(currentFrame) self.panel = Label(master, image=frame) self.panel.configure(image=frame) self.panel.image = frame self.panel.pack(side="bottom", fill="both", expand="yes") master.after(500, self.requestFrame) master.after(1000, self.updateFrame)
def __init__(self): self.publisherInstance = publishSubscribe.Publisher(5556) self.badWeatherChecker = CheckForBadWeather() Thread.__init__(self) self.start()
def __init__(self, cameraData): self.publisherInstance = publishSubscribe.Publisher(5556) self.cameraData = cameraData Thread.__init__(self)
def __init__(self): self.publisherInstance = publishSubscribe.Publisher(5556) self.fireChecker = CheckForFire() Thread.__init__(self) self.start()
import publishSubscribe import time #exemplo de como usar a classe Publisher #um Publisher que fica a cada 2 segundos enviando mensagens com prefixo prefix1 para a porta 5556 publisherInstance = publishSubscribe.Publisher(5557) while True: publisherInstance.publish(b"[SmartlockConfig] 1") print("TRANCOU") time.sleep(3) publisherInstance.publish(b"[SmartlockConfig] 0") print("DESTRANCOU") time.sleep(3)
def __init__(self): self.publisherInstance = publishSubscribe.Publisher(5557)