Пример #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"]))
Пример #2
0
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
Пример #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
Пример #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
Пример #5
0
 def describe(self, thing, context):
     context.reply(thing.describe(context))