Esempio n. 1
0
def infoForEvent(user, additional):
    if additional:
        try:
            amount = int(additional)
            events = Event.getNext(amount)
            answer = ''
            if not events:
                return u'Es konnte kein in Zukunft stattfindendes Event gefunden werden. Ein Administrator muss erst eines anlegen.'
            if len(events) < amount:
                answer += u'Es wurden nur ' + str(
                    len(events)) + u' zukünftige Events gefunden. '
            answer += u'Die nächsten ' + str(len(events)) + ' Events: \n\n'
            for e in events:
                answer += e.toString()
                answer += u'\n\n'
            return answer
        except ValueError:
            pass
    result = Responder.parseEvent(user, additional)
    if isinstance(result, Event.Event):
        answer = result.toString()
        answer = answer + list_registered_cancelled(result)
        return answer
    if isinstance(result, basestring):
        return result