'Return config validator.'

def validator(self):

    root = validator.factory(u'dict')
    root.accept(u'text', key=u'username', required=True)
    root.accept(u'text', key=u'password', required=True)
    root.accept(u'number', key=u'gravity_multiplier')
    root.accept(u'choice', u'type').accept_choices([u'p2p', u'scene'])
    root.accept(u'choice', key=u'category').accept_choices(CATEGORIES)
    root.accept(u'number', key=u'category')
    categories = root.accept(u'list', key=u'category')
    categories.accept(u'choice', key=u'category').accept_choices(CATEGORIES)
    categories.accept(u'number', key=u'category')
    return root
