def about(self, total): from quo.table import _Table self.tool_header() @bind.add("ctrl-b") def _(event): event.app.exit() data = [["Title", "Author", "Contact"], ["sashay", "Gerrishon Sirere", "*****@*****.**"]] features = [["Features"], ["[ + ] Automatic tool installer"], ["[ + ] 370+ tools"], ["[ + ] Requires python 3.8+"]] content = HSplit([ Window(FormattedTextControl(banner, style="fg:red")), Window(height=1, char=Border.HORIZONTAL), Label(f"sashay v {s_version}, using quo v {q_version}"), Window(FormattedTextControl((_Table(data, theme="fancy_grid"))), align="center"), Window(FormattedTextControl((_Table(features, theme="fancy_grid"))), align="center"), Frame(Label(" https://github.com/scalabli/sashay")), Window( FormattedTextControl( Text( "\n\n<b><aquamarine>[</aquamarine> <red>Β»</red> <aquamarine>]</aquamarine> <cyan>With great power, comes great responsibility</cyan>\n\n<green>Press `ctrl-c` or `ctrl-b` to go back</green></b>" ))) ]) container(content, bind=True, full_screen=True) self.tool_footer()
def menu(self, total): self.tool_header() if WIN: show_all = """[1] Show all tools""" show_cat = """[2] Show all categories""" update = """[3] Update Sashay""" about = """[4] About us""" exit_s = """[x] Exit Sashay""" else: show_all = """ [1] πππ π¨ πππ π₯π π ππ€""" show_cat = """ [2] πππ π¨ πππ πππ₯πππ π£πππ€""" update = """ [3] ππ‘πππ₯π πππ€πππͺ""" about = """ [4] πΈππ π¦π₯ π¦π€""" exit_s = """ [x] πΌπ©ππ₯ πππ€πππͺ""" container( HSplit([ Window(FormattedTextControl(f"{show_all}", style="fg:black bg:#006B47"), align="center"), Window(FormattedTextControl(f"{show_cat}", style="fg:black bg:#009965"), align="center"), Window(FormattedTextControl(f"{update}", style="fg:black bg:#00C684"), align="center"), Window(FormattedTextControl(f"{about}", style="fg:black bg:#009965"), align="center"), Window(FormattedTextControl(f"{exit_s}", style="fg:black bg:#006B47"), align="center") ])) self.tool_footer()
def back(self): text = """ππ) πΎπ ππππ""" container( Shadow( Label(text, style="reverse") ), bind=False)
def tool_footer(self): from quo.color import ColorDepth from quo.progress import formatters, ProgressBar custom_formatters = [ # formatters.Label(), # formatters.Text(" "), formatters.Rainbow(formatters.Bar()), # formatters.Text(" left: "), # formatters.Rainbow(formatters.TimeLeft()) ] color_depth = ColorDepth.eight_bit with ProgressBar(color_depth=color_depth, formatters=custom_formatters) as pb: for i in pb(range(100)): time.sleep(0.01) echo(f" ", hidden=True) container( Box( Window( FormattedTextControl( Text( "<st bg='red'> </st><ye bg='yellow'> </ye><gr bg='green'> </gr><bl bg='blue'> </bl><wh bg='white'> </wh><ma bg='magenta'> </ma><cy bg='cyan'> </cy><aq bg='aquamarine'> </aq><cr bg='crimson'> </cr><kh bg='khaki'> </kh><in bg='indigo'> </in><st bg='red'> </st><ye bg='yellow'> </ye><gr bg='green'> </gr><bl bg='blue'> </bl><wh bg='white'> </wh><ma bg='magenta'> </ma><cy bg='cyan'> </cy>" )))))
def exit(self): self.tool_header() container( Window( FormattedTextControl("See you soon"),style="fg:blue bold bg:white", align="center"), bind=False) quo.echo(f'Geez...where are you going so soon?', fg='black', bg='vred') quo.echo(f'Anyway, hope to see you back soon', bg="vred") self.tool_footer()
def already_installed(self,name): self.tool_header() @bind.add("ctrl-c") @bind.add("ctrl-b") def _(event): event.app.exit() container( Label(f"[ + ] Sorry, {name} is already installed!\nPress `ctrl-c` or `ctrl-b` to go back", style="fg:cyan"), bind=True, full_screen=True) self.tool_footer()
def already_installed(self, name): self.tool_header() @bind.add("<any>") def _(event): event.app.exit() container(Box( Label( f"Sorry, {name} is already installed!\nPress any key to go back", style="fg:cyan")), bind=True, full_screen=True) self.tool_footer()
def nonet(self): @bind.add("<any>") def _(event): event.app.exit() self.tool_header() container(Box( Window( FormattedTextControl( Text( "<red>[ * ]</red> <cyan><b>There is no network connectivity</b></cyan>\n<red>[ * ]</red> <cyan><b>Please try again</b></cyan>\n\n<green>Press any key to go back</green>" )))), bind=True, full_screen=True) self.tool_footer()
def tool_header(self): content = Window(FormattedTextControl(f"{bann}", style="fg:yellow bg:blue bold"), align="center") return container(content)
def back(self): if WIN: text = """00) Go Back""" else: text = """ππ) πΎπ ππππ""" container(Label(text, style="reverse"))
def tool_header(self): content = ConditionalContainer( Window(FormattedTextControl(f"{bann}", style="fg:yellow bg:blue bold"),dont_extend_width=True, height=Dimension(min=1)), filter=is_done) container(content, bind=False)
# time.sleep(0.2) # quo.echo(f"[ x ]", fg="vyellow", bg="vblack", nl=False) # quo.echo(f" ", hidden=True, nl=False) # exit_s = """πΌπ©ππ₯ πππ€πππͺ""" # quo.echo(f"{exit_s}", fg='vblack', bg='vyellow') # self.tool_footer() #@bind.add("n") #def _(event): # event.app.exit() body = HSplit([ Window(FormattedTextControl(banner, style="fg:red")), Window(height=1, char=Border.HORIZONTAL)]) container(body, bind=False) content = Label(f"sashay v {s_version}, using quo v {q_version}") container(content, bind=False) from quo.layout import Dimension, ConditionalContainer from quo.filters import is_done class logo: @classmethod def tool_header(self): content = ConditionalContainer( Window(FormattedTextControl(f"{bann}", style="fg:yellow bg:blue bold"),dont_extend_width=True, height=Dimension(min=1)), filter=is_done) container(content, bind=False) @classmethod