Skip to content

Commit

Permalink
Fix Textual future issue and add .vscode to git
Browse files Browse the repository at this point in the history
  • Loading branch information
yorevs committed Dec 10, 2024
1 parent d66d73c commit f39ebea
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,5 @@ Desktop.ini
*egg-info/
py-gradle-master/
build/
.vscode/
.venv/
venv
Expand Down
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"env": {
"PYTHONPATH": "${workspaceFolder}/src/main${pathSeparator}${workspaceFolder}/src/test${pathSeparator}${workspaceFolder}/src/demo${pathSeparator}${env:PYTHONPATH}"
}
}
]
}
37 changes: 37 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"_config.yml": true,
".gradle": true,
".vscode": true,
".idea": true,
".pytest_cache": true,
".gitattributes": true,
".gitconfig": true,
".gitignore": true,
".pylintrc": true,
"buildTools.txt": true,
"AskAI.code-workspace": true,
"gradlew.bat": true,
"gradlew": true,
"bumpver.toml": true,
".editorconfig": true,
"**/__pycache__": true,
"**/__pycache__.*": true,
"**/*.egg-info": true
},
"hide-files.files": [],
"cSpell.words": [
"aporetti",
"askai",
"clitt",
"hspylib",
"syserr",
"unior"
]
}
23 changes: 23 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "00_Run __main__.py",
"type": "process",
"command": "python3.11",
"args": [
"__main__.py"
],
"options": {
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/src/main/${workspaceFolderBasename}/",
"env": {
"PYTHONPATH": "${workspaceFolder}/src/main${pathSeparator}${workspaceFolder}/src/test${pathSeparator}${workspaceFolder}/src/demo${pathSeparator}${env:PYTHONPATH}"
}
},
"presentation": {
"reveal": "always"
}
}
]
}
10 changes: 5 additions & 5 deletions src/main/askai/tui/askai_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ def _invoke_later_(arg: bool = True) -> None:

self.call_from_thread(_invoke_later_, enable)

async def activate_markdown(self) -> None:
def activate_markdown(self) -> None:
"""Activate the markdown console widget."""
await self.md_console.go(self.console_path)
self.md_console.go(self.console_path)
self.md_console.set_class(False, "-hidden")
self.md_console.scroll_end(animate=False)

Expand Down Expand Up @@ -286,8 +286,8 @@ async def action_ptt(self) -> None:
if spoken_text := self.engine.speech_to_text():
self.display_text(f"{shared.username_md}: {spoken_text}")
if self.ask_and_reply(spoken_text):
await self.suggester.add_suggestion(spoken_text)
suggestions = await self.suggester.suggestions()
self.suggester.add_suggestion(spoken_text)
suggestions = self.suggester.suggestions()
cache.save_input_history(suggestions)
self.enable_controls()

Expand Down Expand Up @@ -439,7 +439,7 @@ async def _setup(self) -> None:
"""Setup the TUI controls."""
player.start_delay()
self.splash.set_class(True, "-hidden")
await self.activate_markdown()
self.activate_markdown()
self.action_clear(overwrite=False)
self.enable_controls()
self.line_input.focus(False)

0 comments on commit f39ebea

Please sign in to comment.