Python colorama.Fore.LIGHTGREEN_EX Examples

The following are 17 code examples of colorama.Fore.LIGHTGREEN_EX(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module colorama.Fore , or try the search function .
Example #1
Source File: prepend.py    From ytmdl with MIT License 6 votes vote down vote up
def PREPEND(state):
    """PREPEND is used to print ==> in front of the lines.

    They are colorised according to their status.
    If everything is good then green else red.
    """
    # State 1 is for ok
    # State 2 is for notok

    print(Style.BRIGHT, end='')
    if state == 1:
        print(Fore.LIGHTGREEN_EX, end='')
    elif state == 2:
        print(Fore.LIGHTRED_EX, end='')
    else:
        pass

    print(' ==> ', end='')
    print(Style.RESET_ALL, end='') 
Example #2
Source File: save.py    From Lyndor with MIT License 6 votes vote down vote up
def chapters(url, course_folder_path):
    ''' create chapters folder '''
    soup = create_soup(url)
    heading4 = soup.find_all('h4', {"class": "ga"})
    chapter_no = 0

    message.colored_message(Fore.LIGHTYELLOW_EX, "Creating Chapters:\n") # Print message

    
    for h in heading4:
        chapter = format_chapter(h.text, chapter_no)
        chapter_no += 1
        message.print_line(chapter)

        new_chapter = course_folder_path + "/" + chapter
        new_chapter = new_chapter.strip()
        os.mkdir(new_chapter) # create folders (chapters)
            
    message.colored_message(Fore.LIGHTGREEN_EX, '\n✅  '+str(chapter_no)+' chapters created!!\n') 
Example #3
Source File: scrape.py    From webtech with GNU Lesser General Public License v3.0 5 votes vote down vote up
def display_links(self):

        links = self.soup.find_all("a")
        print(Fore.LIGHTGREEN_EX + "LINKS: " +  Fore.RESET + "\n")
        for ind, val in enumerate(links):
            print((Fore.CYAN +  val.text + "_link{ind+1}: " + Fore.RESET) + val.attrs["href"]) 
Example #4
Source File: diff.py    From ward with MIT License 5 votes vote down vote up
def bright_green(s: str) -> str:
    return f"{Fore.LIGHTGREEN_EX}{s}{Style.RESET_ALL}" 
Example #5
Source File: logger.py    From catcher with Apache License 2.0 5 votes vote down vote up
def light_green(output: str) -> str:
    return Fore.LIGHTGREEN_EX + output + Style.RESET_ALL if colored_output else output 
Example #6
Source File: utils.py    From unipacker with GNU General Public License v2.0 5 votes vote down vote up
def disass_instruction(uc, instr, addr_alias="", columns=False):
    if instr.id == 0:
        pass
    (regs_read, regs_write) = instr.regs_access()
    reg_values = {}
    for r in regs_read:
        uc_constant = getattr(unicorn.x86_const, f"UC_X86_REG_{instr.reg_name(r).upper()}", None)
        if uc_constant:
            reg_values[instr.reg_name(r)] = uc.reg_read(uc_constant)
    reg_values_str = ' '.join([f"{name}=0x{value:02x}" for name, value in reg_values.items()])
    if X86_GRP_JUMP in instr.groups:
        if jump_taken(uc, instr):
            color = Fore.LIGHTGREEN_EX
            comment = f"; taken! {reg_values_str}"
        else:
            color = Fore.LIGHTRED_EX
            comment = f"; not taken! {reg_values_str}"
    else:
        color = Fore.RESET
        comment = f"; {reg_values_str}" if reg_values_str else ""
    mnemonic = f"{color}{instr.mnemonic}{Fore.RESET}"
    addr_alias = f"0x{instr.address:02x}, {Fore.LIGHTRED_EX}{addr_alias}{Fore.RESET}" if addr_alias \
        else f"0x{instr.address:02x}"

    disass_cols = f">>> {addr_alias}:", f"{mnemonic} {Fore.LIGHTCYAN_EX}{instr.op_str}{Fore.RESET}", f"{Fore.LIGHTBLUE_EX}{comment}{Fore.RESET}"
    if columns:
        return disass_cols
    return " ".join(disass_cols) 
Example #7
Source File: logger.py    From smtp-email-spoofer-py with GNU General Public License v3.0 5 votes vote down vote up
def success(line):
    print(Fore.LIGHTGREEN_EX + line + Style.RESET_ALL) 
Example #8
Source File: prox.py    From proxy-checker with MIT License 5 votes vote down vote up
def print_help():
    terminal(CMD_CLEAR_TERM)
    print(Fore.LIGHTGREEN_EX + 'PROX v0.2 - Utility for checking proxy in terminal')
    print(Fore.LIGHTGREEN_EX + 'Authors: Hasanov Abdurahmon & Ilyosiddin Kalandar')
    print(Fore.LIGHTCYAN_EX)
    print('Usage -> prox -f <filename> - Check file with proxies')
    print('prox -p <proxy> - check only one proxy')
    print('prox --help - show this menu') 
Example #9
Source File: display.py    From lightnovel-crawler with Apache License 2.0 5 votes vote down vote up
def url_supported_list():
    print('Supported sources:')
    for url in sorted(crawler_list.keys()):
        print(Fore.LIGHTGREEN_EX, Icons.RIGHT_ARROW, url, Fore.RESET)
    # end for
# end def 
Example #10
Source File: trace.py    From myia with MIT License 5 votes vote down vote up
def compare(path=None, *fields, **kwfields):
    store = {}
    getters = Getters(fields, kwfields)

    def _compare(old, new):
        if isinstance(old, dict):
            return {k: _compare(v, new[k]) for k, v in old.items()}
        elif isinstance(old, (int, float)):
            diff = new - old
            if diff == 0:
                return old
            c = Fore.LIGHTGREEN_EX if diff > 0 else Fore.LIGHTRED_EX
            diff = f"+{diff}" if diff > 0 else str(diff)
            return f"{old} -> {new} ({_color(c, diff)})"
        elif hasattr(old, "compare"):
            return old.compare(new)
        elif old == new:
            return old
        else:
            return f"{old} -> {new}"

    def _enter(_curpath, **kwargs):
        _path = _curpath[:-6]
        w = breakword.word()
        store[_path] = (w, getters(kwargs))
        _brk(w)

    def _exit(_curpath, **kwargs):
        if "success" in kwargs and not kwargs["success"]:
            return
        _path = _curpath[:-5]
        w, old = store[_path]
        new = getters(kwargs)
        _display(_path, _compare(old, new), word=w, brk=False)

    path = _resolve_path(path, variant="cmp")
    return DoTrace({f"{path}/enter": _enter, f"{path}/exit": _exit}) 
Example #11
Source File: logger.py    From brutemap with GNU General Public License v3.0 5 votes vote down vote up
def colorize(self, msg):
        """
        Mewarnai pesan
        """

        color = self.color_map[self.record.levelno]
        reset = Style.RESET_ALL
        levelname = reset + color + self.record.levelname + reset
        if self.record.levelname == "CRITICAL":
            color = self.color_map[logging.ERROR]

        name = Fore.LIGHTBLUE_EX + self.record.name + reset
        message = self.record.message
        # XXX: kenapa cara dibawah ini tidak bekerja?
        #
        # match = re.findall(r"['\"]+(.*?)['\"]+", message)
        # if match:
        #     match.reverse()
        #     for m in match:
        #         message = message.replace(m, color + m + reset, 1)

        match = re.search(r"=> (?P<account>.*?(?:| \: .*?)) \((?P<status>[A-Z]+)\)", message)
        if match:
            account = match.group("account")
            status = match.group("status")
            if status == "NO":
                color_status = Fore.LIGHTRED_EX
            else:
                color_status = Fore.LIGHTGREEN_EX

            newmsg = message.replace(account, color_status + account + reset)
            newmsg = newmsg.replace(status, color_status + status + reset)
            msg = msg.replace(message, newmsg)

        asctime = re.findall(r"\[(.+?)\]", msg)[0]
        msg = msg.replace(asctime, Fore.LIGHTMAGENTA_EX + asctime + reset, 1)
        msg = msg.replace(self.record.name, name, 1)
        msg = msg.replace(self.record.levelname, levelname, 1)
        msg = msg + reset

        return msg 
Example #12
Source File: scrape.py    From webtech with GNU Lesser General Public License v3.0 5 votes vote down vote up
def display_header(self):
        print(Fore.LIGHTGREEN_EX + "HEADER TAGS: " +  Fore.RESET + "\n")
        titles = self.soup.find_all(['h1' , 'h2', 'h3' , 'h4' , 'h5' , 'h6'])
        for i in titles:
            print(i)

        print("\n") 
Example #13
Source File: scrape.py    From webtech with GNU Lesser General Public License v3.0 5 votes vote down vote up
def display_title(self):

        print((Fore.LIGHTGREEN_EX + "Webpage: " + Fore.RESET) + (Fore.WHITE + self.soup.title.string + Fore.RESET))
        print("\n") 
Example #14
Source File: save.py    From Lyndor with MIT License 5 votes vote down vote up
def course(url, lynda_folder_path):
    ''' create course folder '''
    current_course = course_path(url, lynda_folder_path)
    courses = os.listdir(lynda_folder_path)

    answer = None
    for course in courses:
        if (lynda_folder_path + course) == current_course:
            if read.redownload_course == 'force':
                # delete existing course and re-download
                shutil.rmtree(current_course)
                message.colored_message(Fore.LIGHTRED_EX, "\n✅  Course folder already exists. Current preference -> FORCE redownload")
                message.colored_message(Fore.LIGHTRED_EX, "\n❌  Existing course folder deleted!!")
                time.sleep(2)
                message.colored_message(Fore.LIGHTGREEN_EX, "\n♻️  Re-downloading the course.\n")
                time.sleep(2)
            elif read.redownload_course == 'skip':
                # skip download process
                message.colored_message(Fore.LIGHTRED_EX, "\n✅  Course folder already exists. Current preference -> SKIP redownload")
                sys.exit(message.colored_message(Fore.LIGHTRED_EX, "\n-> Skipping course download.\n"))    
            elif read.redownload_course == 'prompt':
                # prompt user with available choices
                QUESTION = '\n✅  Course folder already exists: Do you wish to delete it and download again? (Y/N): '
                sys.stdout.write(Fore.LIGHTBLUE_EX + QUESTION + Fore.RESET)
                while answer != 'y':
                    # get user input
                    answer = input().lower()

                    if answer == 'y':
                        shutil.rmtree(current_course)
                        message.colored_message(Fore.LIGHTRED_EX, "\n❌  Existing course folder deleted!!")
                        time.sleep(2)
                        message.colored_message(Fore.LIGHTGREEN_EX, "\n♻️  Re-downloading the course.\n")
                    elif answer == 'n':
                        sys.exit(message.colored_message(Fore.LIGHTRED_EX, "\n-> Program Ended!!\n"))
                    else:
                        sys.stdout.write(Fore.LIGHTRED_EX + "\n- oops!! that's not a valid choice, type Y or N: " + Fore.RESET)
    
    print(f'\ncreating course folder at: {current_course}')
    os.mkdir(current_course) 
Example #15
Source File: run.py    From Lyndor with MIT License 5 votes vote down vote up
def main():
    ''' Main function '''
    init()
    message.animate_characters(Fore.LIGHTYELLOW_EX, draw.ROCKET, 0.02)
    message.spinning_cursor()
    message.print_line('\r1. Paste course url or\n' +
    '2. Press enter for Bulk Download')
    
    url = input()
    
    print('')
    start_time = time.time() #start time counter begins
    if url == "":
        # If user press Enter (i.e. url empty), get urls from Bulkdownload.txt
        urls = read.bulk_download()
        if not urls:
            sys.exit(message.colored_message(Fore.LIGHTRED_EX, 'Please paste urls in Bulk Download.txt\n'))
        for url in urls:
            schedule_download(url)
    else:
        # begin regular download
        schedule_download(url)
    try:
        end_time = time.time()
        message.animate_characters(Fore.LIGHTGREEN_EX, draw.COW, 0.02)
        message.colored_message(Fore.LIGHTGREEN_EX, "\nThe whole process took {}\n".format(move.hms_string(end_time - start_time)))
    except KeyboardInterrupt:
        sys.exit(message.colored_message(Fore.LIGHTRED_EX, "\n- Program Interrupted!!\n")) 
Example #16
Source File: __init__.py    From Industrial-Security-Auditing-Framework with GNU General Public License v3.0 5 votes vote down vote up
def print_success(*args, **kwargs):
    __cprint(Fore.LIGHTGREEN_EX + '[+]' + Fore.RESET, *args, **kwargs) 
Example #17
Source File: banner.py    From supercharge with MIT License 5 votes vote down vote up
def pbanner():
    return Style.BRIGHT + Fore.LIGHTGREEN_EX + banner + Style.RESET_ALL