def test__cprint(): f = io.StringIO() cprint('Hello, World!', 'green', 'on_red', attrs=['bold'], file=f) s = f.getvalue() f = io.StringIO() cprint('Hello, World!', 'green', 'on red', 'bold', file=f) assert f.getvalue() == s
def brightwhiteprint(string, *args, **kwargs): cprint(string, 'bright white', *args, **kwargs)
def brightredprint(string, *args, **kwargs): cprint(string, 'bright red', *args, **kwargs)
def brightyellowprint(string, *args, **kwargs): cprint(string, 'bright yellow', *args, **kwargs)
def yellowprint(string, *args, **kwargs): cprint(string, 'yellow', *args, **kwargs)
def redprint(string, *args, **kwargs): cprint(string, 'red', *args, **kwargs)
def greenprint(string, *args, **kwargs): cprint(string, 'green', *args, **kwargs)
def whiteprint(string, *args, **kwargs): cprint(string, 'white', *args, **kwargs)
def darkprint(string, *args, **kwargs): cprint(string, 'dark', *args, **kwargs)
import os import sys import argparse import re from colorama import init init(strip=not sys.stdout.isatty()) # strip colors if stdout is redirected from more_termcolor import cprint from pyfiglet import figlet_format cprint(figlet_format('WordlistRaider!', font='starwars', width=100), 'red') cprint('Coded by Gregor Biswanger, Jürgen Gutsch & Community - Version 1.0', 'yellow') parser = argparse.ArgumentParser( description= 'Returns a selection of words that matches the passed conditions in an existing list.' ) parser.add_argument('-w', '--wordlist', metavar='path to source file', type=str, required=True, help='the wordlist to raid') parser.add_argument('-t', '--target', metavar='path to the target file', type=str, required=True, help='the target wordlist') parser.add_argument('--min',
def test__cprint_sanity(): cprint('Grey color', 'grey') cprint('Red color', 'red') cprint('Green color', 'green') cprint('Yellow color', 'yellow') cprint('Blue color', 'blue') cprint('Magenta color', 'magenta') cprint('Cyan color', 'cyan') cprint('White color', 'white') cprint('On grey color', on_color='on_grey') cprint('On red color', on_color='on_red') cprint('On green color', on_color='on_green') cprint('On yellow color', on_color='on_yellow') cprint('On blue color', on_color='on_blue') cprint('On magenta color', on_color='on_magenta') cprint('On cyan color', on_color='on_cyan') cprint('On white color', color='grey', on_color='on_white') cprint('Bold grey color', 'grey', attrs=['bold']) cprint('Dark red color', 'red', attrs=['dark']) cprint('Underline green color', 'green', attrs=['underline']) cprint('Blink yellow color', 'yellow', attrs=['blink']) cprint('Reversed blue color', 'blue', attrs=['reverse']) cprint('Concealed Magenta color', 'magenta', attrs=['concealed']) cprint('Bold underline reverse cyan color', 'cyan', attrs=['bold', 'underline', 'reverse']) cprint('Dark blink concealed white color', 'white', attrs=['dark', 'blink', 'concealed']) cprint('Underline red on grey color', 'red', 'on_grey', ['underline']) cprint('Reversed green on red color', 'green', 'on_red', ['reverse']) cprint('Underline red on grey color', 'red', on_color='on_grey', attrs=['underline']) cprint('Reversed green on red color', color='green', on_color='on_red', attrs=['reverse'])
def test__cprint3(): cprint('foo', 'bright white', on_color='black') with common.assert_raises(KeyError, reg=r'^bold$'): cprint('foo', 'bright white', 'on_bold')
def test__cprint2(): cprint(f'\n\n{test__cprint2.__name__}', 'bold', 'bright white')