def __call__(self, factory_class):
        """
        Sets up and registers the factory class

        :param factory_class: The class to decorate
        :return: The decorated class
        :raise TypeError: The given object is not a class
        """
        # Manipulate the class
        factory_class = super(SingletonFactory, self).__call__(factory_class)

        # Set the singleton flag
        context = get_factory_context(factory_class)
        context.is_singleton = True
        return factory_class
def __call__ ( self , factory_class ) : factory_class = super ( SingletonFactory , self ) . __call__ ( factory_class ) context = get_factory_context ( factory_class ) context . is_singleton = True return factory_class
Sets up and registers the factory class

        :param factory_class: The class to decorate
        :return: The decorated class
        :raise TypeError: The given object is not a class