Improved handling of output to terminal and files.

New module file_io which takes care of this.  All output should go
through file_io.write, which encodes it using the appropriate
character encoding.  For output to a temporary file, use "with
file_io.tmpfile('name')".

Moved WorblehatException to new module exc, so all modules can access
it without importing worblehat.
This commit is contained in:
2011-10-12 19:26:21 +00:00
parent 1f2c52bb47
commit 9a733ef73a
5 changed files with 130 additions and 56 deletions

3
cli/exc.py Normal file
View File

@@ -0,0 +1,3 @@
class WorblehatException(Exception):
def __init__(self, msg):
Exception.__init__(self, msg)