def process_composite(self, response):
composite = response["<STR_LIT>"]<EOL>if not isinstance(composite, Composite):<EOL><INDENT>composite = Composite(composite)<EOL><DEDENT>composite = composite.simplify().get_content()<EOL>response["<STR_LIT>"] = composite<EOL>if not isinstance(composite, list):<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>if not len(composite):<EOL><INDENT>return<EOL><DEDENT>if "<STR_LIT>" in response:<EOL><INDENT>err = '<STR_LIT>'<EOL>raise Exception(err)<EOL><DEDENT>if "<STR_LIT>" in self.py3status_module_options:<EOL><INDENT>markup = self.py3status_module_options["<STR_LIT>"]<EOL>for item in composite:<EOL><INDENT>item["<STR_LIT>"] = markup<EOL><DEDENT><DEDENT>composite[-<NUM_LIT:1>].update(self.i3bar_module_options)<EOL>color = response.get("<STR_LIT>")<EOL>urgent = response.get("<STR_LIT>")<EOL>composite_length = len(response["<STR_LIT>"]) - <NUM_LIT:1><EOL>for index, item in enumerate(response["<STR_LIT>"]):<EOL><INDENT>if "<STR_LIT>" not in item:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if "<STR_LIT:name>" not in item:<EOL><INDENT>instance_index = item.get("<STR_LIT:index>", index)<EOL>item["<STR_LIT>"] = "<STR_LIT>".format(self.module_inst, instance_index)<EOL>item["<STR_LIT:name>"] = self.module_name<EOL><DEDENT>if index != composite_length:<EOL><INDENT>if "<STR_LIT>" not in item:<EOL><INDENT>item["<STR_LIT>"] = False<EOL>item["<STR_LIT>"] = <NUM_LIT:0><EOL><DEDENT><DEDENT>if color and "<STR_LIT>" not in item:<EOL><INDENT>item["<STR_LIT>"] = color<EOL><DEDENT>if hasattr(item.get("<STR_LIT>"), "<STR_LIT>"):<EOL><INDENT>del item["<STR_LIT>"]<EOL><DEDENT>for key, value in self.i3bar_gaps_module_options.items():<EOL><INDENT>if (key == "<STR_LIT>" and index != <NUM_LIT:0>) or (<EOL>key == "<STR_LIT>" and index != composite_length<EOL>):<EOL><INDENT>item[key] = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>item[key] = value<EOL><DEDENT><DEDENT>if not self.allow_urgent:<EOL><INDENT>if "<STR_LIT>" in item:<EOL><INDENT>del item["<STR_LIT>"]<EOL><DEDENT><DEDENT>elif urgent:<EOL><INDENT>if self.i3bar_gaps_urgent_options:<EOL><INDENT>for key, value in self.i3bar_gaps_urgent_options.items():<EOL><INDENT>if (key == "<STR_LIT>" and index != <NUM_LIT:0>) or (<EOL>key == "<STR_LIT>" and index != composite_length<EOL>):<EOL><INDENT>item[key] = <NUM_LIT:0><EOL><DEDENT>elif key == "<STR_LIT>":<EOL><INDENT>item["<STR_LIT>"] = value<EOL><DEDENT>else:<EOL><INDENT>item[key] = value<EOL><DEDENT><DEDENT>if "<STR_LIT>" in item:<EOL><INDENT>del item["<STR_LIT>"]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>item["<STR_LIT>"] = urgent<EOL><DEDENT><DEDENT><DEDENT>if "<STR_LIT>" in self.py3status_module_options:<EOL><INDENT>min_length = self.py3status_module_options["<STR_LIT>"]<EOL>length = sum([len(x["<STR_LIT>"]) for x in response["<STR_LIT>"]])<EOL>if length >= min_length:<EOL><INDENT>return<EOL><DEDENT>padding = int((min_length / <NUM_LIT>) - (length / <NUM_LIT>))<EOL>offset = min_length - ((padding * <NUM_LIT:2>) + length)<EOL>position = self.py3status_module_options.get("<STR_LIT>", "<STR_LIT:left>")<EOL>if position == "<STR_LIT>":<EOL><INDENT>left = right = "<STR_LIT:U+0020>" * padding<EOL>if self.random_int:<EOL><INDENT>left += "<STR_LIT:U+0020>" * offset<EOL><DEDENT>else:<EOL><INDENT>right += "<STR_LIT:U+0020>" * offset<EOL><DEDENT><DEDENT>elif position == "<STR_LIT:left>":<EOL><INDENT>left, right = "<STR_LIT>", "<STR_LIT:U+0020>" * (padding * <NUM_LIT:2> + offset)<EOL><DEDENT>elif position == "<STR_LIT:right>":<EOL><INDENT>right, left = "<STR_LIT>", "<STR_LIT:U+0020>" * (padding * <NUM_LIT:2> + offset)<EOL><DEDENT>if left:<EOL><INDENT>response["<STR_LIT>"][<NUM_LIT:0>]["<STR_LIT>"] = (<EOL>left + response["<STR_LIT>"][<NUM_LIT:0>]["<STR_LIT>"]<EOL>)<EOL><DEDENT>if right:<EOL><INDENT>response["<STR_LIT>"][-<NUM_LIT:1>]["<STR_LIT>"] += right<EOL><DEDENT><DEDENT>
Process a composite response.
composites do not have inter item separators as they appear joined.
We need to respect the universal options too.