@profile<EOL><INDENT>def run(self):<DEDENT>
<EOL>signal(SIGUSR1, self.sig_handler)<EOL>signal(SIGTERM, self.terminate)<EOL>py3_config = self.config["<STR_LIT>"]<EOL>self.create_mappings(py3_config)<EOL>self.create_output_modules()<EOL>for module in self.modules.values():<EOL><INDENT>task = ModuleRunner(module)<EOL>self.timeout_queue_add(task)<EOL><DEDENT>output = [None] * len(py3_config["<STR_LIT>"])<EOL>write = sys.__stdout__.write<EOL>flush = sys.__stdout__.flush<EOL>header = {<EOL>"<STR_LIT:version>": <NUM_LIT:1>,<EOL>"<STR_LIT>": self.config["<STR_LIT>"],<EOL>"<STR_LIT>": SIGTSTP,<EOL>}<EOL>write(dumps(header))<EOL>write("<STR_LIT>")<EOL>update_due = None<EOL>while True:<EOL><INDENT>update_due = self.timeout_queue_process()<EOL>if self.update_request.wait(timeout=update_due):<EOL><INDENT>self.update_request.clear()<EOL><DEDENT>while not self.i3bar_running:<EOL><INDENT>time.sleep(<NUM_LIT:0.1>)<EOL><DEDENT>if self.update_queue:<EOL><INDENT>while len(self.update_queue):<EOL><INDENT>module_name = self.update_queue.popleft()<EOL>module = self.output_modules[module_name]<EOL>out = self.process_module_output(module)<EOL>for index in module["<STR_LIT>"]:<EOL><INDENT>output[index] = out<EOL><DEDENT><DEDENT>out = "<STR_LIT:U+002C>".join([x for x in output if x])<EOL>write("<STR_LIT>".format(out))<EOL>flush()<EOL><DEDENT><DEDENT>
Main py3status loop, continuously read from i3status and modules
and output it to i3bar for displaying.