Skip to content

Commit

Permalink
Config Tool: ESBMC Menu - Implemented ESBMC Path
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiannis128 committed Feb 20, 2024
1 parent 9f3296e commit a8dfa76
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions esbmc_ai_config/contexts/esbmc_menu/esbmc_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,32 @@
from esbmc_ai_config.contexts.base_menu import BaseMenu
from esbmc_ai_config.contexts.esbmc_menu.esbmc_manage import ESBMCManage
from esbmc_ai_config.widgets.text_input_button import TextInputButton
from esbmc_ai_config.models.config_manager import ConfigManager


class ESBMCMenu(BaseMenu):
def __init__(self) -> None:
super().__init__(title="ESBMC Options", choices=self._get_menu_choices())

def _on_esbmc_path(self, title: str, value: str, ok_pressed: bool) -> None:
return
if ok_pressed:
ConfigManager.json_config.set_value(value, "esbmc_path")
# Refresh UI
self.widget = self.build_ui()

def _get_menu_choices(self) -> list[str | urwid.Widget]:
return [
urwid.AttrMap(
urwid.Button(
"Install ESBMC",
on_press=lambda button: ContextManager.push_context(ESBMCManage()),
on_press=lambda _: ContextManager.push_context(ESBMCManage()),
),
None,
"reversed",
),
TextInputButton(
"ESBMC Path",
"",
str(ConfigManager.json_config.get_value("esbmc_path")),
on_submit=self._on_esbmc_path,
),
"ESBMC Parameters",
Expand Down

0 comments on commit a8dfa76

Please sign in to comment.