From a2291953f2f85ec51db981a219006cd7ec162ca9 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 5 Sep 2010 14:42:09 +0000 Subject: [PATCH] Changed erroneous DateField to DateTimeField in ObjectDB, so you might have to resync your database. Fixed lots of formatting issues in the info and list commands. Resolved issue105. --- game/gamesrc/commands/default/comms.py | 2 +- game/gamesrc/commands/default/info.py | 141 ++++++++++++++------ game/gamesrc/commands/default/privileged.py | 123 +++++++++++++---- src/commands/cmdsethandler.py | 10 +- src/comms/models.py | 3 +- src/scripts/scripthandler.py | 48 ------- src/typeclasses/models.py | 10 +- src/utils/utils.py | 32 ++++- 8 files changed, 232 insertions(+), 137 deletions(-) diff --git a/game/gamesrc/commands/default/comms.py b/game/gamesrc/commands/default/comms.py index c6f16c23ad..89e1225cf0 100644 --- a/game/gamesrc/commands/default/comms.py +++ b/game/gamesrc/commands/default/comms.py @@ -820,7 +820,7 @@ class CmdPage(MuxCommand): received = [] for pobj in recobjs: pobj.msg("%s %s" % (header, message)) - if not pobj.has_player: + if hasattr(pobj, 'has_player') and not pobj.has_player: received.append("{C%s{n" % pobj.name) caller.msg("%s is offline. They will see your message if they list their pages later." % received[-1]) else: diff --git a/game/gamesrc/commands/default/info.py b/game/gamesrc/commands/default/info.py index b4d65a5d31..4a571d9213 100644 --- a/game/gamesrc/commands/default/info.py +++ b/game/gamesrc/commands/default/info.py @@ -29,7 +29,7 @@ class CmdVersion(MuxCommand): "Show the version" version = utils.get_evennia_version() string = "-"*50 +"\n\r" - string += " Evennia %s\n\r" % version + string += " {cEvennia{n %s\n\r" % version string += " (Django %s, " % (django.get_version()) string += " Twisted %s)\n\r" % (twisted.version.short()) string += "-"*50 @@ -52,21 +52,23 @@ class CmdTime(MuxCommand): def func(self): "Show times." - string1 = "\nCurrent server uptime: " + string1 = "\nCurrent server uptime: \t" string1 += "{w%s{n" % (utils.time_format(gametime.uptime(format=False), 2)) - string2 = "\nTotal server running time: " + string2 = "\nTotal server running time: \t" string2 += "{w%s{n" % (utils.time_format(gametime.runtime(format=False), 2)) - string3 = "\nTotal in-game time (realtime x %g): " % (gametime.TIMEFACTOR) + string3 = "\nTotal in-game time (realtime x %g):\t" % (gametime.TIMEFACTOR) string3 += "{w%s{n" % (utils.time_format(gametime.gametime(format=False), 2)) - string4 = "\nServer time stamp: {w%s{n" % (str(datetime.datetime.now())) + string4 = "\nServer time stamp: \t" + string4 += "{w%s{n" % (str(datetime.datetime.now())) string5 = "" if not utils.host_os_is('nt'): # os.getloadavg() is not available on Windows. loadavg = os.getloadavg() - string5 += "\nServer load (per minute): {w%g%%{n" % (100 * loadavg[0]) + string5 += "\nServer load (per minute): \t" + string5 += "{w%g%%{n" % (100 * loadavg[0]) string = "%s%s%s%s%s" % (string1, string2, string3, string4, string5) self.caller.msg(string) @@ -75,10 +77,16 @@ class CmdList(MuxCommand): @list - list info Usage: - @list commands | process - + @list