(self, namespace, extension_class_entry=None,
                           atom=True, rss=True)
Register a specific extension by classes to a namespace.

        :param namespace: namespace for the extension
        :param extension_class_entry: Class of the entry extension to load.
        :param atom: If the extension should be used for ATOM feeds.
        :param rss: If the extension should be used for RSS feeds.
Register a specific extension by classes to a namespace.
Register a specific extension by classes to a namespace .
def register_extension(self, namespace, extension_class_entry=None,
                           atom=True, rss=True):
        '''Register a specific extension by classes to a namespace.

        :param namespace: namespace for the extension
        :param extension_class_entry: Class of the entry extension to load.
        :param atom: If the extension should be used for ATOM feeds.
        :param rss: If the extension should be used for RSS feeds.
        '''
        # Check loaded extensions
        # `load_extension` ignores the "Extension" suffix.
        if not isinstance(self.__extensions, dict):
            self.__extensions = {}
        if namespace in self.__extensions.keys():
            raise ImportError('Extension already loaded')
        if not extension_class_entry:
            raise ImportError('No extension class')

        extinst = extension_class_entry()
        setattr(self, namespace, extinst)

        # `load_extension` registry
        self.__extensions[namespace] = {
                'inst': extinst,
                'extension_class_entry': extension_class_entry,
                'atom': atom,
                'rss': rss
                }
def register_extension ( self , namespace , extension_class_entry = None , atom = True , rss = True ) : # Check loaded extensions # `load_extension` ignores the "Extension" suffix. if not isinstance ( self . __extensions , dict ) : self . __extensions = { } if namespace in self . __extensions . keys ( ) : raise ImportError ( 'Extension already loaded' ) if not extension_class_entry : raise ImportError ( 'No extension class' ) extinst = extension_class_entry ( ) setattr ( self , namespace , extinst ) # `load_extension` registry self . __extensions [ namespace ] = { 'inst' : extinst , 'extension_class_entry' : extension_class_entry , 'atom' : atom , 'rss' : rss }