python类YELLOW的实例源码

run_scenario.py 文件源码 项目:napalm-scenario 作者: as2518 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def input_judgment(message): 
    print(Fore.YELLOW + message, end = '(y/n): ')
    choice = input().lower()
    if choice == 'y':
        return True
    else:
        return False
quick_deploy.py 文件源码 项目:pyability 作者: syedur-rahman 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def quick_deploy_introduction():
    user_message = Fore.YELLOW + "# Quick Deploy Script v1.0"
    print(user_message)
8080.py 文件源码 项目:8080py 作者: sadboyzvone 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def printHelp():
    print('\nThis ' + Fore.BLUE + 'Intel' + Fore.WHITE
          + ' 8080 assembler was made for ' + Fore.BLUE + 'Project '
          + Fore.YELLOW + 'Week' + Fore.WHITE + ' at my school.')
    print('It is written in ' + Fore.BLUE + 'Pyt' + Fore.YELLOW + 'hon'
          + Fore.WHITE)
    print('Modules: ' + Fore.RED + 'Co' + Fore.BLUE + 'lo'
          + Fore.YELLOW + 'ra' + Fore.GREEN + 'ma' + Fore.WHITE)
    print('\nPass a file path as an arguement.')


# Main function
debug.py 文件源码 项目:pythonVSCode 作者: DonJayamanne 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def print_to_stdout(level, str_out):
    """ The default debug function """
    if level == NOTICE:
        col = Fore.GREEN
    elif level == WARNING:
        col = Fore.RED
    else:
        col = Fore.YELLOW
    if not is_py3:
        str_out = str_out.encode(encoding, 'replace')
    print(col + str_out + Fore.RESET)


# debug_function = print_to_stdout
aesthetics.py 文件源码 项目:BrundleFuzz 作者: carlosgprado 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def m_warn(self, m):
        m = '[!] ' + m
        if COLORAMA:
            print Fore.YELLOW + m
        else:
            print m
aesthetics.py 文件源码 项目:BrundleFuzz 作者: carlosgprado 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def m_warn(self, m):
        m = '[!] ' + m
        if COLORAMA:
            print Fore.YELLOW + m
        else:
            print m
aesthetics.py 文件源码 项目:BrundleFuzz 作者: carlosgprado 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def m_warn(self, m):
        m = '[!] ' + m
        if COLORAMA:
            print Fore.YELLOW + m
        else:
            print m
xmlrpc-bruteforcer.py 文件源码 项目:xmlrpc-bruteforcer 作者: AresS31 项目源码 文件源码 阅读 39 收藏 0 点赞 0 评论 0
def copyright():

    copyright = """
       =[ {0}smali-code-injector v1.1-dev{1}       ]
+ -- --=[ Alexandre Teyar @Ares              ]
+ -- --=[ Pentester at Ambersail Ltd.        ]
+ -- --=[ GitHub: https://github.com/AresS31 ]
""".format(Fore.YELLOW, Fore.RESET)
    print("{}".format(copyright))
status_media-gateways.py 文件源码 项目:python-ossi 作者: iskhomutov 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def print_warnings(wn):
    """
    Args:
        wn (int): Counts of warnings

    Returns:
        str: Colorized information by using colorama
    """
    if wn > 0:
        return Fore.YELLOW + str(wn) + Fore.RESET
    else:
        return Fore.GREEN + str(wn) + Fore.RESET
GeneralUtilities.py 文件源码 项目:Jarvis 作者: sukeesh 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def important(string):
    print(Fore.YELLOW + string + Fore.RESET)
collector.py 文件源码 项目:pixie 作者: algorithm-ninja 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def reboot_loop(self):
        while True:
            self.ethers_manager.export_ethers()
            print(Fore.YELLOW + "Reboot index %d" % self.reboot_string)
            self.reboot_string += 1
            gevent.sleep(self.reboot_delay)
colors.py 文件源码 项目:netutils-linux 作者: strizhechenko 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def colorize(value, warning, error):
    return wrap(value, Fore.RED if value >= error else YELLOW if value >= warning else Fore.RESET)
test_runner.py 文件源码 项目:kuberdock-platform 作者: cloudlinux 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def _color_from_status(self, status):
        mapping = {
            'failed': Fore.RED,
            'skipped': Fore.YELLOW,
            'passed': Fore.GREEN,
            'pipeline_error': Fore.RED
        }
        return mapping[status]
