timid/context.py
def emit(self, msg, level=1, debug=False):
        """
        Emit a message to the user.

        :param msg: The message to emit.  If ``debug`` is ``True``,
                    the message will be emitted to ``stderr`` only if
                    the ``debug`` attribute is ``True``.  If ``debug``
                    is ``False``, the message will be emitted to
                    ``stdout`` under the control of the ``verbose``
                    attribute.
        :param level: Ignored if ``debug`` is ``True``.  The message
                      will only be emitted if the ``verbose``
                      attribute is greater than or equal to the value
                      of this parameter.  Defaults to 1.
        :param debug: If ``True``, marks the message as a debugging
                      message.  The message will only be emitted if
                      the ``debug`` attribute is ``True``.
        """

        # Is it a debug message?
        if debug:
            if not self.debug:
                # Debugging not enabled, don't emit the message
                return
            stream = sys.stderr
        else:
            # Not a debugging message; is verbose high enough?
            if self.verbose < level:
                return
            stream = sys.stdout

        # Emit the message
        print(msg, file=stream)
        stream.flush()
def emit(self, msg, level=1, debug=False):
        # Is it a debug message?
        if debug:
            if not self.debug:
                # Debugging not enabled, don't emit the message
                return
            stream = sys.stderr
        else:
            # Not a debugging message; is verbose high enough?
            if self.verbose < level:
                return
            stream = sys.stdout

        # Emit the message
        print(msg, file=stream)
        stream.flush()
def emit ( self , msg , level = 1 , debug = False ) : # Is it a debug message? if debug : if not self . debug : # Debugging not enabled, don't emit the message return stream = sys . stderr else : # Not a debugging message; is verbose high enough? if self . verbose < level : return stream = sys . stdout # Emit the message print ( msg , file = stream ) stream . flush ( )
Emit a message to the user.

        :param msg: The message to emit.  If ``debug`` is ``True``,
                    the message will be emitted to ``stderr`` only if
                    the ``debug`` attribute is ``True``.  If ``debug``
                    is ``False``, the message will be emitted to
                    ``stdout`` under the control of the ``verbose``
                    attribute.
        :param level: Ignored if ``debug`` is ``True``.  The message
                      will only be emitted if the ``verbose``
                      attribute is greater than or equal to the value
                      of this parameter.  Defaults to 1.
        :param debug: If ``True``, marks the message as a debugging
                      message.  The message will only be emitted if
                      the ``debug`` attribute is ``True``.
Emit a message to the user .