From 9b391fbe6b49e5a072b07bef5be0292d45256a01 Mon Sep 17 00:00:00 2001 From: BlauFeuer Date: Thu, 16 Feb 2017 21:21:20 -0500 Subject: [PATCH] contrib/chargen.py code cleaning, update markup Also remove commented code and redundant code --- evennia/contrib/chargen.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/evennia/contrib/chargen.py b/evennia/contrib/chargen.py index 55639e4e90..a80a338b0c 100644 --- a/evennia/contrib/chargen.py +++ b/evennia/contrib/chargen.py @@ -37,6 +37,7 @@ from evennia import default_cmds, managers CHARACTER_TYPECLASS = settings.BASE_CHARACTER_TYPECLASS + class CmdOOCLook(default_cmds.CmdLook): """ ooc look @@ -96,7 +97,6 @@ class CmdOOCLook(default_cmds.CmdLook): return # not inspecting a character. Show the OOC info. - charobjs = [] charnames = [] if self.caller.db._character_dbrefs: dbrefs = self.caller.db._character_dbrefs @@ -104,18 +104,18 @@ class CmdOOCLook(default_cmds.CmdLook): charnames = [charobj.key for charobj in charobjs if charobj] if charnames: charlist = "The following Character(s) are available:\n\n" - charlist += "\n\r".join(["{w %s{n" % charname for charname in charnames]) - charlist += "\n\n Use {w@ic {n to switch to that Character." + charlist += "\n\r".join(["|w %s|n" % charname for charname in charnames]) + charlist += "\n\n Use |w@ic |n to switch to that Character." else: charlist = "You have no Characters." string = \ -""" You, %s, are an {wOOC ghost{n without form. The world is hidden +""" You, %s, are an |wOOC ghost|n without form. The world is hidden from you and besides chatting on channels your options are limited. You need to have a Character in order to interact with the world. %s - Use {wcreate {n to create a new character and {whelp{n for a + Use |wcreate |n to create a new character and |whelp|n for a list of available commands.""" % (self.caller.key, charlist) self.caller.msg(string) @@ -160,13 +160,13 @@ class CmdOOCCharacterCreate(Command): charname = self.args.strip() old_char = managers.objects.get_objs_with_key_and_typeclass(charname, CHARACTER_TYPECLASS) if old_char: - self.caller.msg("Character {c%s{n already exists." % charname) + self.caller.msg("Character |c%s|n already exists." % charname) return # create the character new_character = create_object(CHARACTER_TYPECLASS, key=charname) if not new_character: - self.caller.msg("{rThe Character couldn't be created. This is a bug. Please contact an admin.") + self.caller.msg("|rThe Character couldn't be created. This is a bug. Please contact an admin.") return # make sure to lock the character to only be puppeted by this player new_character.locks.add("puppet:id(%i) or pid(%i) or perm(Immortals) or pperm(Immortals)" % @@ -179,7 +179,7 @@ class CmdOOCCharacterCreate(Command): else: avail_chars = [new_character.id] self.caller.db._character_dbrefs = avail_chars - self.caller.msg("{gThe Character {c%s{g was successfully created!" % charname) + self.caller.msg("|gThe Character |c%s|g was successfully created!" % charname) class OOCCmdSetCharGen(default_cmds.PlayerCmdSet): @@ -187,7 +187,6 @@ class OOCCmdSetCharGen(default_cmds.PlayerCmdSet): Extends the default OOC cmdset. """ def at_cmdset_creation(self): - "Install everything from the default set, then overload" - #super(OOCCmdSetCharGen, self).at_cmdset_creation() + """Install everything from the default set, then overload""" self.add(CmdOOCLook()) self.add(CmdOOCCharacterCreate())