/usr/share/pyshared/jsb/lib/tick.py is in jsonbot 0.84.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | # jsb/tick.py
#
#
""" provide system wide clock tick. """
## jsb imports
from jsb.lib.threadloop import TimedLoop
from jsb.lib.eventbase import EventBase
from jsb.lib.callbacks import callbacks
from jsb.lib.config import getmainconfig
## TickLoop class
class TickLoop(TimedLoop):
def start(self, bot=None):
""" start the loop. """
self.bot = bot
self.counter = 0
TimedLoop.start(self)
def handle(self):
""" send TICK events to callback. """
self.counter += 1
event = EventBase()
event.nolog = True
event.nobind = True
if self.counter % 60 == 0:
event.type = event.cbtype = 'TICK60'
callbacks.check(self.bot, event)
maincfg = getmainconfig()
t = maincfg.ticksleep or 1
if self.counter % t == 0:
event.type = event.cbtype = 'TICK'
callbacks.check(self.bot, event)
## global tick loop
tickloop = TickLoop('tickloop', 1)
|