Made so the @scripts command properly display when scripts will fire next.

This commit is contained in:
Griatch 2010-09-05 16:35:39 +00:00
parent c4128e4656
commit 212061abb6
2 changed files with 14 additions and 14 deletions

View file

@ -154,18 +154,20 @@ class CmdListScripts(MuxCommand):
table[3].append("--")
else:
table[3].append("%ss" % script.interval)
if not hasattr(script, 'next_repeat') or not script.next_repeat:
table[5].append("--")
else:
table[5].append("%ss" % script.next_repeat)
if not hasattr(script, 'repeats') or not script.repeats:
next = script.time_until_next_repeat()
if not next:
table[4].append("--")
else:
table[4].append("%ss" % script.repeats)
if script.persistent:
table[6].append("Y")
table[4].append("%ss" % next)
if not hasattr(script, 'repeats') or not script.repeats:
table[5].append("--")
else:
table[6].append("N")
table[5].append("%ss" % script.repeats)
if script.persistent:
table[6].append("*")
else:
table[6].append("-")
typeclass_path = script.typeclass_path.rsplit('.', 1)
table[7].append("%s" % typeclass_path[-1])
table[8].append(script.desc)
@ -232,8 +234,7 @@ class CmdListScripts(MuxCommand):
string += "Started %s and stopped %s scripts." % (nr_started, nr_stopped)
else:
# No stopping or validation. We just want to view things.
string = self.format_script_list(scripts)
print string
string = self.format_script_list(scripts)
caller.msg(string)

View file

@ -95,9 +95,8 @@ def import_cmdset(python_path, cmdsetobj, emit_to_obj=None, no_logging=False):
#print "cmdset %s not in cache. Reloading." % wanted_cache_key
# Not in cache. Reload from disk.
modulepath, classname = python_path.rsplit('.', 1)
module = __import__(modulepath, fromlist=[True])
cmdsetclass = module.__dict__[classname]
cmdsetclass = module.__dict__[classname]
CACHED_CMDSETS[wanted_cache_key] = cmdsetclass
#print "cmdset %s found." % wanted_cache_key
#instantiate the cmdset (and catch its errors)
@ -122,7 +121,7 @@ def import_cmdset(python_path, cmdsetobj, emit_to_obj=None, no_logging=False):
logger.log_trace()
if emit_to_obj:
emit_to_obj.msg(errstring)
raise
raise # have to raise, or we will not see any errors in some situations!
# classes