Did I find the right examples for you? yes no

All Samples(30)  |  Call(29)  |  Derive(0)  |  Import(1)

        def pprint(text, atom, mode=None):
    if not mode:
        mode = DEFAULT_OUTPUT_MODE
    if mode == "color":
        return color_printer(text, atom)
    if mode == "css":
        return css_printer(text, atom)

    raise Exception("Unknown Dialogs printer: %s" % mode)
        


src/d/i/Dialogs-0.13/src/dialogs/sentence.py   Dialogs(Download)
 
from dialogs.helpers.sentence_atoms import *
from dialogs.helpers.printers import pprint, level_marker
from dialogs.helpers.helpers import colored_print
from dialogs.resources_manager import ResourcePool
    def __str__(self):
        res = level_marker() + pprint(self.data_type, SENTENCE_TYPE)
        res += pprint(self.aim, SENTENCE_AIM) # 'aim' may be None
 
        if self.sn:
            sn = ""
            for s in self.sn:
                sn = str(s).replace("\n", "\n\t") + "\n"
                res += pprint(sn, SUBJECT)
 
        if self.isvalid():
            res = pprint(res, SENTENCE)
        else:
            res = pprint(res, AGRAMMATICAL_SENTENCE)