Exemplo n.º 1
0
 def testColorMagenta (self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = "\x1b[0;35;49m"+texto+"\x1b[0m"
     self.assertEqual(tc.default_magenta(texto), textoesperado)
Exemplo n.º 2
0
 def testColorCyan (self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = "\x1b[0;36;49m"+texto+"\x1b[0m"
     self.assertEqual(tc.default_cyan(texto), textoesperado)
Exemplo n.º 3
0
 def testColorRed (self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = "\x1b[0;31;49m"+texto+"\x1b[0m"
     self.assertEqual(tc.default_red(texto), textoesperado)
Exemplo n.º 4
0
 def testColorYellow (self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = "\x1b[0;33;49m"+texto+"\x1b[0m"
     self.assertEqual(tc.default_yellow(texto), textoesperado)
Exemplo n.º 5
0
from terminal_text_color import TextColor

tc = TextColor()
print tc.default("Mi texto con estilo")
Exemplo n.º 6
0
 def testBackgroundGreen (self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = "\x1b[0;39;42m"+texto+"\x1b[0m"
     self.assertEqual(tc.default_default_green(texto), textoesperado)
Exemplo n.º 7
0
 def testStyleItalic(self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = '\x1b[3;39;49m'+texto+'\x1b[0m'
     self.assertEqual(tc.italic(texto), textoesperado)
Exemplo n.º 8
0
from terminal_text_color import TextColor
tc = TextColor()
print(tc.default_yellow("Universidad Nacional Autonoma de Mexico"))
print(tc.bold_blue("Facultad de Estudios Superiores Aragon"))
print(tc.bold_green("Sebastian Rodrigo Villa Luna"))
Exemplo n.º 9
0
 def testStyleBold(self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = '\x1b[1;39;49m'+texto+'\x1b[0m'
     self.assertEqual(tc.bold(texto), textoesperado)
Exemplo n.º 10
0
 def testStyleOpaque(self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = '\x1b[2;39;49m'+texto+'\x1b[0m'
     self.assertEqual(tc.opaque(texto), textoesperado)
Exemplo n.º 11
0
 def testBackgroundWhite (self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = "\x1b[0;39;47m"+texto+"\x1b[0m"
     self.assertEqual(tc.default_default_white(texto), textoesperado)
Exemplo n.º 12
0
 def testBackgroundMagenta (self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = "\x1b[0;39;45m"+texto+"\x1b[0m"
     self.assertEqual(tc.default_default_magenta(texto), textoesperado)
Exemplo n.º 13
0
 def testBackgroundYellow (self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = "\x1b[0;39;43m"+texto+"\x1b[0m"
     self.assertEqual(tc.default_default_yellow(texto), textoesperado)
Exemplo n.º 14
0
 def testColorWhite (self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = "\x1b[0;37;49m"+texto+"\x1b[0m"
     self.assertEqual(tc.default_white(texto), textoesperado)
Exemplo n.º 15
0
 def testStyleUnderline(self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = '\x1b[4;39;49m'+texto+'\x1b[0m'
     self.assertEqual(tc.underline(texto), textoesperado)
Exemplo n.º 16
0
from terminal_text_color import TextColor

tc = TextColor()

print(tc.default_yellow("Universidad Autonoma de Mexico"))
print(tc.default_blue("FES Aragon"))
print(tc.default_green("Perez Vite Hugo Alejandro"))
Exemplo n.º 17
0
 def testStyleCrossedout(self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = '\x1b[9;39;49m'+texto+'\x1b[0m'
     self.assertEqual(tc.crossedout(texto), textoesperado)
Exemplo n.º 18
0
from terminal_text_color import TextColor
from time import sleep
from PyPDF2 import PdfFileReader
import requests
import os
import urllib2
'''
Be sure to have the python 2 pip installed

pip install google
pip install terminal_text_color
pip install pypdf2
pip install urllib
'''

tc = TextColor()
descr = tc.opaque_yellow('''

In construction.
''')

parser = argparse.ArgumentParser(description=descr)
parser.add_argument('-d',
                    action="store",
                    dest="dict",
                    help="File to use (dict)",
                    default="Enter file here please")
parser.add_argument('-o',
                    action="store",
                    dest="othr",
                    help="Other extra parameter",
Exemplo n.º 19
0
 def testColorGrey (self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = "\x1b[0;30;49m"+texto+"\x1b[0m"
     self.assertEqual(tc.default_grey(texto), textoesperado)
Exemplo n.º 20
0
from database.dbFunctions import sql_validateInsert
from terminal_text_color import TextColor
from getpass import getpass
import views.menu_productos as mp
import re

tc = TextColor()


#Función que valida que el nickname del usuario al registrarse sea correcto
def validaNickname():
    while (True):
        nickname = input("Nickname: ")
        if len(nickname) < 6:
            print(
                tc.italic_red(
                    " ✖ El nombre usuario debe contener al menos 6 caracteres")
            )
        elif len(nickname) > 12:
            print(
                tc.italic_red(
                    " ✖ El nombre de usuario no puede contener más de 12 caracteres"
                ))
        elif not nickname.isalnum():
            print(
                tc.italic_red(
                    " ✖ El nombre de usuario sólo puede contener letras y números"
                ))
        elif sql_validateInsert(nickname) != 0:
            print(tc.italic_red(" ✖ El nombre de usuario ya existe"))
        else:
Exemplo n.º 21
0
 def testStyleDefault(self):
     tc = TextColor()
     texto = "Hola"
     textoesperado = '\x1b[0;39;49m'+texto+'\x1b[0m'
     self.assertEqual(tc.default(texto), textoesperado)