diff --git a/src/commands/cmdsethandler.py b/src/commands/cmdsethandler.py index a5323e49b3..b333c9e2bb 100644 --- a/src/commands/cmdsethandler.py +++ b/src/commands/cmdsethandler.py @@ -155,8 +155,8 @@ class CmdSetHandler(object): # the subset of the cmdset_paths that are to be stored in the database self.permanent_paths = [""] - - # self.update(init_mode=True) is then called from the object __init__. + + #self.update(init_mode=True) is then called from the object __init__. def __str__(self): "Display current commands" @@ -196,18 +196,17 @@ class CmdSetHandler(object): created; it imports all permanent cmdsets from db. """ if init_mode: - self.cmdset_stack = [] # reimport all permanent cmdsets self.permanent_paths = self.obj.cmdset_storage - new_permanent_paths = [] - - for pos, path in enumerate(self.permanent_paths): - if pos == 0 and not path: - self.cmdset_stack = [CmdSet(cmdsetobj=self.obj, key="Empty")] - else: - cmdset = self.import_cmdset(path) - if cmdset: - self.cmdset_stack.append(cmdset) + if self.permanent_paths: + self.cmdset_stack = [] + for pos, path in enumerate(self.permanent_paths): + if pos == 0 and not path: + self.cmdset_stack = [CmdSet(cmdsetobj=self.obj, key="Empty")] + else: + cmdset = self.import_cmdset(path) + if cmdset: + self.cmdset_stack.append(cmdset) # merge the stack into a new merged cmdset new_current = None diff --git a/src/commands/default/system.py b/src/commands/default/system.py index b69ca7d25b..5ae4a265d2 100644 --- a/src/commands/default/system.py +++ b/src/commands/default/system.py @@ -562,29 +562,29 @@ class CmdServerLoad(MuxCommand): ["%g%%" % (100 * loadavg[0]), "%10d" % os.getpid(), "%10d " % psize, - "%10d" % rusage[0], - "%10d shared" % rusage[3], - "%10d pages" % rusage[2], - "%10d hard" % rusage[7], - "%10d reads" % rusage[9], - "%10d in" % rusage[12], - "%10d vol" % rusage[14] + "%10d" % rusage.ru_utime, + "%10d shared" % rusage.ru_ixrss, + "%10d pages" % rusage.ru_maxrss, + "%10d hard" % rusage.ru_majflt, + "%10d reads" % rusage.ru_inblock, + "%10d in" % rusage.ru_msgrcv, + "%10d vol" % rusage.ru_nvcsw ], ["", "", "", - "(user: %g)" % rusage[1], - "%10d private" % rusage[4], - "%10d bytes" % (rusage[2] * psize), - "%10d soft" % rusage[6], - "%10d writes" % rusage[10], - "%10d out" % rusage[11], - "%10d forced" % rusage[15] + "(user: %g)" % rusage.ru_stime, + "%10d private" % rusage.ru_idrss, + "%10d bytes" % (rusage.ru_maxrss * psize), + "%10d soft" % rusage.ru_minflt, + "%10d writes" % rusage.ru_oublock, + "%10d out" % rusage.ru_msgsnd, + "%10d forced" % rusage.ru_nivcsw ], ["", "", "", "", - "%10d stack" % rusage[5], + "%10d stack" % rusage.ru_isrss, "", - "%10d swapouts" % rusage[8], + "%10d swapouts" % rusage.ru_nswap, "", "", - "%10d sigs" % rusage[13] + "%10d sigs" % rusage.ru_nsignals ] ] stable = []