summaryrefslogtreecommitdiff
path: root/Redim/ui.py
blob: 5d21efdb9310e13ca32a2ccb224bc6e2de364735 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from os import system
from sys import platform


class Ui:
    def __init__(self, configuration, formats_acceptes):
        self.banner = (
                      "\n  ____                 _                 ____   ____ \n",
                      "|  _ \\ _ __ ___ _ __ (_)_   _ _ __ ___ |  _ \\ / ___|\n",
                      "| |_) | '__/ _ \\ '_ \\| | | | | '_ ` _ \\| |_) | |    \n",
                      "|  __/| | |  __/ | | | | |_| | | | | | |  __/| |___ \n",
                      "|_|   |_|  \\___|_| |_|_|\\__,_|_| |_| |_|_|    \\____|\n",
                      "\n######################################################\n",
                      "\n[-] taille 1:", configuration["largeur1"], "x", configuration["hauteur1"],
                      ", taille 2:", configuration["largeur2"], "x", configuration["hauteur2"],
                      "\n[-] rgb background:", configuration["background_color"],
                      "\n[-] formats acceptes:", formats_acceptes,
                      "\n[-] format de sortie:", configuration["format_final"],
                      "\n\n######################################################"
                      )
        self.menu = (
                    "\n[-] Que faire?\n",
                    "\n   (1) -> Conversion (",
                    configuration["largeur1"], "x", configuration["hauteur1"], "px et",
                    configuration["largeur2"], "x", configuration["hauteur2"], "px)",
                    "\n   (5) -> Modification des tailles",
                    "\n   (6) -> Modification du RGB",
                    "\n   (7) -> Modification du format de sortie",
                    "\n   (8) -> Reset des parametres",
                    "\n   (9) -> Quitter\n"
                    )

    def affichage_banner(self):
        print(*self.banner)

    def affichage_menu(self):
        print(*self.menu)

    def affichage_fin(self):
        input("\n[-] fin, appuyer sur \'entrer\' pour recommencer .")

    def reset_screen(self):
        if platform != "linux":
            system("cls")
        else:
            system("clear")