Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions curtsies/formatstringarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,21 @@ def __setitem__(self, slicetuple, value):
msg = "You are trying to fit this value {} into the region {}: {}".format(
fmtstr("".join(value), bg="cyan"),
fmtstr("").join(grid_value),
"\n ".join(grid_fsarray[x] for x in range(len(self.rows))),
fmtstr("\n ").join(grid_fsarray[x] for x in range(len(self.rows))),
)
raise ValueError(
"""Error you are trying to replace a region of {} rows by {}
columns for and area of {} with a value of len {}. The value
used to replace the region must equal the area of the region
replace.
{}""".format(
"""{}
You are trying to replace a region of {} rows by {}
columns and area {} with a region of {} rows and total
area of {}. The value used to replace the region must equal the
area of the region replaced.
""".format(
msg,
rowslice.stop - rowslice.start,
colslice.stop - colslice.start,
area,
len(value),
val_len,
msg,
)
)
self.rows = (
Expand Down
Loading