Removed @ps command, it is superceded by @serverload and was just a placeholder anyway.

This commit is contained in:
Griatch 2012-03-25 18:47:31 +02:00
parent 07a17ac15e
commit bdb5ab0123
2 changed files with 36 additions and 36 deletions

View file

@ -45,7 +45,7 @@ class DefaultCmdSet(CmdSet):
self.add(system.CmdVersion()) self.add(system.CmdVersion())
self.add(system.CmdTime()) self.add(system.CmdTime())
self.add(system.CmdServerLoad()) self.add(system.CmdServerLoad())
self.add(system.CmdPs()) #self.add(system.CmdPs())
# Admin commands # Admin commands
self.add(admin.CmdBoot()) self.add(admin.CmdBoot())

View file

@ -21,7 +21,7 @@ from src.commands.default.muxcommand import MuxCommand
# limit symbol import for API # limit symbol import for API
__all__ = ("CmdReload", "CmdReset", "CmdShutdown", "CmdPy", __all__ = ("CmdReload", "CmdReset", "CmdShutdown", "CmdPy",
"CmdScripts", "CmdObjects", "CmdService", "CmdVersion", "CmdScripts", "CmdObjects", "CmdService", "CmdVersion",
"CmdTime", "CmdServerLoad", "CmdPs") "CmdTime", "CmdServerLoad")
class CmdReload(MuxCommand): class CmdReload(MuxCommand):
""" """
@ -604,45 +604,45 @@ class CmdServerLoad(MuxCommand):
caller.msg(string) caller.msg(string)
class CmdPs(MuxCommand): # class CmdPs(MuxCommand):
""" # """
list processes # list processes
Usage # Usage
@ps # @ps
Shows the process/event table. # Shows the process/event table.
""" # """
key = "@ps" # key = "@ps"
locks = "cmd:perm(ps) or perm(Builders)" # locks = "cmd:perm(ps) or perm(Builders)"
help_category = "System" # help_category = "System"
def func(self): # def func(self):
"run the function." # "run the function."
all_scripts = ScriptDB.objects.get_all_scripts() # nscripts = ScriptDB.objects.count()
repeat_scripts = [script for script in all_scripts if script.interval > 0] # repeat_scripts = ScriptDB.objects.filter(db_interval__gt=0)
nrepeat_scripts = [script for script in all_scripts if script.interval <= 0] # nrepeat_scripts = ScriptDB.objects.filter(db_interval__le=0)
string = "\n{wNon-timed scripts:{n -- PID name desc --" # string = "\n{wNon-timed scripts:{n -- PID name desc --"
if not nrepeat_scripts: # if not nrepeat_scripts:
string += "\n <None>" # string += "\n <None>"
for script in nrepeat_scripts: # for script in nrepeat_scripts:
string += "\n {w%i{n %s %s" % (script.id, script.key, script.desc) # string += "\n {w%i{n %s %s" % (script.id, script.key, script.desc)
string += "\n{wTimed scripts:{n -- PID name [time/interval][repeats] desc --" # string += "\n{wTimed scripts:{n -- PID name [time/interval][repeats] desc --"
if not repeat_scripts: # if not repeat_scripts:
string += "\n <None>" # string += "\n <None>"
for script in repeat_scripts: # for script in repeat_scripts:
repeats = "[inf] " # repeats = "[inf] "
if script.repeats: # if script.repeats:
repeats = "[%i] " % script.repeats # repeats = "[%i] " % script.repeats
time_next = "[inf/inf]" # time_next = "[inf/inf]"
if script.time_until_next_repeat() != None: # if script.time_until_next_repeat() != None:
time_next = "[%d/%d]" % (script.time_until_next_repeat(), script.interval) # time_next = "[%d/%d]" % (script.time_until_next_repeat(), script.interval)
string += "\n {w%i{n %s %s%s%s" % (script.id, script.key, # string += "\n {w%i{n %s %s%s%s" % (script.id, script.key,
time_next, repeats, script.desc) # time_next, repeats, script.desc)
string += "\n{wTotal{n: %d scripts." % len(all_scripts) # string += "\n{wTotal{n: %d scripts." % len(all_scripts)
self.caller.msg(string) # self.caller.msg(string)