def _parse_directive(self, directive):
words = directive.split()<EOL>if len(words) == <NUM_LIT:1> and words[<NUM_LIT:0>] not in ('<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>words.insert(<NUM_LIT:0>, '<STR_LIT>')<EOL><DEDENT>action = words[<NUM_LIT:0>]<EOL>patterns = thedir = dir_pattern = None<EOL>if action in ('<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>if len(words) < <NUM_LIT:2>:<EOL><INDENT>raise DistlibException(<EOL>'<STR_LIT>' % action)<EOL><DEDENT>patterns = [convert_path(word) for word in words[<NUM_LIT:1>:]]<EOL><DEDENT>elif action in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>if len(words) < <NUM_LIT:3>:<EOL><INDENT>raise DistlibException(<EOL>'<STR_LIT>' % action)<EOL><DEDENT>thedir = convert_path(words[<NUM_LIT:1>])<EOL>patterns = [convert_path(word) for word in words[<NUM_LIT:2>:]]<EOL><DEDENT>elif action in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>if len(words) != <NUM_LIT:2>:<EOL><INDENT>raise DistlibException(<EOL>'<STR_LIT>' % action)<EOL><DEDENT>dir_pattern = convert_path(words[<NUM_LIT:1>])<EOL><DEDENT>else:<EOL><INDENT>raise DistlibException('<STR_LIT>' % action)<EOL><DEDENT>return action, patterns, thedir, dir_pattern<EOL>
Validate a directive.
:param directive: The directive to validate.
:return: A tuple of action, patterns, thedir, dir_patterns