Re: Little Help with Exceptions and ConfigParser

2006-03-15 Thread Kent Johnson
mwt wrote: > (Whoops, again.) > > def __init__(self, config_file): > self.fahdata = fahdata.FAHData() > self.INI = ConfigParser.ConfigParser() > if os.path.exists(config_file): > try: > self.INI.read(config_file) > except ConfigParser

Re: Little Help with Exceptions and ConfigParser

2006-03-14 Thread mwt
(Whoops, again.) def __init__(self, config_file): self.fahdata = fahdata.FAHData() self.INI = ConfigParser.ConfigParser() if os.path.exists(config_file): try: self.INI.read(config_file) except ConfigParser.Error, err:

Re: Little Help with Exceptions and ConfigParser

2006-03-14 Thread mwt
Would something like this be more useful? def __init__(self, config_file): self.fahdata = fahdata.FAHData() self.INI = ConfigParser.ConfigParser() if os.path.exists(config_file): try: self.INI.read(config_file) except ConfigParser.Err

Re: Little Help with Exceptions and ConfigParser

2006-03-14 Thread Kent Johnson
mwt wrote: > Hi - > I'm having a little trouble using exceptions properly. I currently have > an initialization function on a little app that looks like this: > > def __init__(self, config_file): > self.fahdata = fahdata.FAHData() > self.INI = ConfigParser.ConfigParser() >

Re: Little Help with Exceptions and ConfigParser

2006-03-14 Thread mwt
Whoops. Those page numbers are from "Cookbook." As well as the Except section in "Nutshell." Still stewing away here. ;) -- http://mail.python.org/mailman/listinfo/python-list