'Register a :class:`CategoryDescription` instance.
.. note:: It is always best to register the category
before the widgets belonging to it.'

def register_category(self, desc):

    if (not isinstance(desc, description.CategoryDescription)):
        raise TypeError(("Expected    a    'CategoryDescription'    got    %r." % type(desc).__name__))
    name = desc.name
    if (not name):
        log.info('Creating    a    default    category    name.')
        name = 'default'
    if any(((name == c.name) for c in self.categories())):
        log.info(('A    category    with    %r    name    already    exists' % name))
        return
    self._insert_category(desc)
