diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index 7e195e401e..1ab8e8714a 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -2100,20 +2100,16 @@ class CmdTypeclass(COMMAND_DEFAULT_CLASS): if "prototype" in self.switches: diff, _ = spawner.prototype_diff_from_object(prototype, obj) txt, options = _format_diff_text_and_options(diff, objects=[obj]) - prompt = "Applying prototype '%s' over '%s' will cause the follow changes:\n%s\n" % \ - ( - prototype["key"], - obj.name, - "\n".join(txt) - ) + prompt = ( + "Applying prototype '%s' over '%s' will cause the follow changes:\n%s\n" + % (prototype["key"], obj.name, "\n".join(txt)) + ) if not reset: prompt += "\n|yWARNING:|n Use the /reset switch to apply the prototype over a blank state." prompt += "\nAre you sure you want to apply these changes [yes]/no?" answer = yield (prompt) if answer and answer in ("no", "n"): - caller.msg( - "Canceled: No changes were applied." - ) + caller.msg("Canceled: No changes were applied.") return # we let this raise exception if needed @@ -2144,7 +2140,10 @@ class CmdTypeclass(COMMAND_DEFAULT_CLASS): else: string += " Attributes set before swap were not removed." if "prototype" in self.switches and prototype_success: - string += " Prototype '%s' was successfully applied over the object type." % prototype["key"] + string += ( + " Prototype '%s' was successfully applied over the object type." + % prototype["key"] + ) caller.msg(string) diff --git a/evennia/commands/default/tests.py b/evennia/commands/default/tests.py index 0dd76f8d6f..d41a1ca4ca 100644 --- a/evennia/commands/default/tests.py +++ b/evennia/commands/default/tests.py @@ -992,15 +992,22 @@ class TestBuilding(CommandTest): ) from evennia.prototypes.prototypes import homogenize_prototype - test_prototype = [homogenize_prototype( - {"prototype_key": "testkey", - "prototype_tags": [], - "typeclass": "typeclasses.objects.Object", - "key":"replaced_obj", - "attrs": [("foo", "bar", None, ""), - ("desc", "protdesc", None, "")]})] - with mock.patch("evennia.commands.default.building.protlib.search_prototype", - new=mock.MagicMock(return_value=test_prototype)) as mprot: + + test_prototype = [ + homogenize_prototype( + { + "prototype_key": "testkey", + "prototype_tags": [], + "typeclass": "typeclasses.objects.Object", + "key": "replaced_obj", + "attrs": [("foo", "bar", None, ""), ("desc", "protdesc", None, "")], + } + ) + ] + with mock.patch( + "evennia.commands.default.building.protlib.search_prototype", + new=mock.MagicMock(return_value=test_prototype), + ) as mprot: self.call( building.CmdTypeclass(), "/prototype Obj=testkey", @@ -1008,7 +1015,7 @@ class TestBuilding(CommandTest): "evennia.objects.objects.DefaultObject to " "typeclasses.objects.Object.\nAll object creation hooks were " "run. Attributes set before swap were not removed. Prototype " - "'replaced_obj' was successfully applied over the object type." + "'replaced_obj' was successfully applied over the object type.", ) assert self.obj1.db.desc == "protdesc" diff --git a/evennia/scripts/scripthandler.py b/evennia/scripts/scripthandler.py index 90404af0f3..31775c3eec 100644 --- a/evennia/scripts/scripthandler.py +++ b/evennia/scripts/scripthandler.py @@ -88,8 +88,10 @@ class ScriptHandler(object): script.start() if not script.id: # this can happen if the script has repeats=1 or calls stop() in at_repeat. - logger.log_info("Script %s started and then immediately stopped; " - "it could probably be a normal function." % scriptclass) + logger.log_info( + "Script %s started and then immediately stopped; " + "it could probably be a normal function." % scriptclass + ) return True def start(self, key): diff --git a/evennia/server/portal/portal.py b/evennia/server/portal/portal.py index 5810e574fc..633e63bb51 100644 --- a/evennia/server/portal/portal.py +++ b/evennia/server/portal/portal.py @@ -388,8 +388,6 @@ if WEBSERVER_ENABLED: webclientstr = "webclient-websocket%s: %s" % (w_ifacestr, port) INFO_DICT["webclient"].append(webclientstr) - - if WEB_PLUGINS_MODULE: try: web_root = WEB_PLUGINS_MODULE.at_webproxy_root_creation(web_root)