@classmethod<EOL><INDENT>def from_string(cls, name, separator='<STR_LIT:->', reverse=False):<DEDENT>
recv = [t.strip() for t in name.split(separator)]<EOL>if len(recv) < <NUM_LIT:2>:<EOL><INDENT>logger.error('<STR_LIT>')<EOL>return None<EOL><DEDENT>if reverse:<EOL><INDENT>title = recv[<NUM_LIT:0>]<EOL>artist = '<STR_LIT>'.join(recv[<NUM_LIT:1>:])<EOL><DEDENT>else:<EOL><INDENT>artist = recv[<NUM_LIT:0>]<EOL>title = '<STR_LIT>'.join(recv[<NUM_LIT:1>:])<EOL><DEDENT>if not artist or not title:<EOL><INDENT>logger.error('<STR_LIT>')<EOL>return None<EOL><DEDENT>song = cls(artist, title)<EOL>return song<EOL>
Class constructor using a string with the artist and title. This should
be used when parsing user input, since all the information must be
specified in a single string formatted as: '{artist} - {title}'.