test_direct_access.py 文件源码 项目:kuberdock-platform 作者: cloudlinux 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def _run_ssh_pexpect(cmd, password, using_bashc=False):
    """
    Run a given command using pexpect.
    """
    logger.debug(u'{}SSH Command: {}{}'.format(Style.DIM, cmd,
                                               Style.RESET_ALL))
    if using_bashc:
        ssh_cli = pexpect.spawn('/bin/bash', ['-c', cmd])
    else:
        ssh_cli = pexpect.spawn(cmd)

    i = ssh_cli.expect(['[Pp]assword: ', '\(yes/no\)\? '])
    if i == 1:
        ssh_cli.sendline('yes')
        ssh_cli.expect('[Pp]assword: ')
    ssh_cli.sendline(password)
    time.sleep(1)

    ssh_cli.expect(['Connection to [0-9\.a-z]+ is closed.', pexpect.EOF,
                    pexpect.TIMEOUT], timeout=5)

    # Expected behavior is to get pexpect.EOF or closed connection, but due to
    # a bug in docker we have to send an additional new line or Ctrl^C
    out = str(ssh_cli.before) + str(ssh_cli.after)
    logger.debug(u'Output:\n {}{}{}'.format(Fore.YELLOW, out, Style.RESET_ALL))

    if ssh_cli.isalive():
        ssh_cli.close()

    return out
test_direct_access.py 文件源码 项目:kuberdock-platform 作者: cloudlinux 项目源码 文件源码 阅读 15 收藏 0 点赞 0 评论 0
def _run_scp_command(cmd, user, host, password):
    """
    Emulate user command line interation using SCP protocol
    :param cmd: command to be executed
    :param user: remote host user
    :param host: remote host IP/hostname
    :param password: passwrod for remote user on host
    :returns None:
    """
    logger.debug(u'{}Running SCP: {}{}'.format(
        Style.DIM, cmd, Style.RESET_ALL))
    scp = pexpect.spawn(cmd)
    i = scp.expect(['\(yes/no\)\? ', '[Pp]assword: '])
    if i == 0:
        scp.sendline('yes')
        scp.expect('[Pp]assword: ')
    scp.sendline(password)
    time.sleep(1)
    try:
        while True:
            i = scp.expect([pexpect.EOF, '[0-9][0-9]:[0-9][0-9]   '],
                           timeout=5)
            if i == 0:
                logger.debug(u'{}{}{}'.format(Fore.YELLOW, scp.before,
                                              Style.RESET_ALL))
                break
            logger.debug(u'{}{}{}{}'.format(Fore.YELLOW, scp.before,
                                            scp.after, Style.RESET_ALL))
            time.sleep(.1)
    except pexpect.TIMEOUT:
        # A docker bug expecting an extra new line in the end. Ideally we
        # will exit the loop getting pexpect.EOF, i.e. i==0
        logger.debug(u'{}{}{}'.format(Fore.YELLOW, scp.before,
                                      Style.RESET_ALL))
    finally:
        if scp.isalive():
            scp.close()
test_network_isolation.py 文件源码 项目:kuberdock-platform 作者: cloudlinux 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def handle(self):
        self.server.connection_list.append(self.client_address[0])
        try:
            # For TCP connections
            data = self.request.recv(1024).strip()
        except AttributeError:
            # For UDP connections
            data = self.request[0].strip()
        LOG.debug('{}Client: {}\ndata: {}{}'.format(
            Fore.YELLOW, self.client_address[0], data, Style.RESET_ALL))
userio.py 文件源码 项目:LibreNews-Server 作者: milesmcc 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def warn(message, detail=""):
    level = Fore.YELLOW + "[WARN] " + Fore.RESET
    print(prefix  + level +  Style.BRIGHT + message + Style.RESET_ALL + " " + detail + Style.RESET_ALL)
provision-linode-cluster.py 文件源码 项目:paas-tools 作者: imperodesign 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def _check_num_nodes(self):
        if self.num_nodes < 1:
            raise ValueError('Must provision at least one node.')
        elif self.num_nodes < 3:
            print(Fore.YELLOW + 'A Deis cluster must have 3 or more nodes, only continue if you adding to a current cluster.' + Fore.RESET)
            print(Fore.YELLOW + 'Continue? (y/n)' + Fore.RESET)
            accept = None
            while True:
                if accept == 'y':
                    return
                elif accept == 'n':
                    raise StandardError('User canceled provisioning')
                else:
                    accept = self._get_user_input('--> ').strip().lower()
create-linode-user-data.py 文件源码 项目:paas-tools 作者: imperodesign 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def log_warning(message):
    print(Fore.YELLOW + message + Fore.RESET)
apply-firewall.py 文件源码 项目:paas-tools 作者: imperodesign 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def log_warning(message):
    print(Fore.YELLOW + message + Fore.RESET)


问题


面经


文章

微信
公众号

扫码关注公众号