Skip to content

Commit

Permalink
fixed print_logo
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Al-Saffar committed Nov 22, 2023
1 parent 666000e commit babf008
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions myresources/crocodile/croshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ def print_header():


def print_logo(logo: str):
from crocodile.msc.ascii_art import font_box_color, charachter_color, character_or_box_color
from crocodile.msc.ascii_art import font_box_color, character_color, character_or_box_color
if platform.system() == "Windows":
_1x = P.home().joinpath(r"AppData/Roaming/npm/figlet").exists()
_2x = P.home().joinpath(r"AppData/Roaming/npm/lolcatjs").exists()
_3x = P.home().joinpath(r"AppData/Local/Microsoft/WindowsApps/boxes.exe").exists()
if _1x and _2x and _3x:
if random.choice([True, True, False]): font_box_color(logo)
else: charachter_color(logo)
else: character_color(logo)
else:
print(f"Missing ascii art dependencies. Install with: iwr bit.ly/cfgasciiartwindows | iex")
_default_art = P(__file__).parent.joinpath("art").search().sample(size=1)[0]
Expand Down
4 changes: 2 additions & 2 deletions myresources/crocodile/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ def run_script(self, script: str, shell: SHELLS = "default", verbose: bool = Fal
full_command = [shell, str(tmp_file)]

if verbose:
from machineconfig.utils.utils import print_programming_script
print_programming_script(script, lexer="shell", desc="Script to be executed:")
from machineconfig.utils.utils import print_code
print_code(code=script, lexer="shell", desc="Script to be executed:")
import rich.progress as pb
with pb.Progress(transient=True) as progress:
_task = progress.add_task("Running Script", total=None)
Expand Down
3 changes: 2 additions & 1 deletion myresources/crocodile/msc/ascii_art.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class BoxStyles:

class CowStyles:
eyes = ['-b', '-d', '-g', '-h', '-l', '-L', '-n', '-N', '-p', '-s', '-t', '-w', '-y']
# this one for the package installed with sudo apt install cowsay and is located at /usr/games/cowsay. See cowsay -l
figures = ['apt', 'bunny', 'cheese', 'cock', 'cower', 'daemon', 'default', 'dragon',
'dragon-and-cow', 'duck', 'elephant', 'elephant-in-snake', 'eyes', 'fox', 'ghostbusters',
'gnu', 'kangaroo', 'kiss', 'milk',
Expand Down Expand Up @@ -106,7 +107,7 @@ def font_box_color(logo: str):
# print("after")


def charachter_color(logo: str):
def character_color(logo: str):
assert platform.system() == 'Windows', 'This function is only for Windows.'
# from rgbprint import gradient_scroll, Color
# gradient_scroll(ArtLib.cowsay("crocodile"), start_color=0x4BBEE3, end_color=Color.medium_violet_red, times=3)
Expand Down

0 comments on commit babf008

Please sign in to comment.