PEP8 cleanup of the entire codebase. Unchanged are many cases of too-long lines, partly because of the rewrite they would require but also because splitting many lines up would make the code harder to read. Also the third-party libraries (idmapper, prettytable etc) were not cleaned.

This commit is contained in:
Griatch 2013-11-14 19:31:17 +01:00
parent 30b7d2a405
commit 1ae17bcbe4
154 changed files with 5613 additions and 4054 deletions

View file

@ -16,6 +16,7 @@ from ev import Command, CmdSet
# Commands defined on the red button
#------------------------------------------------------------
class CmdNudge(Command):
"""
Try to nudge the button's lid
@ -27,7 +28,7 @@ class CmdNudge(Command):
push the lid of the button away.
"""
key = "nudge lid" # two-word command name!
key = "nudge lid" # two-word command name!
aliases = ["nudge"]
locks = "cmd:all()"
@ -44,6 +45,7 @@ class CmdNudge(Command):
self.caller.msg("You manage to get a nail under the lid.")
self.caller.execute_cmd("open lid")
class CmdPush(Command):
"""
Push the red button
@ -82,7 +84,6 @@ class CmdPush(Command):
self.caller.msg(string)
class CmdSmashGlass(Command):
"""
smash glass
@ -118,7 +119,8 @@ class CmdSmashGlass(Command):
string += " you should just try to open the lid instead?"
self.caller.msg(string)
self.caller.location.msg_contents("%s tries to smash the glass of the button." %
(self.caller.name), exclude=self.caller)
(self.caller.name), exclude=self.caller)
class CmdOpenLid(Command):
"""
@ -144,12 +146,13 @@ class CmdOpenLid(Command):
string += "the lid will soon close again."
self.caller.msg(string)
self.caller.location.msg_contents("%s opens the lid of the button." %
(self.caller.name), exclude=self.caller)
(self.caller.name), exclude=self.caller)
# add the relevant cmdsets to button
self.obj.cmdset.add(LidClosedCmdSet)
# call object method
self.obj.open_lid()
class CmdCloseLid(Command):
"""
close the lid
@ -174,6 +177,7 @@ class CmdCloseLid(Command):
self.caller.location.msg_contents("%s closes the button's lid." %
(self.caller.name), exclude=self.caller)
class CmdBlindLook(Command):
"""
Looking around in darkness
@ -209,7 +213,8 @@ class CmdBlindLook(Command):
string += "Until it wears off, all you can do is feel around blindly."
self.caller.msg(string)
self.caller.location.msg_contents("%s stumbles around, blinded." %
(self.caller.name), exclude=self.caller)
(self.caller.name), exclude=self.caller)
class CmdBlindHelp(Command):
"""
@ -232,7 +237,6 @@ class CmdBlindHelp(Command):
# Command sets for the red button
#---------------------------------------------------------------
# We next tuck these commands into their respective command sets.
# (note that we are overdoing the cdmset separation a bit here
# to show how it works).
@ -247,12 +251,13 @@ class DefaultCmdSet(CmdSet):
using obj.cmdset.add_default().
"""
key = "RedButtonDefault"
mergetype = "Union" # this is default, we don't really need to put it here.
mergetype = "Union" # this is default, we don't really need to put it here.
def at_cmdset_creation(self):
"Init the cmdset"
self.add(CmdPush())
class LidClosedCmdSet(CmdSet):
"""
A simple cmdset tied to the redbutton object.
@ -274,6 +279,7 @@ class LidClosedCmdSet(CmdSet):
self.add(CmdSmashGlass())
self.add(CmdOpenLid())
class LidOpenCmdSet(CmdSet):
"""
This is the opposite of the Closed cmdset.
@ -288,6 +294,7 @@ class LidOpenCmdSet(CmdSet):
"setup the cmdset (just one command)"
self.add(CmdCloseLid())
class BlindCmdSet(CmdSet):
"""
This is the cmdset added to the *player* when
@ -300,8 +307,8 @@ class BlindCmdSet(CmdSet):
# we want to stop the player from walking around
# in this blinded state, so we hide all exits too.
# (channel commands will still work).
no_exits = True # keep player in the same room
no_objs = True # don't allow object commands
no_exits = True # keep player in the same room
no_objs = True # don't allow object commands
def at_cmdset_creation(self):
"Setup the blind cmdset"