def process_directive(self, directive):
<EOL>action, patterns, thedir, dirpattern = self._parse_directive(directive)<EOL>if action == '<STR_LIT>':<EOL><INDENT>for pattern in patterns:<EOL><INDENT>if not self._include_pattern(pattern, anchor=True):<EOL><INDENT>logger.warning('<STR_LIT>', pattern)<EOL><DEDENT><DEDENT><DEDENT>elif action == '<STR_LIT>':<EOL><INDENT>for pattern in patterns:<EOL><INDENT>found = self._exclude_pattern(pattern, anchor=True)<EOL><DEDENT><DEDENT>elif action == '<STR_LIT>':<EOL><INDENT>for pattern in patterns:<EOL><INDENT>if not self._include_pattern(pattern, anchor=False):<EOL><INDENT>logger.warning('<STR_LIT>'<EOL>'<STR_LIT>', pattern)<EOL><DEDENT><DEDENT><DEDENT>elif action == '<STR_LIT>':<EOL><INDENT>for pattern in patterns:<EOL><INDENT>found = self._exclude_pattern(pattern, anchor=False)<EOL><DEDENT><DEDENT>elif action == '<STR_LIT>':<EOL><INDENT>for pattern in patterns:<EOL><INDENT>if not self._include_pattern(pattern, prefix=thedir):<EOL><INDENT>logger.warning('<STR_LIT>'<EOL>'<STR_LIT>', pattern, thedir)<EOL><DEDENT><DEDENT><DEDENT>elif action == '<STR_LIT>':<EOL><INDENT>for pattern in patterns:<EOL><INDENT>found = self._exclude_pattern(pattern, prefix=thedir)<EOL><DEDENT><DEDENT>elif action == '<STR_LIT>':<EOL><INDENT>if not self._include_pattern(None, prefix=dirpattern):<EOL><INDENT>logger.warning('<STR_LIT>',<EOL>dirpattern)<EOL><DEDENT><DEDENT>elif action == '<STR_LIT>':<EOL><INDENT>if not self._exclude_pattern(None, prefix=dirpattern):<EOL><INDENT>logger.warning('<STR_LIT>'<EOL>'<STR_LIT>', dirpattern)<EOL><DEDENT><DEDENT>else:   <EOL><INDENT>raise DistlibException(<EOL>'<STR_LIT>' % action)<EOL><DEDENT>
Process a directive which either adds some files from ``allfiles`` to
``files``, or removes some files from ``files``.

:param directive: The directive to process. This should be in a format
             compatible with distutils ``MANIFEST.in`` files:

             http://docs.python.org/distutils/sourcedist.html#commands