[Tutor] configparser -- suggestions on when name: value entries are incomplete

2007-05-31 Thread Iyer
Regarding the configparser module, if there is a
configuration file to be read that has incomplete
name: value entries, what would be the best way to
handle this situation ?

I was thinking of catching the exemption parsingerror
and deleting the sections that have incomplete
name:value entries, to delete the sections, the
configfile has to be read, right and that raises the
parsing error.

any suggestions on how to best handle this situation?

iyer


   

Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos  more. 
http://mobile.yahoo.com/go?refer=1GNXIC
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] configparser -- suggestions on when name: value entries are incomplete

2007-05-31 Thread Kent Johnson
Iyer wrote:
 Regarding the configparser module, if there is a
 configuration file to be read that has incomplete
 name: value entries, what would be the best way to
 handle this situation ?

Do you mean incomplete as in not syntactically correct? I would tell the 
user to fix it.

If you mean missing some values, you could provide defaults.

 
 I was thinking of catching the exemption parsingerror
 and deleting the sections that have incomplete
 name:value entries, to delete the sections, the
 configfile has to be read, right and that raises the
 parsing error.
 
 any suggestions on how to best handle this situation?

Don't accept garbage data.

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] configparser -- suggestions on when name: value entries are incomplete

2007-05-31 Thread Iyer

--- Kent Johnson [EMAIL PROTECTED] wrote:

 Iyer wrote:
  Regarding the configparser module, if there is a
  configuration file to be read that has incomplete
  name: value entries, what would be the best way
 to
  handle this situation ?
 
 Do you mean incomplete as in not syntactically
 correct? I would tell the 
 user to fix it.

yes, it is not syntactically correct - for one section
there are no corresponding names for the values; the
values show up in the config file. This config file is
actually generated by another program not under my
control and breaks my python script trying to read it.
 

 
 If you mean missing some values, you could provide
 defaults.
 
  
  I was thinking of catching the exemption
 parsingerror
  and deleting the sections that have incomplete
  name:value entries, to delete the sections, the
  configfile has to be read, right and that raises
 the
  parsing error.
  
  any suggestions on how to best handle this
 situation?
 
 Don't accept garbage data.
 
 Kent
 



   

Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor