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"]))
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)
def present(thing, context): text = u"{name}({karma})".format( name=thing.describe(context, facets=set(["name"])), karma=thing.facets["karma"].karma, ) return text
def describe(self, context, thing): # this is a thing object not the list of things context.reply(thing.describe(context))