From 669bf76097740979282de5da273e5fb8b50e8135 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 18 Mar 2011 20:54:18 -0400 Subject: [PATCH] textui core skeleton --- clint/textui/core.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 clint/textui/core.py diff --git a/clint/textui/core.py b/clint/textui/core.py new file mode 100644 index 0000000..36e39dd --- /dev/null +++ b/clint/textui/core.py @@ -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 \ No newline at end of file