From 5c902ef14f1348f0ca89ef928a774f48c22f23fe Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 15 Feb 2014 23:53:35 +0100 Subject: [PATCH] Added tickerhandler to ev.py and improved Script docs. --- ev.py | 1 + src/scripts/scripts.py | 19 +++---------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/ev.py b/ev.py index 423a94be8d..a40e6f6f02 100644 --- a/ev.py +++ b/ev.py @@ -153,6 +153,7 @@ from src.objects.objects import Object, Character, Room, Exit from src.utils.search import * from src.utils.create import * +from src.scripts.tickerhandler import TICKER_HANDLER as tickerhandler from src.utils import logger from src.utils import utils from src.utils import gametime diff --git a/src/scripts/scripts.py b/src/scripts/scripts.py index 97d464b38f..d7389d200a 100644 --- a/src/scripts/scripts.py +++ b/src/scripts/scripts.py @@ -408,8 +408,11 @@ class Script(ScriptBase): is persistent, the pause state will survive a shutdown. unpause() - restart a previously paused script. The script will continue as if it was never paused. + force_repeat() - force-step the script, regardless of how much remains + until next step. This counts like a normal firing in all ways. time_until_next_repeat() - if a timed script (interval>0), returns time until next tick + remaining_repeats() - number of repeats remaining, if limited * Hook methods @@ -565,19 +568,3 @@ class ValidateChannelHandler(Script): #print "ValidateChannelHandler run." channelhandler.CHANNELHANDLER.update() -#class ClearAttributeCache(Script): -# "Clear the attribute cache." -# def at_script_creation(self): -# "Setup the script" -# self.key = "sys_cache_clear" -# self.desc = _("Clears the Attribute Cache") -# self.interval = 3600 * 2 -# self.persistent = True -# def at_repeat(self): -# "called every 2 hours. Sets a max attr-cache limit to 100 MB." # enough for normal usage? -# if is_pypy: -# # pypy don't support get_size, so we have to skip out here. -# return -# attr_cache_size, _, _ = caches.get_cache_sizes() -# if attr_cache_size > _ATTRIBUTE_CACHE_MAXSIZE: -# caches.flush_attr_cache()