Apply black to cleanup code

This commit is contained in:
Griatch 2022-06-12 09:46:48 +02:00
parent 45ed27c7f1
commit a83f21ef2f
33 changed files with 256 additions and 194 deletions

View file

@ -450,9 +450,7 @@ class CmdSetHandler(object):
"""
if "permanent" in kwargs:
logger.log_dep(
"obj.cmdset.add() kwarg 'permanent' has changed name to 'persistent'."
)
logger.log_dep("obj.cmdset.add() kwarg 'permanent' has changed name to 'persistent'.")
persistent = kwargs["permanent"] if persistent is False else persistent
if not (isinstance(cmdset, str) or utils.inherits_from(cmdset, CmdSet)):

View file

@ -2219,11 +2219,13 @@ class CmdTypeclass(COMMAND_DEFAULT_CLASS):
old_typeclass_path = obj.typeclass_path
if reset:
answer = yield("|yNote that this will reset the object back to its typeclass' default state, "
"removing any custom locks/perms/attributes etc that may have been added "
"by an explicit create_object call. Use `update` or type/force instead in order "
"to keep such data. "
"Continue [Y]/N?|n")
answer = yield (
"|yNote that this will reset the object back to its typeclass' default state, "
"removing any custom locks/perms/attributes etc that may have been added "
"by an explicit create_object call. Use `update` or type/force instead in order "
"to keep such data. "
"Continue [Y]/N?|n"
)
if answer.upper() in ("N", "NO"):
caller.msg("Aborted.")
return
@ -3473,7 +3475,7 @@ class CmdScripts(COMMAND_DEFAULT_CLASS):
caller.msg("\n".join(msgs))
if "delete" not in self.switches:
if script and script.pk:
ScriptEvMore(caller, [script], session=self.session)
ScriptEvMore(caller, [script], session=self.session)
else:
caller.msg("Script was deleted automatically.")
else:

View file

@ -107,8 +107,7 @@ class TestGeneral(BaseEvenniaCommandTest):
def test_nick_list(self):
self.call(general.CmdNick(), "/list", "No nicks defined.")
self.call(general.CmdNick(), "test1 = Hello",
"Inputline-nick 'test1' mapped to 'Hello'.")
self.call(general.CmdNick(), "test1 = Hello", "Inputline-nick 'test1' mapped to 'Hello'.")
self.call(general.CmdNick(), "/list", "Defined Nicks:")
def test_get_and_drop(self):
@ -1295,7 +1294,8 @@ class TestBuilding(BaseEvenniaCommandTest):
"Obj2 = evennia.objects.objects.DefaultExit",
"Obj2 changed typeclass from evennia.objects.objects.DefaultObject "
"to evennia.objects.objects.DefaultExit.",
cmdstring="swap", inputs=["yes"],
cmdstring="swap",
inputs=["yes"],
)
self.call(building.CmdTypeclass(), "/list Obj", "Core typeclasses")
self.call(
@ -1332,7 +1332,7 @@ class TestBuilding(BaseEvenniaCommandTest):
"/reset/force Obj=evennia.objects.objects.DefaultObject",
"Obj updated its existing typeclass (evennia.objects.objects.DefaultObject).\n"
"All object creation hooks were run. All old attributes where deleted before the swap.",
inputs=["yes"]
inputs=["yes"],
)
from evennia.prototypes.prototypes import homogenize_prototype
@ -1359,7 +1359,7 @@ class TestBuilding(BaseEvenniaCommandTest):
"typeclasses.objects.Object.\nOnly the at_object_creation hook was run "
"(update mode). Attributes set before swap were not removed\n"
"(use `swap` or `type/reset` to clear all). Prototype 'replaced_obj' was "
"successfully applied over the object type."
"successfully applied over the object type.",
)
assert self.obj1.db.desc == "protdesc"