def bundle_directory(self, dirpath):
        """Bundle all modules/packages in the given directory."""
        dirpath = os.path.abspath(dirpath)
        for nm in os.listdir(dirpath):
            nm = _u(nm)
            if nm.startswith("."):
                continue
            itempath = os.path.join(dirpath, nm)
            if os.path.isdir(itempath):
                if os.path.exists(os.path.join(itempath, "__init__.py")):
                    self.bundle_package(itempath)
            elif nm.endswith(".py"):
                self.bundle_module(itempath)
Bundle all modules/packages in the given directory.
tools/module_bundler.py