Exemple #1
0
    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()
Exemple #2
0
 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()
Exemple #3
0
 def back(self):
     text = """𝟘𝟘) 𝔾𝕠 𝕓𝕒𝕔𝕜"""
     container(
             Shadow(
                 Label(text, style="reverse")
                 ),
             bind=False)
Exemple #4
0
    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>"
                        )))))
Exemple #5
0
 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()
Exemple #6
0
  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()
Exemple #7
0
    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()
Exemple #8
0
    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()
Exemple #9
0
 def tool_header(self):
     content = Window(FormattedTextControl(f"{bann}",
                                           style="fg:yellow bg:blue bold"),
                      align="center")
     return container(content)
Exemple #10
0
 def back(self):
     if WIN:
         text = """00) Go Back"""
     else:
         text = """𝟘𝟘) 𝔾𝕠 𝕓𝕒𝕔𝕜"""
     container(Label(text, style="reverse"))
Exemple #11
0
  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)
Exemple #12
0
 #   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