@classmethod<EOL><INDENT>def load(cls, profile_name=None):<DEDENT>
lsi_location = os.path.expanduser('<STR_LIT>')<EOL>if not os.path.exists(lsi_location):<EOL><INDENT>return LsiProfile()<EOL><DEDENT>cfg_parser = ConfigParser()<EOL>cfg_parser.read(lsi_location)<EOL>if profile_name is None:<EOL><INDENT>if cfg_parser.has_section('<STR_LIT:default>'):<EOL><INDENT>profile_name = '<STR_LIT:default>'<EOL><DEDENT>else:<EOL><INDENT>return cls()<EOL><DEDENT><DEDENT>elif not cfg_parser.has_section(profile_name):<EOL><INDENT>raise cls.LoadError('<STR_LIT>'.format(profile_name))<EOL><DEDENT>def _get(option, alt=None):<EOL><INDENT>"""<STR_LIT>"""<EOL>if cfg_parser.has_option(profile_name, option):<EOL><INDENT>return cfg_parser.get(profile_name, option)<EOL><DEDENT>else:<EOL><INDENT>return alt<EOL><DEDENT><DEDENT>if cfg_parser.has_option(profile_name, '<STR_LIT>'):<EOL><INDENT>profile = cls.load(cfg_parser.get(profile_name, '<STR_LIT>'))<EOL><DEDENT>else:<EOL><INDENT>profile = cls()<EOL><DEDENT>profile.override('<STR_LIT:username>', _get('<STR_LIT:username>'))<EOL>profile.override('<STR_LIT>', _get('<STR_LIT>'))<EOL>profile.override('<STR_LIT>', _get('<STR_LIT>'))<EOL>filters = [s for s in _get('<STR_LIT>', '<STR_LIT>').split('<STR_LIT:U+002C>') if len(s) > <NUM_LIT:0>]<EOL>exclude = [s for s in _get('<STR_LIT>', '<STR_LIT>').split('<STR_LIT:U+002C>') if len(s) > <NUM_LIT:0>]<EOL>profile.filters.extend(filters)<EOL>profile.exclude.extend(exclude)<EOL>return profile<EOL>
Loads the user's LSI profile, or provides a default.