@@ -0,0 +1,1244 @@
+from __future__ import with_statement%0Aimport os%0Aimport re%0A%0A%0Aclass FileCollector(list):%0A%0A    def __init__(self, path, config=None):%0A        config = config or %7B%7D%0A        self.user_match = config.get('match')%0A        self.case_insensitive = config.get('ignorecase')%0A        self.path = path%0A        self._collect()%0A%0A    @property%0A    def valid_name(self):%0A        fallback = re.compile(r'Release$')%0A        if not self.user_match:%0A            return fallback%0A        else:%0A            try:%0A                if self.case_insensitive:%0A                    return re.compile(self.user_match, re.IGNORECASE)%0A                return re.compile(self.user_match)%0A            except Exception, msg:%0A                raise SystemExit('Could not compile regex, error was: %25s' %25 msg)%0A%0A    def _collect(self):%0A        if os.path.isfile(self.path):%0A            self.append(self.path)%0A            return%0A%0A        # Local is faster%0A        walk = os.walk%0A        join = os.path.join%0A        path = self.path%0A%0A        for root, dirs, files in walk(path):%0A            for item in files:%0A                absolute_path = join(root, item)%0A                if not self.valid_module_name.match(item):%0A                    continue%0A                self.append(absolute_path)%0A

create a collector engine to find the files we need