python类PrettyPrinter()的实例源码

common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def blue(text):
        """
        Formats text as blue
        """
        return PrettyPrinter._format(PrettyPrinter.Colors.BLUE, text)
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def light_purple(text):
        """
        Formats text as light_purple
        """
        return PrettyPrinter._format(PrettyPrinter.Colors.LIGTH_PURPLE, text)
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def green(text):
        """
        Formats text as green
        """
        return PrettyPrinter._format(PrettyPrinter.Colors.GREEN, text)
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 35 收藏 0 点赞 0 评论 0
def dark_green(text):
        """
        Formats text as dark_green
        """
        return PrettyPrinter._format(PrettyPrinter.Colors.DARK_GREEN, text)
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def yellow(text):
        """
        Formats text as yellow
        """
        return PrettyPrinter._format(PrettyPrinter.Colors.YELLOW, text)
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def dark_yellow(text):
        """
        Formats text as dark_yellow
        """
        return PrettyPrinter._format(PrettyPrinter.Colors.DARK_YELLOW, text)
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def orange(text):
        """
        Formats text as orange
        """
        return PrettyPrinter._format(PrettyPrinter.Colors.ORANGE, text)
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def cyan(text):
        """
        Formats text as cyan
        """
        return PrettyPrinter._format(PrettyPrinter.Colors.CYAN, text)
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def magenta(text):
        """
        Formats text as magenta
        """
        return PrettyPrinter._format(PrettyPrinter.Colors.MAGENTA, text)
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def purple(text):
        """
        Formats text as purple
        """
        return PrettyPrinter._format(PrettyPrinter.Colors.PURPLE, text)
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def info(text):
        """
        Formats text as info
        """
        return PrettyPrinter._format(PrettyPrinter.Colors.LIGHT_YELLOW, text)
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def p_bold(text):
        """
        Prints text formatted as bold
        """
        sys.stdout.write(PrettyPrinter.bold(text))
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def pl_bold(text):
        """
        Prints text formatted as bold with newline in the end
        """
        sys.stdout.write(u"{}\n".format(PrettyPrinter.bold(text)))
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def p_blue(text):
        """
        Prints text formatted as blue
        """
        print(PrettyPrinter.blue(text))
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def p_green(text):
        """
        Prints text formatted as green
        """
        print(PrettyPrinter.green(text))
common.py 文件源码 项目:DeepSea 作者: SUSE 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def p_red(text):
        """
        Prints text formatted as red
        """
        print(PrettyPrinter.red(text))
SolverBase.py 文件源码 项目:FenicsSolver 作者: qingfengxia 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def print(self):
        import pprint
        pp = pprint.PrettyPrinter(indent=4)
        pp.pprint(self.settings)
autograder.py 文件源码 项目:AI-Pacman 作者: AUTBS 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def printTest(testDict, solutionDict):
    pp = pprint.PrettyPrinter(indent=4)
    print "Test case:"
    for line in testDict["__raw_lines__"]:
        print "   |", line
    print "Solution:"
    for line in solutionDict["__raw_lines__"]:
        print "   |", line
test_calm.py 文件源码 项目:calm 作者: cygwin 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def pprint_patch():
    if isinstance(getattr(pprint.PrettyPrinter, '_dispatch', None), dict):
        orig = pprint.PrettyPrinter._dispatch[collections.OrderedDict.__repr__]
        pprint.PrettyPrinter._dispatch[collections.OrderedDict.__repr__] = patched_pprint_ordered_dict
        try:
            yield
        finally:
            pprint.PrettyPrinter._dispatch[collections.OrderedDict.__repr__] = orig
    else:
        yield

#
#
#
widgets.py 文件源码 项目:hostapd-mana 作者: adde88 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def process(self, write, request, submit, **kw):
        """Override me: I process a form.

        I will only be called when the correct form input data to process this
        form has been received.

        I take a variable number of arguments, beginning with 'write',
        'request', and 'submit'.  'write' is a callable object that will append
        a string to the response, 'request' is a twisted.web.request.Request
        instance, and 'submit' is the name of the submit action taken.

        The remainder of my arguments must be correctly named.  They will each be named after one of the

        """
        write("<pre>Submit: %s <br /> %s</pre>" % (submit, html.PRE(pprint.PrettyPrinter().pformat(kw))))


问题


面经


文章

微信
公众号

扫码关注公众号