MCPcopy Index your code
hub / github.com/AmberSahdev/Open-Interface / __init__

Method __init__

app/ui.py:122–142  ·  view source on GitHub ↗
(self, parent)

Source from the content-addressed store, hash-verified

120 """
121
122 def __init__(self, parent):
123 super().__init__(parent)
124 self.title('Settings')
125 self.minsize(300, 450)
126 self.available_themes = ['darkly', 'cyborg', 'journal', 'solar', 'superhero']
127 self.create_widgets()
128
129 self.settings = Settings()
130
131 # Populate UI
132 settings_dict = self.settings.get_dict()
133
134 if 'api_key' in settings_dict:
135 self.api_key_entry.insert(0, settings_dict['api_key'])
136 if 'default_browser' in settings_dict:
137 self.browser_combobox.set(settings_dict['default_browser'])
138 if 'play_ding_on_completion' in settings_dict:
139 self.play_ding.set(1 if settings_dict['play_ding_on_completion'] else 0)
140 if 'custom_llm_instructions':
141 self.llm_instructions_text.insert('1.0', settings_dict['custom_llm_instructions'])
142 self.theme_combobox.set(settings_dict.get('theme', 'superhero'))
143
144 def create_widgets(self) -> None:
145 # API Key Widgets

Callers

nothing calls this directly

Calls 4

create_widgetsMethod · 0.95
SettingsClass · 0.90
get_dictMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected