Skip to content

Commit

Permalink
Add new splah screens. Improved styling. Removed Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
yorevs committed Nov 13, 2024
1 parent 0ab6b96 commit 8b5598b
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 128 deletions.
87 changes: 0 additions & 87 deletions Makefile

This file was deleted.

36 changes: 19 additions & 17 deletions src/main/askai/core/askai_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@
Copyright (c) 2024, HomeSetup
"""
import logging as log
import os
import signal
from pathlib import Path
from threading import Thread
from typing import List, Optional, TypeAlias

import nltk
import pause
from clitt.core.term.cursor import cursor
from clitt.core.term.screen import screen
from clitt.core.tui.line_input.keyboard_input import KeyboardInput
from hspylib.core.enums.charset import Charset
from hspylib.core.tools.commons import console_out
from hspylib.core.zoned_datetime import now, TIME_FORMAT
from hspylib.modules.eventbus.event import Event
from rich.progress import Progress

from askai.core.askai import AskAi
from askai.core.askai_configs import configs
from askai.core.askai_events import *
Expand All @@ -27,22 +45,6 @@
from askai.core.support.shared_instances import shared
from askai.core.support.utilities import display_text
from askai.tui.app_icons import AppIcons
from clitt.core.term.cursor import cursor
from clitt.core.term.screen import screen
from clitt.core.tui.line_input.keyboard_input import KeyboardInput
from hspylib.core.enums.charset import Charset
from hspylib.core.zoned_datetime import now, TIME_FORMAT
from hspylib.modules.eventbus.event import Event
from pathlib import Path
from rich.progress import Progress
from threading import Thread
from typing import List, Optional, TypeAlias

import logging as log
import nltk
import os
import pause
import signal

QueryString: TypeAlias = str | List[str] | None

Expand Down Expand Up @@ -165,7 +167,7 @@ def _splash(self, interval: int = 250) -> None:
:param interval: The interval in milliseconds for polling the startup status (default is 250 ms).
"""
screen.clear()
display_text(f"%GREEN%{self.SPLASH}%NC%", markdown=False)
console_out.print(self.SPLASH)
while not self._ready:
pause.milliseconds(interval)
screen.clear()
Expand Down
2 changes: 1 addition & 1 deletion src/main/askai/core/askai_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def t(self, text: AnyStr) -> str:
# Informational

def welcome(self, username: AnyStr) -> str:
return f"Welcome back {username}, How can I assist you today ?"
return f"Welcome back {username}. What can I help with?"

def wait(self) -> str:
return "Thinking…"
Expand Down
5 changes: 3 additions & 2 deletions src/main/askai/core/support/shared_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def max_iteractions(self) -> int:
@property
def app_info(self) -> str:
device_info = f"{recorder.input_device[1]}" if recorder.input_device else ""
device_info += f", AUTO-SWAP {'' if recorder.is_auto_swap else '%RED%'}"
device_info += f", %YELLOW%AUTO-SWAP {'%GREEN%' if recorder.is_auto_swap else '%RED%'}"
dtm = f" {geo_location.datetime} "
speak_info = str(configs.tempo) + " @" + self.engine.configs().tts_voice
cur_dir = elide_text(str(Path(os.getcwd()).absolute()), 67, "…")
Expand All @@ -135,11 +135,12 @@ def app_info(self) -> str:
Dir: {cur_dir}
OS: {prompt.os_type}/{prompt.shell}
{'-' * 80}
Microphone: {device_info or '%RED%Undetected'} %GREEN%
Microphone: %CYAN%{device_info or '%RED%Undetected'} %GREEN%
Debugging: {'' if configs.is_debug else '%RED%'} %GREEN%
Speaking: {', tempo: ' + speak_info if configs.is_speak else '%RED%'} %GREEN%
Caching: {', TTL: ' + str(configs.ttl) if configs.is_cache else '%RED%'} %GREEN%
{'=' * 80}%NC%
"""
)

Expand Down
21 changes: 21 additions & 0 deletions src/main/askai/resources/splash-orig.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
################
### ###
## ##### ### ##
# ####### # ######## ###
### # #### # ###### ## #
### # ## ( ) #### ## ### #
## ( ) # ## ########## # #
_ _ _
| | ___ __ _ __| (_)_ __ __ _
| | / _ \ / _` |/ _` | | '_ \ / _` |
| |__| (_) | (_| | (_| | | | | | (_| |_ _ _
|_____\___/ \__,_|\__,_|_|_| |_|\__, (_|_|_)
|___/

# # ## ## ### ################ ####
( ) ( ) ### ### ############## #
### # ### ############ #
# ### ######## #
# #### #
( ) #####

20 changes: 20 additions & 0 deletions src/main/askai/resources/splash-robota.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. ...,*.,**,. .*.,**,*##%&&@@@&#**.
*, *. ... ...*,..*/(**#&&@@@&%,*,*
. ,,...%*.* ..*****..***/(%&@%@@%#*(,,
.., ./**,...*,,,,,,..,**/(#&&@@&&#(/..,
*//.*...,.,./.*,**,,,,,,**,., /,***,,,
((/(.,,,.,(((//*/*/*/****/**,... .,
/(//(,#,/(//(##**//((/#%%&%#**,,,,,*,
*(///,(**//((((#(##(((%%%%%#//****#@%(,
*(,/*#..,,,,,***/(%%&(/(/(***/,**,*#&,
***,,,.,,**,,,,,,*/(#&@@&(**#&%(****#%
..,*/**#%#/.*(//*,,*/#%&&&&&&@@&(/,,*##
*/.,(/##,,/%*.*(***,**(#%%&&&&&%*...,*#%
/*,,(/&(/(.%/*...,*..,*/((%%%#( ..,,,.,*,
*%,.,/*,,.,#*,*.,*., ,,**/(###%%
,*//**,(/..,* ...* .,,**,(##%&@@&,/
.. *..,,/( , **/%*/.,,,.,,.., .
, .,..,,**,.(.*/.*,*,*..,,,,(((%@@(*
%, .. **.,, ,* . ...,.,**,. .
//. . ,. ,... .,,./ ...,,/(%&@%**
,%, ..,,//,.. ...... .. .,,*(#%/,, Loading...
21 changes: 21 additions & 0 deletions src/main/askai/resources/splash-skull.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(&&&&&&%
#%%%%&&&&&&@@@@@&%
/#%%%&&&&@@@@@@@@@@@@@@
/###%%%%%&%%%%&&&&&@@@@@%&
*(,#(((////(/////(((%%@@@@&#
*(,*//*((#(//*/*((#%&&&&@@&%
*/*,##%/. ../(*(/...*%@@@#%&
**/* . ,. @##
,., ,,#/, *%(
.,*, **( %#* .&%,
,/(*,,,...,* *..,****##(
,. . ,* *,, ,((
**(*,*/%*(*%(* ( *
(/(((# #((#%,
..*//*,//*.,[/green4][spring_green4][bold]
__ _ _
/ / ___ __ _ __| (_)_ __ __ _
/ / / _ \ / _` |/ _` | | '_ \ / _` |
/ /__| (_) | (_| | (_| | | | | | (_| |_ _ _
\____/\___/ \__,_|\__,_|_|_| |_|\__, (_|_|_)
|___/
42 changes: 21 additions & 21 deletions src/main/askai/resources/splash.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
################
### ###
## ##### ### ##
# ####### # ######## ###
### # #### # ###### ## #
### # ## ( ) #### ## ### #
## ( ) # ## ########## # #
_ _ _
| | ___ __ _ __| (_)_ __ __ _
| | / _ \ / _` |/ _` | | '_ \ / _` |
| |__| (_) | (_| | (_| | | | | | (_| |_ _ _
|_____\___/ \__,_|\__,_|_|_| |_|\__, (_|_|_)
|___/

# # ## ## ### ################ ####
( ) ( ) ### ### ############## #
### # ### ############ #
# ### ######## #
# #### #
( ) #####

[green4] (&&&&&&%
#%%%%&&&&&&@@@@@&%
/#%%%&&&&@@@@@@@@@@@@@@
/###%%%%%&%%%%&&&&&@@@@@%&
*(,#(((////(/////(((%%@@@@&#
*(,*//*((#(//*/*((#%&&&&@@&%
*/*,##%/. ../(*(/...*%@@@#%&
**/* . ,. @##
,., ,,#/, *%(
.,*, **( %#* .&%,
,/(*,,,...,* *..,****##(
,. . ,* *,, ,((
**(*,*/%*(*%(* ( *
(/(((# #((#%,
..*//*,//*.,[/green4][spring_green4][bold]
__ _ _
/ / ___ __ _ __| (_)_ __ __ _
/ / / _ \ / _` |/ _` | | '_ \ / _` |
/ /__| (_) | (_| | (_| | | | | | (_| |_ _ _
\____/\___/ \__,_|\__,_|_|_| |_|\__, (_|_|_)
|___/[/spring_green4][/bold]

0 comments on commit 8b5598b

Please sign in to comment.