How to use the karmabot.core.register.presenter_registry function in karmabot

To help you get started, we’ve selected a few karmabot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chromakode / karmabot / karmabot / core / facets / irc.py View on Github external
@presenter_registry.register(set(["ircchannel"]))
def present(thing, context):
    facet = thing.facets["ircchannel"]
    if facet.topic:
        return u"Topic: {topic}".format(topic=facet.topic)
github chromakode / karmabot / karmabot / core / facets / name.py View on Github external
@presenter_registry.register(set(["name"]), order=-10)
def present(thing, context):
    return u"{name}".format(name=ircutils.bold(thing.name))
github chromakode / karmabot / karmabot / core / facets / karma.py View on Github external
@presenter_registry.register(set(["name", "karma"]))
def present(thing, context):
    text = u"{name}({karma})".format(
        name=thing.describe(context, facets=set(["name"])),
        karma=thing.facets["karma"].karma,
    )
    return text
github chromakode / karmabot / karmabot / core / facets / bot.py View on Github external
@presenter_registry.register(set(["karmabot", "name", "karma", "description"]))
def present(thing, context):
    output_str = u"{name}[v{version}]({karma}): {descriptions} ({things} things)"
    text = output_str.format(
        name=thing.describe(context, facets=set(["name"])),
        karma=thing.facets["karma"].karma,
        descriptions=thing.facets["description"].present(),
        version=VERSION,
        things=context.bot.things.count,
        )
    return text