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


Python prompt_toolkit.print_formatted_text方法代码示例

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


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

示例1: print_suggested_additions

# 需要导入模块: import prompt_toolkit [as 别名]
# 或者: from prompt_toolkit import print_formatted_text [as 别名]
def print_suggested_additions(self):
        """ Prints a collection of suggested additions to the stdout. """

        sys.stdout.flush()
        sys.stderr.flush()

        # Create a quick printing shortcut.
        print_html = lambda data : print_formatted_text(HTML(data))

        # Header.
        print_html("")
        print_html("<b><u>Automatic Suggestions</u></b>")
        print_html("These suggestions are based on simple observed behavior;")
        print_html("not all of these suggestions may be useful / desireable.")
        print_html("")

        self._print_suggested_requests()
        print_html("")


    #
    # Backend helpers.
    # 
开发者ID:usb-tools,项目名称:Facedancer,代码行数:25,代码来源:device.py

示例2: print_packets

# 需要导入模块: import prompt_toolkit [as 别名]
# 或者: from prompt_toolkit import print_formatted_text [as 别名]
def print_packets(path: list, nodes: dict) -> None:
    tokens = []
    for e in path[:-1]:
        node = nodes[e.dst]
        p = node.render()
        line = '{} = {}'.format(node.name.replace('-', '_'), repr(p))
        tokens.extend(list(pygments.lex(line, lexer=Python3Lexer())))

    # p = self.fuzz_node.render()
    node = nodes[path[-1].dst]
    p = node.render()
    line = '{} = {}'.format(node.name.replace('-', '_'), repr(p))

    print(pygments.highlight(line, Python3Lexer(), Terminal256Formatter(style='rrt')))

    # tokens.extend(list(pygments.lex(line, lexer=Python3Lexer())))
    # style = style_from_pygments_cls(get_style_by_name('colorful'))
    # print_formatted_text(PygmentsTokens(tokens), style=style)


# --------------------------------------------------------------- # 
开发者ID:nccgroup,项目名称:fuzzowski,代码行数:23,代码来源:printers.py

示例3: print_formatted

# 需要导入模块: import prompt_toolkit [as 别名]
# 或者: from prompt_toolkit import print_formatted_text [as 别名]
def print_formatted(*args, **kwargs):
    prompt_toolkit.print_formatted_text(*args, **kwargs) 
开发者ID:hyperledger,项目名称:aries-cloudagent-python,代码行数:4,代码来源:utils.py

示例4: display_request

# 需要导入模块: import prompt_toolkit [as 别名]
# 或者: from prompt_toolkit import print_formatted_text [as 别名]
def display_request(self) -> None:
        """Display a signature request.

        Concrete subclasses should override this method.

        The contents of the signature request will already be parsed
        from QR code and available as ``self.request``.

        Use ``print_formatted_text`` to display the signature in a way
        that readable on consoles.

        """
        pass 
开发者ID:unchained-capital,项目名称:hermit,代码行数:15,代码来源:base.py

示例5: _show_signature

# 需要导入模块: import prompt_toolkit [as 别名]
# 或者: from prompt_toolkit import print_formatted_text [as 别名]
def _show_signature(self) -> None:
        name = self._signature_label()
        print_formatted_text(HTML("<i>Signature Data:</i> "))
        print(json.dumps(self.signature, indent=2))
        displayer.display_qr_code(self._serialized_signature(), name=name) 
开发者ID:unchained-capital,项目名称:hermit,代码行数:7,代码来源:base.py

示例6: printf

# 需要导入模块: import prompt_toolkit [as 别名]
# 或者: from prompt_toolkit import print_formatted_text [as 别名]
def printf(self, mesg, addnl=True, color=None):
        if not self.colorsenabled:
            return self.outp.printf(mesg, addnl=addnl)

        # print_formatted_text can't handle \r
        mesg = mesg.replace('\r', '')

        if color is not None:
            mesg = FormattedText([(color, mesg)])
        return print_formatted_text(mesg, end='\n' if addnl else '') 
开发者ID:vertexproject,项目名称:synapse,代码行数:12,代码来源:cli.py

示例7: print_python

# 需要导入模块: import prompt_toolkit [as 别名]
# 或者: from prompt_toolkit import print_formatted_text [as 别名]
def print_python(path: list) -> None:
    tokens = []
    block_code = path_to_python(path)
    print(pygments.highlight(block_code, Python3Lexer(), Terminal256Formatter(style='rrt')))

    # tokens.extend(list(pygments.lex(block_code, lexer=Python3Lexer())))
    # print_formatted_text(PygmentsTokens(tokens))

# --------------------------------------------------------------- # 
开发者ID:nccgroup,项目名称:fuzzowski,代码行数:11,代码来源:printers.py

示例8: print_poc

# 需要导入模块: import prompt_toolkit [as 别名]
# 或者: from prompt_toolkit import print_formatted_text [as 别名]
def print_poc(target: Target, path: list,
              receive_data_after_each_request, receive_data_after_fuzz) -> None:
    tokens = []

    exploit_code = get_exploit_code(target, path, receive_data_after_each_request, receive_data_after_fuzz)
    print(pygments.highlight(exploit_code, Python3Lexer(), Terminal256Formatter(style='rrt')))

    # tokens.extend(list(pygments.lex(exploit_code, lexer=Python3Lexer())))
    # print_formatted_text(PygmentsTokens(tokens))

# --------------------------------------------------------------- # 
开发者ID:nccgroup,项目名称:fuzzowski,代码行数:13,代码来源:printers.py


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