def __init__(self, session=None, loader=None,
                 base_resource_class=Resource,
                 details_class=ResourceDetails):
        """
        Creates a new ``ResourceFactory`` instance.

        :param session: The ``Session`` the factory should use.
        :type session: <class kotocore.session.Session> instance

        :param loader: (Optional) An instance of a ``ResourceJSONLoader`` class.
            This can be swapped with a different instance or with a completely
            different class with the same interface.
            By default, this is ``kotocore.loader.default_loader``.
        :type loader: <class kotocore.loader.ResourceJSONLoader> instance

        :param base_resource_class: (Optional) The base class to use when creating
            the resource. By default, this is ``Resource``, but should
            you need to globally change the behavior of all resources,
            you'd simply specify this to provide your own class.
        :type base_resource_class: <class kotocore.resources.Resource>

        :param details_class: (Optional) The metadata class used to store things
            like service name & data. By default, this is ``ResourceDetails``,
            but should you need to globally change the behavior (perhaps
            modifying how the resource data is returned), you simply provide
            your own class here.
        :type details_class: <class kotocore.resources.ResourceDetails>
        """
        self.session = session
        self.loader = loader
        self.base_resource_class = base_resource_class
        self.details_class = details_class

        if self.session is None:
            # Fallback to the default.
            import kotocore
            self.session = kotocore.session

        if self.loader is None:
            import kotocore.loader
            self.loader = kotocore.loader.default_loader
def __init__ ( self , session = None , loader = None , base_resource_class = Resource , details_class = ResourceDetails ) : self . session = session self . loader = loader self . base_resource_class = base_resource_class self . details_class = details_class if self . session is None : import kotocore self . session = kotocore . session if self . loader is None : import kotocore . loader self . loader = kotocore . loader . default_loader
Creates a new ``ResourceFactory`` instance.

        :param session: The ``Session`` the factory should use.
        :type session: <class kotocore.session.Session> instance

        :param loader: (Optional) An instance of a ``ResourceJSONLoader`` class.
            This can be swapped with a different instance or with a completely
            different class with the same interface.
            By default, this is ``kotocore.loader.default_loader``.
        :type loader: <class kotocore.loader.ResourceJSONLoader> instance

        :param base_resource_class: (Optional) The base class to use when creating
            the resource. By default, this is ``Resource``, but should
            you need to globally change the behavior of all resources,
            you'd simply specify this to provide your own class.
        :type base_resource_class: <class kotocore.resources.Resource>

        :param details_class: (Optional) The metadata class used to store things
            like service name & data. By default, this is ``ResourceDetails``,
            but should you need to globally change the behavior (perhaps
            modifying how the resource data is returned), you simply provide
            your own class here.
        :type details_class: <class kotocore.resources.ResourceDetails>