示例#1
0
文件: utils.py 项目: rymobiz/tarbell
def puts(s='', newline=True, stream=STDOUT):
    """
    Wrap puts to avoid getting called twice by Werkzeug reloader.
    """
    if not is_werkzeug_process():
        try:
            return _puts(s, newline, stream)
        except UnicodeEncodeError:
            return _puts(s.encode(sys.stdout.encoding), newline, stream)
示例#2
0
文件: utils.py 项目: jheasly/tarbell
def puts(s='', newline=True, stream=STDOUT):
    """
    Wrap puts to avoid getting called twice by Werkzeug reloader.
    """
    if not is_werkzeug_process():
        try:
            return _puts(s, newline, stream)
        except UnicodeEncodeError:
            return _puts(s.encode(sys.stdout.encoding), newline, stream)
示例#3
0
def puts(string='', newline=True, stream=STDOUT):
    _puts(safe_str(string), newline, stream)