当前位置: 首页>>代码示例>>Python>>正文


Python Style.DIM属性代码示例

本文整理汇总了Python中colorama.Style.DIM属性的典型用法代码示例。如果您正苦于以下问题:Python Style.DIM属性的具体用法?Python Style.DIM怎么用?Python Style.DIM使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在colorama.Style的用法示例。


在下文中一共展示了Style.DIM属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: print_results

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def print_results(self,results):
    try:
      if results['status'] == 'Pass':
        print ("Status: " + Fore.GREEN + 'Pass' + Fore.RESET)
      elif results['status'] == 'Fail':
        print ("Status: " + Fore.RED + 'Fail' + Fore.RESET)
    except KeyError:
      pass
    except TypeError:
      pass
    print "Description: " + results['descr']
    try:
      res = str(results['output'])
      print "Output: "
      print(Style.DIM + res + Style.RESET_ALL)
    except KeyError:
      pass
    print "\n" 
开发者ID:zuBux,项目名称:drydock,代码行数:20,代码来源:output.py

示例2: callable_virtualenv

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def callable_virtualenv():
    """
    Example function that will be performed in a virtual environment.

    Importing at the module level ensures that it will not attempt to import the
    library before it is installed.
    """
    from colorama import Fore, Back, Style
    from time import sleep
    print(Fore.RED + 'some red text')
    print(Back.GREEN + 'and with a green background')
    print(Style.DIM + 'and in dim text')
    print(Style.RESET_ALL)
    for _ in range(10):
        print(Style.DIM + 'Please wait...', flush=True)
        sleep(10)
    print('Finished') 
开发者ID:apache,项目名称:airflow,代码行数:19,代码来源:example_python_operator.py

示例3: banner

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def banner():
    print(Style.DIM)
    print('     ___________________________')
    print('    /                           /\\')
    print('   /     sadboyzvone\'s        _/ /\\')
    print('  /        Intel 8080        / \/')
    print(' /         Assembler         /\\')
    print('/___________________________/ /')
    print('\___________________________\/')
    print(' \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\'
          + Style.RESET_ALL + Style.BRIGHT)
    print(Fore.WHITE + '\nPowered by ' + Fore.BLUE + 'Pyt'
          + Fore.YELLOW + 'hon' + Fore.WHITE
          + '\nCopyright (C) 2017, Zvonimir Rudinski')

# Print usage information 
开发者ID:sadboyzvone,项目名称:8080py,代码行数:18,代码来源:8080.py

示例4: new_version_news

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def new_version_news(latest):
    print('', Icons.PARTY + Style.BRIGHT + Fore.CYAN,
          'VERSION', Fore.RED + latest + Fore.CYAN,
          'IS NOW AVAILABLE!', Fore.RESET)

    print('', Icons.RIGHT_ARROW, Style.DIM + 'Upgrade:',
          Fore.YELLOW + 'pip install -U lightnovel-crawler', Style.RESET_ALL)

    if Icons.isWindows:
        print('', Icons.RIGHT_ARROW, Style.DIM + 'Download:',
              Fore.YELLOW + 'https://rebrand.ly/lncrawl', Style.RESET_ALL)
    elif Icons.isLinux:
        print('', Icons.RIGHT_ARROW, Style.DIM + 'Download:',
              Fore.YELLOW + 'https://rebrand.ly/lncrawl-linux', Style.RESET_ALL)
    # end if

    print('-' * LINE_SIZE)
# end def 
开发者ID:dipu-bd,项目名称:lightnovel-crawler,代码行数:20,代码来源:display.py

示例5: color

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def color(s, c, style="bright"):
    color_map = {
        "black": Fore.BLACK,
        "red": Fore.RED,
        "green": Fore.GREEN,
        "yellow": Fore.YELLOW,
        "blue": Fore.BLUE,
        "magenta": Fore.MAGENTA,
        "cyan": Fore.CYAN,
        "white": Fore.WHITE,
    }
    style_map = {
        "dim": Style.DIM,
        "normal": Style.NORMAL,
        "bright": Style.BRIGHT,
    }

    return color_map[c] + style_map[style] + s + Style.RESET_ALL 
