A simple generator that yields a File or Folder object based on
        the arguments.

def walk(self, walk_folders=False, walk_files=False):
        """
        A simple generator that yields a File or Folder object based on
        the arguments.
        """

        if not walk_files and not walk_folders:
            return

        for root, _, a_files in os.walk(self.folder.path, followlinks=True):
            folder = Folder(root)
            if walk_folders:
                yield folder
            if walk_files:
                for a_file in a_files:
                    if (not self.pattern or fnmatch.fnmatch(a_file,
                                                            self.pattern)):
                        yield File(folder.child(a_file))