dependency tweaks to avoid installing/uninstalling pkgs

This commit is contained in:
Lincoln Stein
2023-07-30 10:17:04 -04:00
parent 7d7a9273ed
commit adb85036e6
2 changed files with 7 additions and 4 deletions

View File

@ -256,6 +256,7 @@ class addModelsForm(CyclingForm, npyscreen.FormMultiPage):
model_labels = [self.model_labels[x] for x in model_list]
show_recommended = len(self.installed_models) == 0
truncated = False
if len(model_list) > 0:
max_width = max([len(x) for x in model_labels])
columns = window_width // (max_width + 8) # 8 characters for "[x] " and padding
@ -274,10 +275,9 @@ class addModelsForm(CyclingForm, npyscreen.FormMultiPage):
)
)
truncation = False
if len(model_labels) > MAX_OTHER_MODELS:
model_labels = model_labels[0:MAX_OTHER_MODELS]
truncation = True
truncated = True
widgets.update(
models_selected=self.add_widget_intelligent(
@ -297,7 +297,7 @@ class addModelsForm(CyclingForm, npyscreen.FormMultiPage):
models=model_list,
)
if truncation:
if truncated:
widgets.update(
warning_message=self.add_widget_intelligent(
npyscreen.FixedText,