Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@presenter_registry.register(set(["ircchannel"]))
def present(thing, context):
facet = thing.facets["ircchannel"]
if facet.topic:
return u"Topic: {topic}".format(topic=facet.topic)
@presenter_registry.register(set(["name"]), order=-10)
def present(thing, context):
return u"{name}".format(name=ircutils.bold(thing.name))
@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
@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