(self, name, atom=True, rss=True)
Load a specific extension by name.

        :param name: Name of the 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.
Load a specific extension by name.
Load a specific extension by name .
def load_extension(self, name, atom=True, rss=True):
        '''Load a specific extension by name.

        :param name: Name of the 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
        if not isinstance(self.__extensions, dict):
            self.__extensions = {}
        if name in self.__extensions.keys():
            raise ImportError('Extension already loaded')

        # Load extension
        extname = name[0].upper() + name[1:]
        feedsupmod = __import__('feedgen.ext.%s' % name)
        feedextmod = getattr(feedsupmod.ext, name)
        try:
            entrysupmod = __import__('feedgen.ext.%s_entry' % name)
            entryextmod = getattr(entrysupmod.ext, name + '_entry')
        except ImportError:
            # Use FeedExtension module instead
            entrysupmod = feedsupmod
            entryextmod = feedextmod
        feedext = getattr(feedextmod, extname + 'Extension')
        try:
            entryext = getattr(entryextmod, extname + 'EntryExtension')
        except AttributeError:
            entryext = None
        self.register_extension(name, feedext, entryext, atom, rss)
def load_extension ( self , name , atom = True , rss = True ) : # Check loaded extensions if not isinstance ( self . __extensions , dict ) : self . __extensions = { } if name in self . __extensions . keys ( ) : raise ImportError ( 'Extension already loaded' ) # Load extension extname = name [ 0 ] . upper ( ) + name [ 1 : ] feedsupmod = __import__ ( 'feedgen.ext.%s' % name ) feedextmod = getattr ( feedsupmod . ext , name ) try : entrysupmod = __import__ ( 'feedgen.ext.%s_entry' % name ) entryextmod = getattr ( entrysupmod . ext , name + '_entry' ) except ImportError : # Use FeedExtension module instead entrysupmod = feedsupmod entryextmod = feedextmod feedext = getattr ( feedextmod , extname + 'Extension' ) try : entryext = getattr ( entryextmod , extname + 'EntryExtension' ) except AttributeError : entryext = None self . register_extension ( name , feedext , entryext , atom , rss )