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.
I try to consistently translate strings to unicode objects when
reading, and encode all unicode objects when writing. But it is not
clear when the translation should happen. This module needs to be
cleaned up a little.
Added encoding from unicode to str in execute_query, and wrote wrapper
functions with decoding for the cursor methods fetchone and fetchall.
This means that from now on, one should never call these methods
directly on cursor objects, but instead call execute_query, fetchone,
fetchall, fetchone_dict or fetchall_dict in util.py.
I plan to separate out this code to a new module (db.py?), and rewrite
it in a way that makes it harder to write things like c.execute by
mistake.
Haven't tested it much, so it is probably very buggy.
Also fixed an error in the show command (it died when asked to show
something that didn't exist).
* Kopiert inn noe dokumentasjon (filformat og kommandolinjeargumenter)
fra forrige forsøk (som var i python-katalogen).
* Kopiert implementajonen av filformatet fra forrige forsøk.
* Kopiert nyttige ting fra mdboh, samt noe fra forrige inkarnasjon av
kommandolinjegrensesnittet her, til util.py
* Skrevet litt testkode i worblehat.py.