Exemplo n.º 1
0
def present_name(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
def present_karma(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 u"no descriptions found for {name}".format(name=name_display)
Exemplo n.º 3
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.º 4
0
 def describe(self, context, thing):
     # this is a thing object not the list of things
     context.reply(thing.describe(context))