[ci] auto-format

This commit is contained in:
kingsamurai123 2022-12-21 08:39:02 +00:00 committed by Rikko
parent 7a8e9d3155
commit 5caa5bdf2f

View file

@ -787,7 +787,7 @@ class PluginWindow(popup.PopupWindow):
self.scale_origin = origin_widget.get_screen_space_center()
loop = asyncio.get_event_loop()
loop.create_task(self.draw_ui())
def partition(string, minimum_character_offset=40):
string_length = len(string)
@ -795,8 +795,10 @@ class PluginWindow(popup.PopupWindow):
partitioned_string_length = len(partitioned_string)
while partitioned_string_length != string_length:
next_empty_space = string[partitioned_string_length + minimum_character_offset:].find(" ")
next_word_end_position = partitioned_string_length + minimum_character_offset + max(0, next_empty_space)
next_empty_space = string[partitioned_string_length +
minimum_character_offset:].find(" ")
next_word_end_position = partitioned_string_length + \
minimum_character_offset + max(0, next_empty_space)
partitioned_string += string[partitioned_string_length:next_word_end_position]
if next_empty_space != -1:
# Insert a line break here, there's still more partitioning to do.