开发者ID:vinayak-mehta,项目名称:nbcommands,代码行数:20,代码来源:_grep.py

示例6: default_prefix_template

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def default_prefix_template(self, record):
        """Return the prefix for the log message. Template for Formatter.

        :param: record: :py:class:`logging.LogRecord` object. this is passed in
        from inside the :py:meth:`logging.Formatter.format` record.

        """
        reset = [Style.RESET_ALL]
        levelname = [
            LEVEL_COLORS.get(record.levelname), Style.BRIGHT,
            '%(levelname)-10s',
            Style.RESET_ALL, ' '
        ]
        asctime = [
            '', Fore.BLACK, Style.DIM, Style.BRIGHT,
            '%(asctime)-10s',
            Fore.RESET, Style.RESET_ALL, ' '
        ]

        return "".join(reset + asctime + levelname + reset) 
开发者ID:grap,项目名称:odoo-module-migrator,代码行数:22,代码来源:log.py

示例7: colorize_direction

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def colorize_direction(direction):
    """
    Green for the up direction,
    gray for the same, and red for the down direction
    """
    if direction == 1:
        return Fore.GREEN + '↑' + Style.RESET_ALL
    if direction == -1:
        return Fore.RED + '↓' + Style.RESET_ALL
    return Style.DIM + '=' + Style.RESET_ALL 
开发者ID:chubin,项目名称:rate.sx,代码行数:12,代码来源:ansi_utils.py

示例8: _colorize_frame

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def _colorize_frame(s_frame):
    """
    Colorize frame in string s_frame
    """

    output = []
    for line in s_frame.splitlines():
        line = line.decode('utf-8')\
                .replace(u'lqqqq', Style.DIM + u'lqqqq')\
                .replace(u'tqqqq', Style.DIM + u'tqqqq')\
                .replace(u'mqqqq', Style.DIM + u'mqqqq')\
                .replace(u'x', Style.DIM + u'x' + Style.RESET_ALL)\
                .replace(u'qqqqk', u'qqqqk' + Style.RESET_ALL)\
                .replace(u'qqqqu', u'qqqqu' + Style.RESET_ALL)\
                .replace(u'qqqqj', u'qqqqj' + Style.RESET_ALL)\
                .encode('utf-8')

        line = line.decode('utf-8')\
                .replace(u'┌────', Style.DIM + u'┌────')\
                .replace(u'├────', Style.DIM + u'├────')\
                .replace(u'└────', Style.DIM + u'└────')\
                .replace(u'│', Style.DIM + u'│' + Style.RESET_ALL)\
                .replace(u'────┐', u'────┐' + Style.RESET_ALL)\
                .replace(u'────┤', u'────┤' + Style.RESET_ALL)\
                .replace(u'────┘', u'────┘' + Style.RESET_ALL)\
                .encode('utf-8')

        output.append(line)
    return "\n".join(output)

#
# that's everything we need to save (and to load later)
# 
开发者ID:chubin,项目名称:rate.sx,代码行数:35,代码来源:view_ansi.py

示例9: default_log_template

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def default_log_template(self, record):
    """Return the prefix for the log message. Template for Formatter.

    :param: record: :py:class:`logging.LogRecord` object. this is passed in
    from inside the :py:meth:`logging.Formatter.format` record.

    """

    reset = [Style.RESET_ALL]
    levelname = [
        LEVEL_COLORS.get(record.levelname), Style.BRIGHT,
        '(%(levelname)s)',
        Style.RESET_ALL, ' '
    ]
    asctime = [
        '[', Fore.BLACK, Style.DIM, Style.BRIGHT,
        '%(asctime)s',
        Fore.RESET, Style.RESET_ALL, ']'
    ]
    name = [
        ' ', Fore.WHITE, Style.DIM, Style.BRIGHT,
        '%(name)s',
        Fore.RESET, Style.RESET_ALL, ' '
    ]
    threadName = [
        ' ', Fore.BLUE, Style.DIM, Style.BRIGHT,
        '%(threadName)s ',
        Fore.RESET, Style.RESET_ALL, ' '
    ]

    tpl = "".join(reset + levelname + asctime + name + threadName + reset)

    return tpl 
