mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
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(
|
||||
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")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue