'Registers the given extension.
Example::
class MyExtension(PageExtension):
pass
extension_pool.register(MyExtension)
or as decorator::
@extension_pool.register
class MyExtension(PageExtension):
pass'

def register(self, extension):

    if issubclass(extension, PageExtension):
        self.page_extensions.add(extension)
    elif issubclass(extension, TitleExtension):
        self.title_extensions.add(extension)
    else:
        raise SubClassNeededError(('Extension    has    to    subclass    either    %r    or    %r.    %r    does    not!' % (PageExtension, TitleExtension, extension)))
    self._activate_signaling()
    return extension
