Esempio n. 1
0
def handle_todoweek(bot, ievent):
    """ todo-week .. show time related todo items for this week """
    name = ievent.channel
    if not name:
        ievent.reply("can't find username for %s" % ievent.auth)
        return
    todo = TodoList(name)
    todoos = todo.withintime(today(), today()+7*24*60*60)
    saytodo(bot, ievent, todoos)
Esempio n. 2
0
def handle_tomorrow(bot, ievent):
    """ t-tomorrow .. show time related todo items for tomorrow """
    username = getusers().getname(ievent.userhost)
    if ievent.rest:
        what = ievent.rest
        ttime = strtotime(what)
        if ttime != None:
            if ttime < today() or ttime > today() + 24*60*60:
                ievent.reply("%s is not tomorrow" % time.ctime(ttime + 24*60*60))
                return
            ttime += 24*60*60
            ievent.reply('time detected ' + time.ctime(ttime))
            what = striptime(what)
        else: ttime = today() + 42*60*60
        todo.add(username, what, ttime)   
        ievent.reply('todo added')    
        return
    todoos = todo.withintime(username, today()+24*60*60, today()+2*24*60*60)
    saytodo(bot, ievent, todoos)
Esempio n. 3
0
def handle_tomorrow(bot, ievent):
    """ todo-tomorrow .. show time related todo items for tomorrow """
    username = ievent.channel
    todo = TodoList(username)
    if ievent.rest:
        what = ievent.rest
        ttime = strtotime(what)
        if ttime != None:
            if ttime < today() or ttime > today() + 24*60*60:
                ievent.reply("%s is not tomorrow" % time.ctime(ttime + 24*60*60))
                return
            ttime += 24*60*60
            ievent.reply('time detected ' + time.ctime(ttime))
            what = striptime(what)
        else:
            ttime = today() + 42*60*60
        todo.add(what, ttime)   
        ievent.reply('todo added')    
        return
    todoos = todo.withintime(today()+24*60*60, today()+2*24*60*60)
    saytodo(bot, ievent, todoos)
Esempio n. 4
0
def handle_tomorrow(bot, ievent):
    """ no arguments - show time related todo items for tomorrow """
    if ievent.options and ievent.options.dochan: name = ievent.channel
    else: name = ievent.user.data.name
    todo = TodoList(name)
    if ievent.rest:
        what = ievent.rest
        ttime = strtotime(what)
        if ttime != None:
            if ttime < today() or ttime > today() + 24*60*60:
                ievent.reply("%s is not tomorrow" % time.ctime(ttime + 24*60*60))
                return
            ttime += 24*60*60
            ievent.reply('time detected ' + time.ctime(ttime))
            what = striptime(what)
        else: ttime = today() + 42*60*60
        todo.add(what, ttime)   
        ievent.reply('todo added')    
        return
    todoos = todo.withintime(today()+24*60*60, today()+2*24*60*60)
    saytodo(bot, ievent, todoos, name)
Esempio n. 5
0
def handle_today(bot, ievent):
    """ t-today .. show time related todo items for today """
    name = getusers().getname(ievent.userhost)
    todoos = todo.withintime(name, today(), today() + 24 * 60 * 60)
    saytodo(bot, ievent, todoos)
Esempio n. 6
0
def handle_todoweek(bot, ievent):
    """ todo-week .. show time related todo items for this week """
    name = getusers().getname(ievent.userhost)
    todoos = todo.withintime(name, today(), today() + 7 * 24 * 60 * 60)
    saytodo(bot, ievent, todoos)
Esempio n. 7
0
def handle_todoweek(bot, ievent):
    """ no arguments - show time related todo items for this week """
    name = ievent.user.data.name or ievent.channel
    todo = TodoList(name)
    todoos = todo.withintime(today(), today()+7*24*60*60)
    saytodo(bot, ievent, todoos, name)
Esempio n. 8
0
def handle_today(bot, ievent):
    """ t-today .. show time related todo items for today """
    name = getusers().getname(ievent.userhost)
    todoos = todo.withintime(name, today(), today()+24*60*60)
    saytodo(bot, ievent, todoos)
Esempio n. 9
0
def handle_todoweek(bot, ievent):
    """ todo-week .. show time related todo items for this week """
    name = getusers().getname(ievent.userhost)
    todoos = todo.withintime(name, today(), today()+7*24*60*60)
    saytodo(bot, ievent, todoos)