textui core skeleton

This commit is contained in:
Kenneth Reitz
2011-03-18 20:54:18 -04:00
parent 62a44214c1
commit 669bf76097
+36
View File
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
"""
x
"""
import sys
STDOUT = sys.stdout.write
STDERR = sys.stderr.write
def indent(x=4):
print x
def _out(stream, s, newline):
terminator = '\n' if newline else ''
stream('%s%s' % (s, terminator))
def puts(s, newline=True):
"""Prints given string to stdout."""
_out(STDOUT, s, newline)
def puts_err(s, newline=True):
"""Prints given string to stderr."""
_out(STDERR, s, newline)
def maxwidth(x=None):
# if none, detect from applib
print x