开发者ID:acsone,项目名称:git-aggregator,代码行数:35,代码来源:log.py

示例10: _wrap_color

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def _wrap_color(code_string):
    """Wrap key parts in styling and resets.
    Stying for each key part from, 
    (col_offset, fromlineno) to (end_col_offset, end_lineno).
    Note: use this to set color back to default (on mac, and others?): 
          Style.RESET_ALL + Style.DIM
    """
    ret = Style.BRIGHT + Fore.WHITE + Back.BLACK
    ret += code_string
    ret += Style.RESET_ALL + Style.DIM + Fore.RESET + Back.RESET
    return ret 
开发者ID:pyta-uoft,项目名称:pyta,代码行数:13,代码来源:print_nodes.py

示例11: parseLine

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def parseLine(line):
    severity = getSeverity(line)

    # Add color based on severity
    if 'severity' not in locals():
        severity = 3

    if severity == 0:
        color = Style.DIM + Fore.WHITE
    elif severity == 1:
        color = Style.NORMAL + Fore.BLUE
    elif severity == 2:
        color = Style.NORMAL + Fore.CYAN
    elif severity == 3:
        color = Style.NORMAL + Fore.WHITE
    elif severity == 4:
        color = Style.NORMAL + Fore.RED
    elif severity == 5:
        color = Style.NORMAL + Fore.BLACK + Back.RED
    else:
        color = Style.NORMAL + Fore.BLACK + Back.YELLOW

    # Replace html tab entity with actual tabs
    line = clearTags(line)
    line = line.replace('	', "\t")
    return color + line + Style.RESET_ALL 
开发者ID:screepers,项目名称:screeps_console,代码行数:28,代码来源:outputparser.py

示例12: m_info

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def m_info(self, m):
        m = '[*] ' + m
        if COLORAMA:
            print Style.DIM + m
        else:
            print m 
开发者ID:carlosgprado,项目名称:BrundleFuzz,代码行数:8,代码来源:aesthetics.py

示例13: banner

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def banner():

    banner = Style.DIM + """  
__  ___ __ ___ | |_ __ _ __   ___      
\ \/ / '_ ` _ \| | '__| '_ \ / __|____ 
 >  <| | | | | | | |  | |_) | (_|_____|
/_/\_\_| |_| |_|_|_|  | .__/ \___|     
                      |_|              
 _                _        __                         
| |__  _ __ _   _| |_ ___ / _| ___  _ __ ___ ___ _ __ 
| '_ \| '__| | | | __/ _ \ |_ / _ \| '__/ __/ _ \ '__|
| |_) | |  | |_| | ||  __/  _| (_) | | | (_|  __/ |   
|_.__/|_|   \__,_|\__\___|_|  \___/|_|  \___\___|_|   """ + Style.RESET_ALL    
    print("{}".format(banner)) 
开发者ID:aress31,项目名称:xmlrpc-bruteforcer,代码行数:16,代码来源:xmlrpc-bruteforcer.py

示例14: description

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def description():
    print('=' * LINE_SIZE)

    title = Icons.BOOK + ' Lightnovel Crawler ' + \
        Icons.CLOVER + os.getenv('version')
    padding = ' ' * ((LINE_SIZE - len(title)) // 2)
    print(Fore.YELLOW, padding + title, Fore.RESET)

    desc = 'https://github.com/dipu-bd/lightnovel-crawler'
    padding = ' ' * ((LINE_SIZE - len(desc)) // 2)
    print(Style.DIM, padding + desc, Style.RESET_ALL)

    print('-' * LINE_SIZE)
# end def 
开发者ID:dipu-bd,项目名称:lightnovel-crawler,代码行数:16,代码来源:display.py

示例15: _reverse_palette

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import DIM [as 别名]
def _reverse_palette(code):
    return {
        1 : Fore.BLACK + _back_color(code),
        2 : Style.DIM
    } 
开发者ID:chubin,项目名称:cheat.sh,代码行数:7,代码来源:internal.py


注:本文中的colorama.Style.DIM属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。