Python Programming, news on the Voidspace Python Projects and all things techie.


Python @ Work

We're finally starting to use some of my Python projects at work. We're going to use Jalopy for sharing information on customers. We're also going to use a customer relations database that I did a lot of work on last year - but never got put into action. A potential problem is that our server has Python 2.2, and I'm not sure that the database backend I'm using (kirbybase) will work with it.

I think I'd rather get everything to work with Python 2.2 first though - I think a lot of people might be in similar situations.

Like this post? Digg it or it.

Posted by Fuzzyman on 2005-03-18 16:52:40 | |

Categories: ,



I've just been refactoring downman to keep the configuration stuff in a separate config file. To keep things simple I'd like it to raise an error if the config file is missing, or doesn't have some of the necessary keywords present. This was quite easy to do in ConfigObj (although I wonder if it should be easier - the error system certainly needs overhauling). Here's the code chunk anyway. I just used an options dictionary to tell ConfigObj how to behave. :

configspec = ['keyword1', 'keyword2',
              'keyword3', 'keyword4']
options = { 'fileerror' : True, 'configspec_only' : True,
          'configspec' : configspec, 'exceptions' : True }
    config = ConfigObj(filename, options)
except Exception:
    ... print an error message

Like this post? Digg it or it.

Posted by Fuzzyman on 2005-03-15 11:28:54 | |

Categories: ,

Hosted by Webfaction