def parse_list_or_docstring(options, sps):
import py3status.docstrings as docstrings<EOL>home_path = os.path.expanduser("<STR_LIT>")<EOL>xdg_home_path = os.environ.get("<STR_LIT>", "<STR_LIT>".format(home_path))<EOL>options.include_paths = [<EOL>"<STR_LIT>".format(xdg_home_path),<EOL>"<STR_LIT>".format(xdg_home_path),<EOL>"<STR_LIT>".format(xdg_home_path),<EOL>"<STR_LIT>".format(home_path),<EOL>]<EOL>include_paths = []<EOL>for path in options.include_paths:<EOL><INDENT>path = os.path.abspath(path)<EOL>if os.path.isdir(path) and os.listdir(path):<EOL><INDENT>include_paths.append(path)<EOL><DEDENT><DEDENT>options.include_paths = include_paths<EOL>config = vars(options)<EOL>modules = [x.rsplit("<STR_LIT>", <NUM_LIT:1>)[<NUM_LIT:0>] for x in config["<STR_LIT>"]]<EOL>if config["<STR_LIT>"] == "<STR_LIT:list>":<EOL><INDENT>tests = [not config[x] for x in ["<STR_LIT:all>", "<STR_LIT:user>", "<STR_LIT>"]]<EOL>if all([not modules] + tests):<EOL><INDENT>msg = "<STR_LIT>"<EOL>sps["<STR_LIT:list>"].error(msg)<EOL><DEDENT>docstrings.show_modules(config, modules)<EOL><DEDENT>elif config["<STR_LIT>"] == "<STR_LIT>":<EOL><INDENT>if config["<STR_LIT>"]:<EOL><INDENT>docstrings.check_docstrings(False, config, modules)<EOL><DEDENT>elif config["<STR_LIT>"]:<EOL><INDENT>docstrings.check_docstrings(True, config, None)<EOL><DEDENT>elif config["<STR_LIT>"]:<EOL><INDENT>if not modules:<EOL><INDENT>msg = "<STR_LIT>"<EOL>sps["<STR_LIT>"].error(msg)<EOL><DEDENT>if "<STR_LIT>" in modules:<EOL><INDENT>docstrings.update_docstrings()<EOL><DEDENT>else:<EOL><INDENT>docstrings.update_readme_for_modules(modules)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>msg = "<STR_LIT>"<EOL>sps["<STR_LIT>"].error(msg)<EOL><DEDENT><DEDENT>
Handle py3-cmd list and docstring options.