(self, namespace, extension_class_feed=None,
                           extension_class_entry=None, atom=True, rss=True)
Registers an extension by class.

        :param namespace: namespace for the extension
        :param extension_class_feed: Class of the feed extension to load.
        :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.
Registers an extension by class.
Registers an extension by class .
def register_extension(self, namespace, extension_class_feed=None,
                           extension_class_entry=None, atom=True, rss=True):
        '''Registers an extension by class.

        :param namespace: namespace for the extension
        :param extension_class_feed: Class of the feed extension to load.
        :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')

        # Load extension
        extinst = extension_class_feed()
        setattr(self, namespace, extinst)

        # `load_extension` registry
        self.__extensions[namespace] = {
                'inst': extinst,
                'extension_class_feed': extension_class_feed,
                'extension_class_entry': extension_class_entry,
                'atom': atom,
                'rss': rss
                }

        # Try to load the extension for already existing entries:
        for entry in self.__feed_entries:
            try:
                entry.register_extension(namespace,
                                         extension_class_entry,
                                         atom,
                                         rss)
            except ImportError:
                pass
def register_extension ( self , namespace , extension_class_feed = None , 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' ) # Load extension extinst = extension_class_feed ( ) setattr ( self , namespace , extinst ) # `load_extension` registry self . __extensions [ namespace ] = { 'inst' : extinst , 'extension_class_feed' : extension_class_feed , 'extension_class_entry' : extension_class_entry , 'atom' : atom , 'rss' : rss } # Try to load the extension for already existing entries: for entry in self . __feed_entries : try : entry . register_extension ( namespace , extension_class_entry , atom , rss ) except ImportError : pass