Source code for zot.plugs.misc

# zot/plugs/misc.py
#
#

""" time the timing. """

__copyright__ = "Copyright 2015, B.H.J Thate"

## IMPORTS

from zot.utils import get_day, get_hour, today, short_date
from zot.runtime import kernel
from zot.object import Object
from zot.looper import TIMER
import datetime
import threading
import logging
import time

## misc.timer command

[docs]def misc_timer(event): rest = event.rest() if not rest: return target = today() + get_day(rest) + get_hour(rest) event.reply("time detected: %s" % short_date(time.ctime(target))) timer = TIMER(target, event) kernel.put(timer.start) event.ok()
kernel.register("misc.timer", misc_timer)