[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] setValue of QSettings adds undesired whitespaces in
From:       "Hans-Peter Jansen" <hpj () urpla ! net>
Date:       2009-06-29 10:05:00
Message-ID: 200906291205.00685.hpj () urpla ! net
[Download RAW message or body]

Dear Luca,

Am Montag, 29. Juni 2009 schrieb Luca Fasano:
> Hi all,
> As described in mail subject, I noticed that if you use setValue()
> method of a Qsettings object, undesired whitespaces are added to
> settings file. For example if you have an entry consisting of a comma
> separated list, whitespaces are added in it, even if setValue() only
> adds a *new* group.
> This is not a trivial bug if you want to use the same file for both
> QSettings and logging configuration. In fact logging.config.fileConfig()
> method does not recognize comma separated lists with whitespaces.

Hmm, putting it bluntly: your concept of relying on two different parsers 
(with different behavior) handling some arbitrary ini file format is 
flawed. I wouldn't even call this a bug. It's simply unpredictable 
behavior. If you really want predictable behavior, get rid off one of them.

Since logging needs only a few parameter, why don't you fetch them via 
QSetting and pass them on to your logging setup. And because logging has a 
somewhat strange idea of log levels, you have a good chance of translating 
them for human consumption (or even adjustment). 

We could then migrate this discussion to the more general one: 
 - best practices in handling config data, default values, etc.

Pete
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic