Exemplo n.º 1
0
def present(thing, context):
    if thing.facets["description"].descriptions:
        text = u"{name}: {descriptions}".format(
            name         = thing.describe(context, facets=set(["name"])),
            descriptions = thing.facets["description"].present())
        return text
    else:
        return thing.describe(context, facets=set(["name"]))
Exemplo n.º 2
0
Arquivo: bot.py Projeto: drd/karmabot
def present(thing, context):
    text = u"{name}[v{version}]({karma}): {descriptions} ({things} things)".format(
        name         = thing.describe(context, facets=set(["name"])),
        karma        = thing.facets["karma"].karma,
        descriptions = thing.facets["description"].present(),
        version      = karmabot.VERSION,
        things       = context.bot.things.count
    )
    return text
Exemplo n.º 3
0
def present(thing, context):
    name_display = thing.describe(context, facets=set(["name", "karma"]))
    if thing.facets["description"].descriptions:
        text = u"{name}: {descriptions}".format(
            name         = name_display,
            descriptions = thing.facets["description"].present())
        return text
    else:
        return name_display
Exemplo n.º 4
0
def present(thing, context):
    text = u"{name}({karma})".format(
        name  = thing.describe(context, facets=set(["name"])),
        karma = thing.facets["karma"].karma
    )
    return text
Exemplo n.º 5
0
Arquivo: name.py Projeto: drd/karmabot
 def describe(self, thing, context):
     context.reply(thing.describe(context))