def bundle_path(self, path):
        """Bundle whatever exists at the given path.

        The path could specify a module, a package, or a directory of modules
        and packages.  Its type is intuited based on the contents of the path.
        """
        if os.path.isfile(path):
            self.bundle_module(path)
        elif os.path.isfile(os.path.join(path, "__init__.py")):
            self.bundle_package(path)
        else:
            self.bundle_directory(path)
Bundle whatever exists at the given path.

        The path could specify a module, a package, or a directory of modules
        and packages.  Its type is intuited based on the contents of the path.
        
tools/module_bundler.py