'Return a widget description from a module.'

def widget_description(self, module, widget_name=None, category_name=None, distribution=None):

    if isinstance(module, str):
        module = __import__(module, fromlist=[''])
    desc = WidgetDescription.from_module(module)
    if (widget_name is not None):
        desc.name = widget_name
    if (category_name is not None):
        desc.category = category_name
    if (distribution is not None):
        desc.project_name = distribution.project_name
    return desc
