Build database working with simple transaction support; all tests passing.

This commit is contained in:
Todd Gamblin
2015-10-27 16:36:44 -07:00
parent bf8479bec6
commit a58ae0c5d0
12 changed files with 644 additions and 229 deletions

View File

@@ -158,6 +158,11 @@ def clen(string):
return len(re.sub(r'\033[^m]*m', '', string))
def cextra(string):
""""Length of extra color characters in a string"""
return len(''.join(re.findall(r'\033[^m]*m', string)))
def cwrite(string, stream=sys.stdout, color=None):
"""Replace all color expressions in string with ANSI control
codes and write the result to the stream. If color is