diff --git a/evennia/commands/default/tests.py b/evennia/commands/default/tests.py index 5b92eda25e..cb990d507e 100644 --- a/evennia/commands/default/tests.py +++ b/evennia/commands/default/tests.py @@ -1584,8 +1584,9 @@ class TestBuilding(BaseEvenniaCommandTest): self.call( building.CmdTeleport(), "Obj = Room2", - "Obj(#{}) is leaving Room(#{}), heading for Room2(#{}).|Teleported Obj -> Room2." - .format(oid, rid, rid2), + "Obj(#{}) is leaving Room(#{}), heading for Room2(#{}).|Teleported Obj -> Room2.".format( + oid, rid, rid2 + ), ) self.call(building.CmdTeleport(), "NotFound = Room", "Could not find 'NotFound'.") self.call( @@ -1701,8 +1702,7 @@ class TestBuilding(BaseEvenniaCommandTest): self.call( building.CmdSpawn(), "{'prototype_key':'GOBLIN', 'typeclass':'evennia.objects.objects.DefaultCharacter', " - "'key':'goblin', 'location':'%s'}" - % spawnLoc.dbref, + "'key':'goblin', 'location':'%s'}" % spawnLoc.dbref, "Spawned goblin", ) goblin = get_object(self, "goblin") @@ -1750,8 +1750,7 @@ class TestBuilding(BaseEvenniaCommandTest): self.call( building.CmdSpawn(), "/noloc {'prototype_parent':'TESTBALL', 'key': 'Ball', 'prototype_key': 'foo'," - " 'location':'%s'}" - % spawnLoc.dbref, + " 'location':'%s'}" % spawnLoc.dbref, "Spawned Ball", ) ball = get_object(self, "Ball") diff --git a/evennia/utils/evtable.py b/evennia/utils/evtable.py index 39c4908d34..bb60a350a7 100644 --- a/evennia/utils/evtable.py +++ b/evennia/utils/evtable.py @@ -555,36 +555,6 @@ class EvCell: return adjusted_data - def _center(self, text, width, pad_char): - """ - Horizontally center text on line of certain width, using padding. - - Args: - text (str): The text to center. - width (int): How wide the area is (in characters) where `text` - should be centered. - pad_char (str): Which padding character to use. - - Returns: - text (str): Centered text. - - """ - excess = width - d_len(text) - if excess <= 0: - return text - if excess % 2: - # uneven padding - narrowside = (excess // 2) * pad_char - widerside = narrowside + pad_char - if width % 2: - return narrowside + text + widerside - else: - return widerside + text + narrowside - else: - # even padding - same on both sides - side = (excess // 2) * pad_char - return side + text + side - def _align(self, data): """ Align list of rows of cell. Whitespace characters will be stripped