GEN_PARAMS_INT, GEN_PARAMS_STR, # noqa: E402
GEN_PARAMS) # noqa: E402
-PromptDiff = tuple[str, str, str]
-PromptsDiff = dict[str, PromptDiff]
+PromptsDiff = dict[str, str]
BasicItemsAttrs = dict[str, set[str]]
AttrVals: TypeAlias = list[str]
AttrValsByVisibility: TypeAlias = dict[str, AttrVals]
for i, p in enumerate(cores):
cores[i] = p[:-len(suffix)]
for i, p in enumerate(prompts):
- prompts_diff[p] = (cores[i], '', '')
+ pre_ell = '…' if prefix else ''
+ post_ell = '…' if suffix else ''
+ prompts_diff[p] = f'{pre_ell}{cores[i]}{post_ell}'
return prompts_diff
basic_items_attrs = {}
for i, attr in enumerate(ancestors):
parent_attr_name, parent_attr_value = attr
if 'prompt' == parent_attr_name:
- prompt_diff = self._prompts_diff[parent_attr_value]
- parent_attr_value = f'…{prompt_diff[0]}…'
+ parent_attr_value = self\
+ ._prompts_diff[parent_attr_value]
txt = f'<b>{parent_attr_name}</b>: {parent_attr_value}'
vlabel = VerticalLabel(txt, self._slots_geometry)
self._grid.attach(vlabel, i, i_row_ref[0], 1, 1)
top_attr_name: str = sort_attrs[-1][0]
for i, val in enumerate(sort_attrs[-1][1]):
if 'prompt' == top_attr_name:
- val = f'…{self._prompts_diff[val][0]}…'
+ val = self._prompts_diff[val]
label = Gtk.Label(label=f'<b>{top_attr_name}</b>: {val}',
xalign=0,
ellipsize=Pango.EllipsizeMode.MIDDLE)