def set_module_options(self, module):
self.i3bar_module_options = {}<EOL>self.i3bar_gaps_module_options = {}<EOL>self.py3status_module_options = {}<EOL>fn = self._py3_wrapper.get_config_attribute<EOL>def make_quotes(options):<EOL><INDENT>x = ["<STR_LIT>".format(x) for x in options]<EOL>if len(x) > <NUM_LIT:2>:<EOL><INDENT>x = ["<STR_LIT:U+002CU+0020>".join(x[:-<NUM_LIT:1>]), x[-<NUM_LIT:1>]]<EOL><DEDENT>return "<STR_LIT>".join(x)<EOL><DEDENT>min_width = fn(self.module_full_name, "<STR_LIT>")<EOL>if not hasattr(min_width, "<STR_LIT>"):<EOL><INDENT>if not isinstance(min_width, int):<EOL><INDENT>err = "<STR_LIT>"<EOL>err += "<STR_LIT>".format(min_width)<EOL>raise TypeError(err)<EOL><DEDENT>self.i3bar_module_options["<STR_LIT>"] = min_width<EOL>align = fn(self.module_full_name, "<STR_LIT>")<EOL>if not hasattr(align, "<STR_LIT>"):<EOL><INDENT>if align not in POSITIONS:<EOL><INDENT>err = "<STR_LIT>"<EOL>err += make_quotes(POSITIONS)<EOL>err += "<STR_LIT>".format(align)<EOL>raise ValueError(err)<EOL><DEDENT>self.i3bar_module_options["<STR_LIT>"] = align<EOL><DEDENT><DEDENT>separator = fn(self.module_full_name, "<STR_LIT>")<EOL>if not hasattr(separator, "<STR_LIT>"):<EOL><INDENT>if not isinstance(separator, bool):<EOL><INDENT>err = "<STR_LIT>"<EOL>err += "<STR_LIT>".format(separator)<EOL>raise TypeError(err)<EOL><DEDENT>self.i3bar_module_options["<STR_LIT>"] = separator<EOL><DEDENT>separator_block_width = fn(self.module_full_name, "<STR_LIT>")<EOL>if not hasattr(separator_block_width, "<STR_LIT>"):<EOL><INDENT>if not isinstance(separator_block_width, int):<EOL><INDENT>err = "<STR_LIT>"<EOL>err += "<STR_LIT>"<EOL>err += "<STR_LIT>".format(separator_block_width)<EOL>raise TypeError(err)<EOL><DEDENT>self.i3bar_module_options["<STR_LIT>"] = separator_block_width<EOL><DEDENT>background = fn(self.module_full_name, "<STR_LIT>")<EOL>if not hasattr(background, "<STR_LIT>"):<EOL><INDENT>color = self.module_class.py3._get_color(background)<EOL>if not color:<EOL><INDENT>err = "<STR_LIT>"<EOL>err += "<STR_LIT>".format(background)<EOL>raise ValueError(err)<EOL><DEDENT>self.i3bar_gaps_module_options["<STR_LIT>"] = color<EOL><DEDENT>border = fn(self.module_full_name, "<STR_LIT>")<EOL>if not hasattr(border, "<STR_LIT>"):<EOL><INDENT>color = self.module_class.py3._get_color(border)<EOL>if not color:<EOL><INDENT>err = "<STR_LIT>"<EOL>err += "<STR_LIT>".format(border)<EOL>raise ValueError(err)<EOL><DEDENT>self.i3bar_gaps_module_options["<STR_LIT>"] = color<EOL>borders = ["<STR_LIT>", "<STR_LIT:right>", "<STR_LIT>", "<STR_LIT:left>"]<EOL>for name in ["<STR_LIT>" + x for x in borders]:<EOL><INDENT>param = fn(self.module_full_name, name)<EOL>if hasattr(param, "<STR_LIT>"):<EOL><INDENT>param = <NUM_LIT:1><EOL><DEDENT>elif not isinstance(param, int):<EOL><INDENT>err = "<STR_LIT>".format(name)<EOL>err += "<STR_LIT>"<EOL>err += "<STR_LIT>".format(param)<EOL>raise TypeError(err)<EOL><DEDENT>self.i3bar_gaps_module_options[name] = param<EOL><DEDENT><DEDENT>min_length = fn(self.module_full_name, "<STR_LIT>")<EOL>if not hasattr(min_length, "<STR_LIT>"):<EOL><INDENT>if not isinstance(min_length, int):<EOL><INDENT>err = "<STR_LIT>"<EOL>err += "<STR_LIT>".format(min_length)<EOL>raise TypeError(err)<EOL><DEDENT>self.py3status_module_options["<STR_LIT>"] = min_length<EOL>self.random_int = randint(<NUM_LIT:0>, <NUM_LIT:1>)<EOL>position = fn(self.module_full_name, "<STR_LIT>")<EOL>if not hasattr(position, "<STR_LIT>"):<EOL><INDENT>if position not in POSITIONS:<EOL><INDENT>err = "<STR_LIT>"<EOL>err += make_quotes(POSITIONS)<EOL>err += "<STR_LIT>".format(position)<EOL>raise ValueError(err)<EOL><DEDENT>self.py3status_module_options["<STR_LIT>"] = position<EOL><DEDENT><DEDENT>markup = fn(self.module_full_name, "<STR_LIT>")<EOL>if not hasattr(markup, "<STR_LIT>"):<EOL><INDENT>if markup not in MARKUP_LANGUAGES:<EOL><INDENT>err = "<STR_LIT>"<EOL>err += make_quotes(MARKUP_LANGUAGES)<EOL>err += "<STR_LIT>".format(markup)<EOL>raise ValueError(err)<EOL><DEDENT>self.i3bar_module_options["<STR_LIT>"] = markup<EOL>self.py3status_module_options["<STR_LIT>"] = markup<EOL><DEDENT>
Set universal module options to be interpreted by i3bar
https://i3wm.org/i3status/manpage.html#_universal_module_options