Perform action on specific file types.

        Dynamic dispatch function for performing actions on
        specific file types.

def _perform_file_action(self, filename, action):
        """Perform action on specific file types.

        Dynamic dispatch function for performing actions on
        specific file types.
        """
        ext = os.path.splitext(filename)[1]
        try:
            func = getattr(self, '_{}_{}'.format(action, ext[1:]))
        except AttributeError:
            raise Exception('Unsupported file type {}'.format(ext[1:]))
        func(filename)