class Module: def __init__(self): self.comm = Comm() def process(self): self.comm.send(FrameType.BUTTON_STATE, (1, 2, 3)) while self.comm.has_data(): print(self.comm.get_data()) print()
def main(): module = CLIController(Comm(), ["modules/swarm_ui/module/commands.json"]) while not should_stop and not module.stopped: module.process() sleep(0.05) module.stop()
def main(): """symbolic main""" print("Starting application...\n") module = Module(Comm()) print("Module created...") register_signal_callback(module.stop) with module: while not module.stopped: module.process() sleep(0.05)
def main(): print("Starting application...\n") module = Module(Comm()) print("Module created...") while not SHOULD_STOP: module.process() sleep(0.05) module.stop()
def main(): "entry point of the application" print("Starting application...\n") module = Module(Comm()) register_signal_callback(module.stop) print("Module created...") with module: while not module.stopped: module.process() time.sleep(0.05)
def main(): """ Main function that starts the module :return: """ print("Starting application...\n") module = Module(Comm(), TestButton()) print("Module created...") register_signal_callback(module.stop) with module: while not module.stopped: module.process() sleep(0.05)
def __init__(self): self.comm = Comm()