Commit Graph

7 Commits

Author SHA1 Message Date
9a733ef73a 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.
2011-10-12 19:26:21 +00:00
1f2c52bb47 Hacks for character encoding in fileformat.py.
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.
2011-10-11 15:44:17 +00:00
c614e4b06a Improved reading in fileformat.py.
* Handles comments (lines starting with '#').

* Remembers line numbers, and uses them in error messages.
2011-10-09 14:39:07 +00:00
a9f1ac6a66 Fix in fileformat.py: Empty fields are None when reading. 2011-10-08 19:49:28 +00:00
46a606c2bf Fixed some errors in fileformat.py, and added some debugging code. 2011-10-08 17:08:46 +00:00
d4ca8c5679 Endret noen feltnavn i fileformat.py for å stemme med resten. 2011-10-08 13:53:52 +00:00
e0aa1d53d2 Såvidt begynt på nytt kommandolinjegrensesnitt.
* 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.
2011-10-08 09:06:15 +00:00