# Path: suds/cache.py
# class NoCache(Cache):
#     """
#     The passthru object cache.
#     """
# 
#     def get(self, id):
#         return None
# 
#     def getf(self, id):
#         return None
# 
#     def put(self, id, object):
#         pass
# 
#     def putf(self, id, fp):
#         pass
# 
# Path: suds/plugin.py
# class PluginContainer:
#     """
#     Plugin container provides easy method invocation.
#     @ivar plugins: A list of plugin objects.
#     @type plugins: [L{Plugin},]
#     @cvar ctxclass: A dict of plugin method / context classes.
#     @type ctxclass: dict
#     """
# 
#     domains = {
#         'init': (InitContext, InitPlugin),
#         'document': (DocumentContext, DocumentPlugin),
#         'message': (MessageContext, MessagePlugin),
#     }
# 
#     def __init__(self, plugins):
#         """
#         @param plugins: A list of plugin objects.
#         @type plugins: [L{Plugin},]
#         """
#         self.plugins = plugins
# 
#     def __getattr__(self, name):
#         domain = self.domains.get(name)
#         if domain:
#             plugins = []
#             ctx, pclass = domain
#             for p in self.plugins:
#                 if isinstance(p, pclass):
#                     plugins.append(p)
#             return PluginDomain(ctx, plugins)
#         else:
#             raise Exception('plugin domain (%s), invalid' % name)


import hashlib
from logging import getLogger
from suds.sax.parser import Parser
from suds.transport import Request
from suds.cache import NoCache
from suds.store import DocumentStore
from suds.plugin import PluginContainer
        the I{object cache}.  After unpickled from the cache, the
        I{options} attribute is restored.
        If not found, it is downloaded and instantiated using the
        I{fn} constructor and added to the cache for the next open().
        @param url: A WSDL url.
        @type url: str.
        @return: The WSDL object.
        @rtype: I{Definitions}
        """
        cache = self.cache()
        id = self.mangle(url, 'wsdl')
        d = cache.get(id)
        if d is None:
            d = self.fn(url, self.options)
            cache.put(id, d)
        else:
            d.options = self.options
            for imp in d.imports:
                imp.imported.options = self.options
        return d

    def cache(self):
        """
        Get the cache.
        @return: The I{options} when I{cachingpolicy} = B{1}.
        @rtype: L{Cache}
        """
        if self.options.cachingpolicy == 1:
            return self.options.cache
        else:

# Path: suds/cache.py
# class NoCache(Cache):
#     """
#     The passthru object cache.
#     """
# 
#     def get(self, id):
#         return None
# 
#     def getf(self, id):
#         return None
# 
#     def put(self, id, object):
#         pass
# 
#     def putf(self, id, fp):
#         pass
# 
# Path: suds/plugin.py
# class PluginContainer:
#     """
#     Plugin container provides easy method invocation.
#     @ivar plugins: A list of plugin objects.
#     @type plugins: [L{Plugin},]
#     @cvar ctxclass: A dict of plugin method / context classes.
#     @type ctxclass: dict
#     """
# 
#     domains = {
#         'init': (InitContext, InitPlugin),
#         'document': (DocumentContext, DocumentPlugin),
#         'message': (MessageContext, MessagePlugin),
#     }
# 
#     def __init__(self, plugins):
#         """
#         @param plugins: A list of plugin objects.
#         @type plugins: [L{Plugin},]
#         """
#         self.plugins = plugins
# 
#     def __getattr__(self, name):
#         domain = self.domains.get(name)
#         if domain:
#             plugins = []
#             ctx, pclass = domain
#             for p in self.plugins:
#                 if isinstance(p, pclass):
#                     plugins.append(p)
#             return PluginDomain(ctx, plugins)
#         else:
#             raise Exception('plugin domain (%s), invalid' % name)


# Path: suds/reader.py
import hashlib
from logging import getLogger
from suds.sax.parser import Parser
from suds.transport import Request
from suds.cache import NoCache
from suds.store import DocumentStore
from suds.plugin import PluginContainer

        the I{object cache}.  After unpickled from the cache, the
        I{options} attribute is restored.
        If not found, it is downloaded and instantiated using the
        I{fn} constructor and added to the cache for the next open().
        @param url: A WSDL url.
        @type url: str.
        @return: The WSDL object.
        @rtype: I{Definitions}
        """
        cache = self.cache()
        id = self.mangle(url, 'wsdl')
        d = cache.get(id)
        if d is None:
            d = self.fn(url, self.options)
            cache.put(id, d)
        else:
            d.options = self.options
            for imp in d.imports:
                imp.imported.options = self.options
        return d

    def cache(self):
        """
        Get the cache.
        @return: The I{options} when I{cachingpolicy} = B{1}.
        @rtype: L{Cache}
        """
        if self.options.cachingpolicy == 1:
            return self.options.cache
        else:

            return NoCache()