Ran black on code
This commit is contained in:
parent
020854f697
commit
7d8c6f2a26
2 changed files with 5 additions and 36 deletions
|
|
@ -1584,8 +1584,9 @@ class TestBuilding(BaseEvenniaCommandTest):
|
||||||
self.call(
|
self.call(
|
||||||
building.CmdTeleport(),
|
building.CmdTeleport(),
|
||||||
"Obj = Room2",
|
"Obj = Room2",
|
||||||
"Obj(#{}) is leaving Room(#{}), heading for Room2(#{}).|Teleported Obj -> Room2."
|
"Obj(#{}) is leaving Room(#{}), heading for Room2(#{}).|Teleported Obj -> Room2.".format(
|
||||||
.format(oid, rid, rid2),
|
oid, rid, rid2
|
||||||
|
),
|
||||||
)
|
)
|
||||||
self.call(building.CmdTeleport(), "NotFound = Room", "Could not find 'NotFound'.")
|
self.call(building.CmdTeleport(), "NotFound = Room", "Could not find 'NotFound'.")
|
||||||
self.call(
|
self.call(
|
||||||
|
|
@ -1701,8 +1702,7 @@ class TestBuilding(BaseEvenniaCommandTest):
|
||||||
self.call(
|
self.call(
|
||||||
building.CmdSpawn(),
|
building.CmdSpawn(),
|
||||||
"{'prototype_key':'GOBLIN', 'typeclass':'evennia.objects.objects.DefaultCharacter', "
|
"{'prototype_key':'GOBLIN', 'typeclass':'evennia.objects.objects.DefaultCharacter', "
|
||||||
"'key':'goblin', 'location':'%s'}"
|
"'key':'goblin', 'location':'%s'}" % spawnLoc.dbref,
|
||||||
% spawnLoc.dbref,
|
|
||||||
"Spawned goblin",
|
"Spawned goblin",
|
||||||
)
|
)
|
||||||
goblin = get_object(self, "goblin")
|
goblin = get_object(self, "goblin")
|
||||||
|
|
@ -1750,8 +1750,7 @@ class TestBuilding(BaseEvenniaCommandTest):
|
||||||
self.call(
|
self.call(
|
||||||
building.CmdSpawn(),
|
building.CmdSpawn(),
|
||||||
"/noloc {'prototype_parent':'TESTBALL', 'key': 'Ball', 'prototype_key': 'foo',"
|
"/noloc {'prototype_parent':'TESTBALL', 'key': 'Ball', 'prototype_key': 'foo',"
|
||||||
" 'location':'%s'}"
|
" 'location':'%s'}" % spawnLoc.dbref,
|
||||||
% spawnLoc.dbref,
|
|
||||||
"Spawned Ball",
|
"Spawned Ball",
|
||||||
)
|
)
|
||||||
ball = get_object(self, "Ball")
|
ball = get_object(self, "Ball")
|
||||||
|
|
|
||||||
|
|
@ -555,36 +555,6 @@ class EvCell:
|
||||||
|
|
||||||
return adjusted_data
|
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):
|
def _align(self, data):
|
||||||
"""
|
"""
|
||||||
Align list of rows of cell. Whitespace characters will be stripped
|
Align list of rows of cell. Whitespace characters will be stripped
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue