You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(2) |
Nov
(18) |
Dec
(26) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(14) |
Feb
(28) |
Mar
(21) |
Apr
(17) |
May
(23) |
Jun
(12) |
Jul
(12) |
Aug
(7) |
Sep
(10) |
Oct
|
Nov
(4) |
Dec
(10) |
| 2007 |
Jan
(5) |
Feb
(8) |
Mar
|
Apr
|
May
(7) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(20) |
Oct
(3) |
Nov
(2) |
Dec
(12) |
| 2008 |
Jan
(40) |
Feb
(15) |
Mar
(1) |
Apr
|
May
(6) |
Jun
(19) |
Jul
(2) |
Aug
(17) |
Sep
(13) |
Oct
(7) |
Nov
(16) |
Dec
(5) |
| 2009 |
Jan
(15) |
Feb
(11) |
Mar
(11) |
Apr
(8) |
May
(6) |
Jun
(15) |
Jul
(19) |
Aug
(2) |
Sep
|
Oct
(19) |
Nov
(1) |
Dec
(3) |
| 2010 |
Jan
(12) |
Feb
(25) |
Mar
(45) |
Apr
(4) |
May
(2) |
Jun
(4) |
Jul
(6) |
Aug
(13) |
Sep
(1) |
Oct
(2) |
Nov
(2) |
Dec
(9) |
| 2011 |
Jan
(24) |
Feb
(7) |
Mar
(1) |
Apr
(6) |
May
(3) |
Jun
(3) |
Jul
|
Aug
(13) |
Sep
(9) |
Oct
(7) |
Nov
(17) |
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
(5) |
Apr
(3) |
May
|
Jun
|
Jul
(3) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(12) |
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
(17) |
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(3) |
Oct
(3) |
Nov
|
Dec
|
| 2015 |
Jan
(11) |
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(10) |
Dec
|
| 2017 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ale...@se...> - 2009-08-26 15:29:29
|
I've been hoping to use configobj to read database field parameters into a
script using configobj. Preserving the order of keys and in built list
handling make it a very nice fit.
I've come up against a parsing error, when a list contains an empty value
represented by 2 adjacent commas (i.e. ,,)
PythonWin 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit
(Intel)] on win32.import
Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for
further copyright information.
>>> import os
>>> os.chdir('h:/src/localview')
>>> import configobj
>>> configobj.ConfigObj('tmp.ini')
ConfigObj({'Fields': {'Name': ['TEXT', '0', '0', '100', 'NULLABLE',
'NON_REQUIRED']}})
>>> configobj.ConfigObj('tmp2.ini')
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "configobj.py", line 1219, in __init__
self._load(infile, configspec)
File "configobj.py", line 1302, in _load
raise error
ParseError: Parse error in value at line 2.
>>> for line in open('tmp.ini'): print repr(line)
...
'[Fields]\n'
'Name = TEXT,0,0,100,NULLABLE,NON_REQUIRED,\n'
'\n'
>>> for line in open('tmp2.ini'): print repr(line)
...
'[Fields]\n'
'Name = TEXT,0,0,100,,NULLABLE,NON_REQUIRED,\n'
'\n'
>>>
Should this be submitted as a bug, or should I be putting quotes around all
empty values?
Regards, Alex
--
Alex Willmer <ale...@se...>
Application Support Analyst, Property & GIS Application Support Team
Service Birmingham, Units 2 & 3, B1 Building, Summer Hill Rd, Birmingham,
B1 3RB
Tel +44 (0)121 3033653 Mob +44 (0)7833 059297
***********************************************************************
The information contained within this e-mail (and any attachment) sent by Service Birmingham Ltd. is confidential and may be legally privileged. It is intended only for the named recipient or entity to whom it is addressed. If you are not the intended recipient, please notify the sender and delete the e-mail immediately. Unauthorised access, use, disclosure, storage or copying is not permitted and may be unlawful. Any e-mail including its content may be monitored and used by Service Birmingham Ltd. for reasons of security and for monitoring internal compliance with Security Policy. E-mail blocking software will also be used. Any views or opinions expressed are solely those of the originator and do not necessarily represent those of Service Birmingham Ltd.
Although Service Birmingham Ltd. has made every reasonable effort to ensure that this message and any attachments contain no viruses and have not been intercepted or amended, it can not make any assurances to this effect.
Service Birmingham Ltd, Registered in England & Wales under Company No: 05660977
Registered Office: Units 2&3 B1, 50 Summer Hill Road, Birmingham, B1 3RB.
***********************************************************************
|
|
From: Michael F. <fuz...@vo...> - 2009-07-17 17:35:02
|
Patches definitely accepted. :-) (with tests and documentation naturally...) Michael David Hostetler wrote: > [this discussion arises out of the recent post inquiring how to handle > empty values in a list] > > I think in general the list validation features might benefit from > being either parameterized or more comprehensive. > > By that I mean, for example, that 'force_list' isn't so much a > different validation function as it is a behavior that the author may > or may not wish to apply to any particular list. > > In fact, in hindsight I wonder whether instead of having the set of > list functions (list, int_list, float_list, bool_list, etc..) there is > simply and only 'list'. In addition to the 'min' and 'max' > parameters that the list function accepts, you could add to that > things like: > > - 'valtype' (to allow 'valtype=int', 'valtype=float', etc..) > > - 'force' (replacing the 'force_list' function and allowing any kind > of list to adopt the implicit-trailing-comma behavior) > > - 'allowgaps' (to accommodate the missing value behavior Cameron > inquired about) > > > Thus list() accrues parameters as needed to customize how it validates > the values in a particular instance. > > The nice thing here is that the backwards compatibility story is > clean: usage of, say, int_list() is functionally equivalent to > list(type=int). force_list() becomes list(force=True). > > mixed_list is still a bit of a black sheep. But that may be fine > anyway. Technically, all of the other list variants are implicitly > for lists of arbitrary length. mixed_list is only valid for lists of > known length (otherwise how can you specify the type for each item in > the mixed list?). mixed_list, by its very nature, cannot do implicit > type conversions. > > In other words -- the set of available validation functions > essentially remains defined as "what kind of thing you get back from > the validation". > > 'integer' gives you an integer > 'tuple' gives you a tuple > 'list' gives you a homogeneous list of 0 or more items > 'option' gives you one string from among a known list of strings > 'mixed_list' gives you a (potentially) heterogeneous list of 0 or more > items > etc.. > > > There might still be opportunity to refine the relationship between > list and mixed_list, but the trade-off is the complexity of the list() > API. > > In fact this whole discussion is about the complexity vs. capability > of list validation. Having force_list() be a top-level validation > function grows the set of functions by one, but keeps the average > function complexity low. But it reduces the capability of the > functions because the 'force' behavior cannot be applied to lists > obtained via the other functions -- it's an either/or choice for the > programmer: you can use int_list to get a list of ints, or you can > have force_list to get a forced list of strings, but you can't have a > forced list of ints. > > Pushing some of the choices back into parameters increases both the > complexity and the capability of the validation functions, while > simultaneously reducing the number of validation functions (assuming > the redundant functions were then removed or deprecated). > > > Incidentally -- I would argue that the tuple() validation function has > precisely the same needs for parameterization as does list(). The > parameterization needs arise from the existence of more than one value > per keyword, and that's the case for both lists and tuples. The only > difference between the two returned types is that one is mutable the > other is not -- they're both sequences. For that matter, why can I > get a mixed list but not a mixed tuple? > > > Just some food for thought. > > regards, > > -hoss > > David Hostetler > neg...@gm... <mailto:neg...@gm...> > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > ------------------------------------------------------------------------ > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog |
|
From: David H. <neg...@gm...> - 2009-07-17 16:41:31
|
[this discussion arises out of the recent post inquiring how to handle empty values in a list] I think in general the list validation features might benefit from being either parameterized or more comprehensive. By that I mean, for example, that 'force_list' isn't so much a different validation function as it is a behavior that the author may or may not wish to apply to any particular list. In fact, in hindsight I wonder whether instead of having the set of list functions (list, int_list, float_list, bool_list, etc..) there is simply and only 'list'. In addition to the 'min' and 'max' parameters that the list function accepts, you could add to that things like: - 'valtype' (to allow 'valtype=int', 'valtype=float', etc..) - 'force' (replacing the 'force_list' function and allowing any kind of list to adopt the implicit-trailing-comma behavior) - 'allowgaps' (to accommodate the missing value behavior Cameron inquired about) Thus list() accrues parameters as needed to customize how it validates the values in a particular instance. The nice thing here is that the backwards compatibility story is clean: usage of, say, int_list() is functionally equivalent to list(type=int). force_list() becomes list(force=True). mixed_list is still a bit of a black sheep. But that may be fine anyway. Technically, all of the other list variants are implicitly for lists of arbitrary length. mixed_list is only valid for lists of known length (otherwise how can you specify the type for each item in the mixed list?). mixed_list, by its very nature, cannot do implicit type conversions. In other words -- the set of available validation functions essentially remains defined as "what kind of thing you get back from the validation". 'integer' gives you an integer 'tuple' gives you a tuple 'list' gives you a homogeneous list of 0 or more items 'option' gives you one string from among a known list of strings 'mixed_list' gives you a (potentially) heterogeneous list of 0 or more items etc.. There might still be opportunity to refine the relationship between list and mixed_list, but the trade-off is the complexity of the list() API. In fact this whole discussion is about the complexity vs. capability of list validation. Having force_list() be a top-level validation function grows the set of functions by one, but keeps the average function complexity low. But it reduces the capability of the functions because the 'force' behavior cannot be applied to lists obtained via the other functions -- it's an either/or choice for the programmer: you can use int_list to get a list of ints, or you can have force_list to get a forced list of strings, but you can't have a forced list of ints. Pushing some of the choices back into parameters increases both the complexity and the capability of the validation functions, while simultaneously reducing the number of validation functions (assuming the redundant functions were then removed or deprecated). Incidentally -- I would argue that the tuple() validation function has precisely the same needs for parameterization as does list(). The parameterization needs arise from the existence of more than one value per keyword, and that's the case for both lists and tuples. The only difference between the two returned types is that one is mutable the other is not -- they're both sequences. For that matter, why can I get a mixed list but not a mixed tuple? Just some food for thought. regards, -hoss David Hostetler neg...@gm... |
|
From: Michael F. <fuz...@vo...> - 2009-07-17 14:23:32
|
David Hostetler wrote: > > How would validation work for non-string list specifications? > > I.e. -- what value should an empty entry be for an int_list? Ditto > for the other types (float, bool, etc..). > > I suppose an argument can be made to use None under these > circumstances. But then is it more or less intuitive for string lists > to use '' instead of None? > > Hmm... unfortunately that's a very good point. Perhaps an alternative set of validation functions that allow empty values and replace them with None. From a validation point of view either an empty entry is either acceptable or not depending on the use case. Michael > On Fri, Jul 17, 2009 at 08:31, Michael Foord > <fuz...@vo... <mailto:fuz...@vo...>> wrote: > > > Hmm... well on reflection it ought to either be a syntax error or come > in as empty string. I guess empty string makes most sense. I'm > doing an > update to ConfigObj soon to address a couple of issues and see if > I can > include this. > > Thanks > > Michael > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > ------------------------------------------------------------------------ > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog |
|
From: David H. <neg...@gm...> - 2009-07-17 14:15:21
|
How would validation work for non-string list specifications? I.e. -- what value should an empty entry be for an int_list? Ditto for the other types (float, bool, etc..). I suppose an argument can be made to use None under these circumstances. But then is it more or less intuitive for string lists to use '' instead of None? On Fri, Jul 17, 2009 at 08:31, Michael Foord <fuz...@vo...>wrote: > > Hmm... well on reflection it ought to either be a syntax error or come > in as empty string. I guess empty string makes most sense. I'm doing an > update to ConfigObj soon to address a couple of issues and see if I can > include this. > > Thanks > > Michael > > |
|
From: Cameron S. <cam...@cs...> - 2009-07-17 13:40:01
|
Michael Foord wrote: > Hmm... well on reflection it ought to either be a syntax error or come > in as empty string. I guess empty string makes most sense. I'm doing an > update to ConfigObj soon to address a couple of issues and see if I can > include this. That's great. Thanks, again. Cameron. |
|
From: Michael F. <fuz...@vo...> - 2009-07-17 12:31:32
|
Cameron Stone wrote:
> Michael Foord wrote:
>
>> Cameron Stone wrote:
>>
>>> Michael Foord wrote:
>>>
>>>
>>>> Cameron Stone wrote:
>>>>
>>>>
>>>>> I just found this very handy library, and I'm loving it.
>>>>>
>>>>> I'm using sections with options containing values that are
>>>>> comma-separated lists. These lists are meant to have 4 values, some of
>>>>> which can be empty.
>>>>>
>>>>> I have 2 questions:
>>>>>
>>>>> 1) I found the list_values parameter to turn off auto-conversion to
>>>>> list, because it was filtering out the empty entries (and returning
>>>>> lists with less than 4 entries). Is it possible to configure ConfigObj
>>>>> to leave the empty entries in the list?
>>>>>
>>>>>
>>>>>
>>>> What do you mean by 'empty entries'?
>>>>
>>>>
>>> I mean the four entries look like:
>>> key_string = Value1,Value2, ,Value4
>>>
>>>
>> And how should the missing entry look - it isn't an empty string (''),
>> it isn't None - it just isn't there. That should probably be a syntax error.
>>
>
> I was thinking it should imitate string.split:
>
>
>>>> "Value1,Value2,,Value4".split(',')
>>>>
> ['Value1', 'Value2', '', 'Value4']
>
> I'm doing it that way manually at present, but I'm not sure what the
> benefit of removing the missing entries is.
>
>
Hmm... well on reflection it ought to either be a syntax error or come
in as empty string. I guess empty string makes most sense. I'm doing an
update to ConfigObj soon to address a couple of issues and see if I can
include this.
Thanks
Michael
>> How about getting your users to put an empty string instead?
>>
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
--
http://www.ironpythoninaction.com/
|
|
From: Cameron S. <cam...@cs...> - 2009-07-17 12:19:35
|
Michael Foord wrote:
> Cameron Stone wrote:
>> Michael Foord wrote:
>>
>>> Cameron Stone wrote:
>>>
>>>> I just found this very handy library, and I'm loving it.
>>>>
>>>> I'm using sections with options containing values that are
>>>> comma-separated lists. These lists are meant to have 4 values, some of
>>>> which can be empty.
>>>>
>>>> I have 2 questions:
>>>>
>>>> 1) I found the list_values parameter to turn off auto-conversion to
>>>> list, because it was filtering out the empty entries (and returning
>>>> lists with less than 4 entries). Is it possible to configure ConfigObj
>>>> to leave the empty entries in the list?
>>>>
>>>>
>>> What do you mean by 'empty entries'?
>>>
>> I mean the four entries look like:
>> key_string = Value1,Value2, ,Value4
>>
>
> And how should the missing entry look - it isn't an empty string (''),
> it isn't None - it just isn't there. That should probably be a syntax error.
I was thinking it should imitate string.split:
>>> "Value1,Value2,,Value4".split(',')
['Value1', 'Value2', '', 'Value4']
I'm doing it that way manually at present, but I'm not sure what the
benefit of removing the missing entries is.
> How about getting your users to put an empty string instead?
|
|
From: Michael F. <fuz...@vo...> - 2009-07-17 11:25:20
|
Cameron Stone wrote:
> Michael Foord wrote:
>
>> Cameron Stone wrote:
>>
>>> I just found this very handy library, and I'm loving it.
>>>
>>> I'm using sections with options containing values that are
>>> comma-separated lists. These lists are meant to have 4 values, some of
>>> which can be empty.
>>>
>>> I have 2 questions:
>>>
>>> 1) I found the list_values parameter to turn off auto-conversion to
>>> list, because it was filtering out the empty entries (and returning
>>> lists with less than 4 entries). Is it possible to configure ConfigObj
>>> to leave the empty entries in the list?
>>>
>>>
>> What do you mean by 'empty entries'?
>>
>
> I mean the four entries look like:
> key_string = Value1,Value2, ,Value4
>
And how should the missing entry look - it isn't an empty string (''),
it isn't None - it just isn't there. That should probably be a syntax error.
How about getting your users to put an empty string instead?
Michael
>
>> There is no API for fetching line numbers of entries with ConfigObj I'm
>> afraid.
>>
>
> No worries. I'm sure my users can figure it out.
>
> Thanks
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
--
http://www.ironpythoninaction.com/
|
|
From: Cameron S. <cam...@cs...> - 2009-07-17 11:22:22
|
Michael Foord wrote: > Cameron Stone wrote: >> I just found this very handy library, and I'm loving it. >> >> I'm using sections with options containing values that are >> comma-separated lists. These lists are meant to have 4 values, some of >> which can be empty. >> >> I have 2 questions: >> >> 1) I found the list_values parameter to turn off auto-conversion to >> list, because it was filtering out the empty entries (and returning >> lists with less than 4 entries). Is it possible to configure ConfigObj >> to leave the empty entries in the list? >> > > What do you mean by 'empty entries'? I mean the four entries look like: key_string = Value1,Value2, ,Value4 > There is no API for fetching line numbers of entries with ConfigObj I'm > afraid. No worries. I'm sure my users can figure it out. Thanks |
|
From: Michael F. <fuz...@vo...> - 2009-07-17 09:52:48
|
Cameron Stone wrote: > I just found this very handy library, and I'm loving it. > > I'm using sections with options containing values that are > comma-separated lists. These lists are meant to have 4 values, some of > which can be empty. > > I have 2 questions: > > 1) I found the list_values parameter to turn off auto-conversion to > list, because it was filtering out the empty entries (and returning > lists with less than 4 entries). Is it possible to configure ConfigObj > to leave the empty entries in the list? > What do you mean by 'empty entries'? > 2) If the list has an error I'd like to report the line number of the > configuration file. Unfortunately this seems to be only available if > ConfigObj has a parse error. Is there some way I can retrieve (or > reconstruct) the line number corresponding to a key-value pair? > > There is no API for fetching line numbers of entries with ConfigObj I'm afraid. All the best, Michael Foord > Thanks, > Cameron. > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ |
|
From: Cameron S. <cam...@cs...> - 2009-07-17 00:47:32
|
I just found this very handy library, and I'm loving it. I'm using sections with options containing values that are comma-separated lists. These lists are meant to have 4 values, some of which can be empty. I have 2 questions: 1) I found the list_values parameter to turn off auto-conversion to list, because it was filtering out the empty entries (and returning lists with less than 4 entries). Is it possible to configure ConfigObj to leave the empty entries in the list? 2) If the list has an error I'd like to report the line number of the configuration file. Unfortunately this seems to be only available if ConfigObj has a parse error. Is there some way I can retrieve (or reconstruct) the line number corresponding to a key-value pair? Thanks, Cameron. |
|
From: Michael F. <fuz...@vo...> - 2009-07-13 14:52:23
|
Robert Šmol wrote:
> Hi,
>
> thanks for help. Can you advise me since when it is supported?
It's probably a 4.6 feature. You can try just omitting the '_inspec'
keyword. There is a slight issue with the parsing of commas in
configspecs prior to version 4.6 - but in most cases it 'just works'.
I hope this is helpful.
All the best,
Michael
> I have
> python-configobj 4.5.2-1 installed, I am getting:
> rsmol@rsmol-laptop:~/Code/xdrmove$ python src/xdrmove/__init__.py -c
> data/test-config.nin start
> Traceback (most recent call last):
> File "src/xdrmove/__init__.py", line 453, in <module>
> main()
> File "src/xdrmove/__init__.py", line 449, in main
> terminator = XDRSwitch()
> File "src/xdrmove/__init__.py", line 163, in __init__
> self.config = self.init_settings(configFile)
> File "src/xdrmove/__init__.py", line 393, in init_settings
> _inspec=True)
> File "/var/lib/python-support/python2.5/configobj.py", line 1265, in __init__
> raise TypeError('Unrecognised option "%s".' % entry)
> TypeError: Unrecognised option "_inspec".
>
> This is excerpt from the file.
>
> configSpec = ConfigObj(_configspec,
> interpolation=False,
> list_values=False,
> _inspec=True)
>
> I am sorry if this is newbie question.
>
> On Sat, Jul 4, 2009 at 9:36 PM, Michael Foord<fuz...@vo...> wrote:
>
>> Robert Šmol wrote:
>>
>>> Hi,
>>> response is unbelievable quick enough if compared to our R&D ;)
>>>
>>>
>>>
>> Hmmm... I think interpolation should be switched off by default in
>> configspec reading - but that would be a backwards incompatible change.
>> Here is a workaround:
>>
>> >>> config = ConfigObj(configFile, configspec=ConfigObj(_configspec,
>> interpolation=False, _inspec=True, list_values=False))
>> >>> results = config.validate(validator)
>>
>> All the best,
>>
>> Michael Foord
>>
>>
>>
>>> Here is the code to reproduce the problem:
>>>
>>>
>>> from configobj import ConfigObj, flatten_errors
>>> from validate import Validator
>>>
>>> #some defaults
>>> _pidFile = '/var/run/xdr.pid'
>>> _defaultLogFormat = '%(asctime)s - %(levelname)s - %(message)s'
>>>
>>> #configspec is used to validate configuration file
>>> _configspec = ('''
>>> [general]
>>> pid_file = string(min=1, max=100, default=%s)
>>>
>>> [logging]
>>> level= option('INFO','DEBUG','CRITICAL','ERROR', default='INFO')
>>> log_format = string(min=1, max=100, default=%s)
>>> ''' % (_pidFile, _defaultLogFormat)).split('\n')
>>>
>>> #dummy config file
>>> configFile = ''
>>>
>>>
>>> #main loop, if called as a program start main
>>> if __name__ == '__main__':
>>> validator = Validator()
>>> config = ConfigObj(configFile,configspec=_configspec)
>>> results = config.validate(validator)
>>> <<<<<<<<<<<<<<<<
>>>
>>> The problem is, config['log_format'] should be '%(asctime)s -
>>> %(levelname)s - %(message)s'
>>> and the values 'asctime' are interpolated when using logging facility,
>>> but they are evaluated during validation. Perhaps I just need to
>>> somehow properly escape?
>>>
>>> Thanks,
>>>
>>> Robert
>>>
>>>
>>> On Thu, Jul 2, 2009 at 4:51 PM, Michael Foord<fuz...@vo...> wrote:
>>>
>>>
>>>> Robert Šmol wrote:
>>>>
>>>>
>>>>> Hi,
>>>>> I have following for my config spec:
>>>>>
>>>>> _defaultLogFormat = '%(asctime)s - %(levelname)s - %(message)s'
>>>>> _configspec = ('''
>>>>> [general]
>>>>> log_format = string(min=1, max=100, default=%s)
>>>>> ''' % (_defaultLogFormat)).split('\n')
>>>>>
>>>>> When I execute I get the MissingInterpolationError
>>>>> ...
>>>>> ..
>>>>> File "/var/lib/python-support/python2.5/configobj.py", line 368, in
>>>>> recursive_interpolate
>>>>> k, v, s = self._parse_match(match)
>>>>> File "/var/lib/python-support/python2.5/configobj.py", line 454, in
>>>>> _parse_match
>>>>> value, section = self._fetch(key)
>>>>> File "/var/lib/python-support/python2.5/configobj.py", line 424, in _fetch
>>>>> raise MissingInterpolationOption(key)
>>>>> configobj.MissingInterpolationOption: missing option "asctime" in interpolation.
>>>>>
>>>>> How do I get round this?
>>>>>
>>>>>
>>>>>
>>>> Sorry for the slow response I'm currently at EuroPython. Can you send me
>>>> a config file and *full* code to reproduce this.
>>>>
>>>> Thanks
>>>>
>>>> Michael
>>>>
>>>>
>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> _______________________________________________
>>>>> Configobj-develop mailing list
>>>>> Con...@li...
>>>>> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>>>>>
>>>>>
>>>>>
>>>> --
>>>> http://www.ironpythoninaction.com/
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> _______________________________________________
>>>> Configobj-develop mailing list
>>>> Con...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>>>>
>>>>
>>>>
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> Configobj-develop mailing list
>>> Con...@li...
>>> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>>>
>>>
>> --
>> http://www.ironpythoninaction.com/
>> http://www.voidspace.org.uk/blog
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Configobj-develop mailing list
>> Con...@li...
>> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>>
>>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/blackberry
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog
|
|
From: Michael F. <fuz...@vo...> - 2009-07-13 14:40:06
|
Thanks for this - I'll look into fixing it and pushing out a bugfix release shortly. All the best, Michael Pascal Chambon wrote: > Hello > > Here are 3 files that isolate the bug. Just > launch the python file as a script to see. > > * When 2 config sections are present, and one has all its config > values mispelled, we get a "missing section" error instead of "missing > keys" ones. > > * If we remove the valid "[ input ]" section in the INI file (letting > only the 'empty' "[ output ]" one, we get a weirder output : > configobj.validate returns simply "False", not a dictionary, whereas > the doc doesn't mention that behaviour. And so the error message we > want to output is corrupted (we don't even get the name of the missing > section/keys). > > Good luck for with this, if more info/help required just tell me. > > Regards, > Pascal Chambon > > ------------------------------------------------------------------------ > *De :* Pascal Chambon [mailto:pyt...@gm...] > *Envoyé :* lundi 29 juin 2009 19:47 > *À :* con...@li... > *Objet :* Re: [Configobj-develop] - confused by an error message > > Sure, I send it in one week (as soon I as get back from holiday to > my work project...) > > Regards, > Pascal > > Michael Foord wrote: >> That does sound like a bug in ConfigObj. Could you post an example ini >> file and code that shows the problem please. >> >> Thanks >> >> Michael >> >> >> -- >> http://www.ironpythoninaction.com >> >> On 29 Jun 2009, at 16:14, Pascal Chambon <pyt...@gm...> wrote: >> >> >>> Hello >>> >>> I just report a little confusion I once faced : I kept having a >>> "missing >>> section" error message when validating my config.ini file, and I >>> didn't >>> understand because the section WAS there. In the end, I realized that >>> there were just typos in the names of the variables inside that >>> section, >>> and it made the validator believe that the section didn't exist at all >>> (actually it existed, but it was empty). >>> So well, if it's not too much trouble for such a minor bug, it might >>> be >>> cool to replace this error message with a more accurate ones ("field >>> mysection.xxx is missing" or smth like that). >>> >>> Cheers for all, >>> regards, >>> Pascal Chambon >>> >>> --- >>> --- >>> --- >>> --------------------------------------------------------------------- >>> _______________________________________________ >>> Configobj-develop mailing list >>> Con...@li... >>> https://lists.sourceforge.net/lists/listinfo/configobj-develop >>> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Configobj-develop mailing list >> Con...@li... >> https://lists.sourceforge.net/lists/listinfo/configobj-develop >> >> > > ********************************* > This message and any attachments (the "message") are confidential and > intended solely for the addressees. > Any unauthorised use or dissemination is prohibited. > Messages are susceptible to alteration. > France Telecom Group shall not be liable for the message if altered, > changed or falsified. > If you are not the intended addressee of this message, please cancel > it immediately and inform the sender. > ******************************** > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog |
|
From: Robert Š. <smo...@gm...> - 2009-07-07 08:17:07
|
Hi,
thanks for help. Can you advise me since when it is supported? I have
python-configobj 4.5.2-1 installed, I am getting:
rsmol@rsmol-laptop:~/Code/xdrmove$ python src/xdrmove/__init__.py -c
data/test-config.nin start
Traceback (most recent call last):
File "src/xdrmove/__init__.py", line 453, in <module>
main()
File "src/xdrmove/__init__.py", line 449, in main
terminator = XDRSwitch()
File "src/xdrmove/__init__.py", line 163, in __init__
self.config = self.init_settings(configFile)
File "src/xdrmove/__init__.py", line 393, in init_settings
_inspec=True)
File "/var/lib/python-support/python2.5/configobj.py", line 1265, in __init__
raise TypeError('Unrecognised option "%s".' % entry)
TypeError: Unrecognised option "_inspec".
This is excerpt from the file.
configSpec = ConfigObj(_configspec,
interpolation=False,
list_values=False,
_inspec=True)
I am sorry if this is newbie question.
On Sat, Jul 4, 2009 at 9:36 PM, Michael Foord<fuz...@vo...> wrote:
> Robert Šmol wrote:
>> Hi,
>> response is unbelievable quick enough if compared to our R&D ;)
>>
>>
>
> Hmmm... I think interpolation should be switched off by default in
> configspec reading - but that would be a backwards incompatible change.
> Here is a workaround:
>
> >>> config = ConfigObj(configFile, configspec=ConfigObj(_configspec,
> interpolation=False, _inspec=True, list_values=False))
> >>> results = config.validate(validator)
>
> All the best,
>
> Michael Foord
>
>
>> Here is the code to reproduce the problem:
>>
>>
>> from configobj import ConfigObj, flatten_errors
>> from validate import Validator
>>
>> #some defaults
>> _pidFile = '/var/run/xdr.pid'
>> _defaultLogFormat = '%(asctime)s - %(levelname)s - %(message)s'
>>
>> #configspec is used to validate configuration file
>> _configspec = ('''
>> [general]
>> pid_file = string(min=1, max=100, default=%s)
>>
>> [logging]
>> level= option('INFO','DEBUG','CRITICAL','ERROR', default='INFO')
>> log_format = string(min=1, max=100, default=%s)
>> ''' % (_pidFile, _defaultLogFormat)).split('\n')
>>
>> #dummy config file
>> configFile = ''
>>
>>
>> #main loop, if called as a program start main
>> if __name__ == '__main__':
>> validator = Validator()
>> config = ConfigObj(configFile,configspec=_configspec)
>> results = config.validate(validator)
>> <<<<<<<<<<<<<<<<
>>
>> The problem is, config['log_format'] should be '%(asctime)s -
>> %(levelname)s - %(message)s'
>> and the values 'asctime' are interpolated when using logging facility,
>> but they are evaluated during validation. Perhaps I just need to
>> somehow properly escape?
>>
>> Thanks,
>>
>> Robert
>>
>>
>> On Thu, Jul 2, 2009 at 4:51 PM, Michael Foord<fuz...@vo...> wrote:
>>
>>> Robert Šmol wrote:
>>>
>>>> Hi,
>>>> I have following for my config spec:
>>>>
>>>> _defaultLogFormat = '%(asctime)s - %(levelname)s - %(message)s'
>>>> _configspec = ('''
>>>> [general]
>>>> log_format = string(min=1, max=100, default=%s)
>>>> ''' % (_defaultLogFormat)).split('\n')
>>>>
>>>> When I execute I get the MissingInterpolationError
>>>> ...
>>>> ..
>>>> File "/var/lib/python-support/python2.5/configobj.py", line 368, in
>>>> recursive_interpolate
>>>> k, v, s = self._parse_match(match)
>>>> File "/var/lib/python-support/python2.5/configobj.py", line 454, in
>>>> _parse_match
>>>> value, section = self._fetch(key)
>>>> File "/var/lib/python-support/python2.5/configobj.py", line 424, in _fetch
>>>> raise MissingInterpolationOption(key)
>>>> configobj.MissingInterpolationOption: missing option "asctime" in interpolation.
>>>>
>>>> How do I get round this?
>>>>
>>>>
>>> Sorry for the slow response I'm currently at EuroPython. Can you send me
>>> a config file and *full* code to reproduce this.
>>>
>>> Thanks
>>>
>>> Michael
>>>
>>>
>>>> ------------------------------------------------------------------------------
>>>> _______________________________________________
>>>> Configobj-develop mailing list
>>>> Con...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>>>>
>>>>
>>> --
>>> http://www.ironpythoninaction.com/
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> Configobj-develop mailing list
>>> Con...@li...
>>> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Configobj-develop mailing list
>> Con...@li...
>> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>>
>
>
> --
> http://www.ironpythoninaction.com/
> http://www.voidspace.org.uk/blog
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
|
|
From: Michael F. <fuz...@vo...> - 2009-07-04 19:36:54
|
Robert Šmol wrote:
> Hi,
> response is unbelievable quick enough if compared to our R&D ;)
>
>
Hmmm... I think interpolation should be switched off by default in
configspec reading - but that would be a backwards incompatible change.
Here is a workaround:
>>> config = ConfigObj(configFile, configspec=ConfigObj(_configspec,
interpolation=False, _inspec=True, list_values=False))
>>> results = config.validate(validator)
All the best,
Michael Foord
> Here is the code to reproduce the problem:
>
>
> from configobj import ConfigObj, flatten_errors
> from validate import Validator
>
> #some defaults
> _pidFile = '/var/run/xdr.pid'
> _defaultLogFormat = '%(asctime)s - %(levelname)s - %(message)s'
>
> #configspec is used to validate configuration file
> _configspec = ('''
> [general]
> pid_file = string(min=1, max=100, default=%s)
>
> [logging]
> level= option('INFO','DEBUG','CRITICAL','ERROR', default='INFO')
> log_format = string(min=1, max=100, default=%s)
> ''' % (_pidFile, _defaultLogFormat)).split('\n')
>
> #dummy config file
> configFile = ''
>
>
> #main loop, if called as a program start main
> if __name__ == '__main__':
> validator = Validator()
> config = ConfigObj(configFile,configspec=_configspec)
> results = config.validate(validator)
> <<<<<<<<<<<<<<<<
>
> The problem is, config['log_format'] should be '%(asctime)s -
> %(levelname)s - %(message)s'
> and the values 'asctime' are interpolated when using logging facility,
> but they are evaluated during validation. Perhaps I just need to
> somehow properly escape?
>
> Thanks,
>
> Robert
>
>
> On Thu, Jul 2, 2009 at 4:51 PM, Michael Foord<fuz...@vo...> wrote:
>
>> Robert Šmol wrote:
>>
>>> Hi,
>>> I have following for my config spec:
>>>
>>> _defaultLogFormat = '%(asctime)s - %(levelname)s - %(message)s'
>>> _configspec = ('''
>>> [general]
>>> log_format = string(min=1, max=100, default=%s)
>>> ''' % (_defaultLogFormat)).split('\n')
>>>
>>> When I execute I get the MissingInterpolationError
>>> ...
>>> ..
>>> File "/var/lib/python-support/python2.5/configobj.py", line 368, in
>>> recursive_interpolate
>>> k, v, s = self._parse_match(match)
>>> File "/var/lib/python-support/python2.5/configobj.py", line 454, in
>>> _parse_match
>>> value, section = self._fetch(key)
>>> File "/var/lib/python-support/python2.5/configobj.py", line 424, in _fetch
>>> raise MissingInterpolationOption(key)
>>> configobj.MissingInterpolationOption: missing option "asctime" in interpolation.
>>>
>>> How do I get round this?
>>>
>>>
>> Sorry for the slow response I'm currently at EuroPython. Can you send me
>> a config file and *full* code to reproduce this.
>>
>> Thanks
>>
>> Michael
>>
>>
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> Configobj-develop mailing list
>>> Con...@li...
>>> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>>>
>>>
>> --
>> http://www.ironpythoninaction.com/
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Configobj-develop mailing list
>> Con...@li...
>> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>>
>>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog
|
|
From: Robert Š. <smo...@gm...> - 2009-07-03 07:07:28
|
Hi,
response is unbelievable quick enough if compared to our R&D ;)
Here is the code to reproduce the problem:
>>>>>>>>>>>>>>>>>>
from configobj import ConfigObj, flatten_errors
from validate import Validator
#some defaults
_pidFile = '/var/run/xdr.pid'
_defaultLogFormat = '%(asctime)s - %(levelname)s - %(message)s'
#configspec is used to validate configuration file
_configspec = ('''
[general]
pid_file = string(min=1, max=100, default=%s)
[logging]
level= option('INFO','DEBUG','CRITICAL','ERROR', default='INFO')
log_format = string(min=1, max=100, default=%s)
''' % (_pidFile, _defaultLogFormat)).split('\n')
#dummy config file
configFile = ''
#main loop, if called as a program start main
if __name__ == '__main__':
validator = Validator()
config = ConfigObj(configFile,configspec=_configspec)
results = config.validate(validator)
<<<<<<<<<<<<<<<<
The problem is, config['log_format'] should be '%(asctime)s -
%(levelname)s - %(message)s'
and the values 'asctime' are interpolated when using logging facility,
but they are evaluated during validation. Perhaps I just need to
somehow properly escape?
Thanks,
Robert
On Thu, Jul 2, 2009 at 4:51 PM, Michael Foord<fuz...@vo...> wrote:
> Robert Šmol wrote:
>> Hi,
>> I have following for my config spec:
>>
>> _defaultLogFormat = '%(asctime)s - %(levelname)s - %(message)s'
>> _configspec = ('''
>> [general]
>> log_format = string(min=1, max=100, default=%s)
>> ''' % (_defaultLogFormat)).split('\n')
>>
>> When I execute I get the MissingInterpolationError
>> ...
>> ..
>> File "/var/lib/python-support/python2.5/configobj.py", line 368, in
>> recursive_interpolate
>> k, v, s = self._parse_match(match)
>> File "/var/lib/python-support/python2.5/configobj.py", line 454, in
>> _parse_match
>> value, section = self._fetch(key)
>> File "/var/lib/python-support/python2.5/configobj.py", line 424, in _fetch
>> raise MissingInterpolationOption(key)
>> configobj.MissingInterpolationOption: missing option "asctime" in interpolation.
>>
>> How do I get round this?
>>
>
> Sorry for the slow response I'm currently at EuroPython. Can you send me
> a config file and *full* code to reproduce this.
>
> Thanks
>
> Michael
>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Configobj-develop mailing list
>> Con...@li...
>> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>>
>
>
> --
> http://www.ironpythoninaction.com/
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
|
|
From: Michael F. <fuz...@vo...> - 2009-07-02 14:53:10
|
Robert Šmol wrote:
> Hi,
> I have following for my config spec:
>
> _defaultLogFormat = '%(asctime)s - %(levelname)s - %(message)s'
> _configspec = ('''
> [general]
> log_format = string(min=1, max=100, default=%s)
> ''' % (_defaultLogFormat)).split('\n')
>
> When I execute I get the MissingInterpolationError
> ...
> ..
> File "/var/lib/python-support/python2.5/configobj.py", line 368, in
> recursive_interpolate
> k, v, s = self._parse_match(match)
> File "/var/lib/python-support/python2.5/configobj.py", line 454, in
> _parse_match
> value, section = self._fetch(key)
> File "/var/lib/python-support/python2.5/configobj.py", line 424, in _fetch
> raise MissingInterpolationOption(key)
> configobj.MissingInterpolationOption: missing option "asctime" in interpolation.
>
> How do I get round this?
>
Sorry for the slow response I'm currently at EuroPython. Can you send me
a config file and *full* code to reproduce this.
Thanks
Michael
> ------------------------------------------------------------------------------
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
--
http://www.ironpythoninaction.com/
|
|
From: Robert Š. <smo...@gm...> - 2009-07-01 06:52:22
|
Hi,
I have following for my config spec:
_defaultLogFormat = '%(asctime)s - %(levelname)s - %(message)s'
_configspec = ('''
[general]
log_format = string(min=1, max=100, default=%s)
''' % (_defaultLogFormat)).split('\n')
When I execute I get the MissingInterpolationError
...
..
File "/var/lib/python-support/python2.5/configobj.py", line 368, in
recursive_interpolate
k, v, s = self._parse_match(match)
File "/var/lib/python-support/python2.5/configobj.py", line 454, in
_parse_match
value, section = self._fetch(key)
File "/var/lib/python-support/python2.5/configobj.py", line 424, in _fetch
raise MissingInterpolationOption(key)
configobj.MissingInterpolationOption: missing option "asctime" in interpolation.
How do I get round this?
|
|
From: Pascal C. <pyt...@gm...> - 2009-06-29 17:46:58
|
Sure, I send it in one week (as soon I as get back from holiday to my work project...) Regards, Pascal Michael Foord wrote: > That does sound like a bug in ConfigObj. Could you post an example ini > file and code that shows the problem please. > > Thanks > > Michael > > > -- > http://www.ironpythoninaction.com > > On 29 Jun 2009, at 16:14, Pascal Chambon <pyt...@gm...> wrote: > > >> Hello >> >> I just report a little confusion I once faced : I kept having a >> "missing >> section" error message when validating my config.ini file, and I >> didn't >> understand because the section WAS there. In the end, I realized that >> there were just typos in the names of the variables inside that >> section, >> and it made the validator believe that the section didn't exist at all >> (actually it existed, but it was empty). >> So well, if it's not too much trouble for such a minor bug, it might >> be >> cool to replace this error message with a more accurate ones ("field >> mysection.xxx is missing" or smth like that). >> >> Cheers for all, >> regards, >> Pascal Chambon >> >> --- >> --- >> --- >> --------------------------------------------------------------------- >> _______________________________________________ >> Configobj-develop mailing list >> Con...@li... >> https://lists.sourceforge.net/lists/listinfo/configobj-develop >> > > ------------------------------------------------------------------------------ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > |
|
From: Michael F. <fuz...@vo...> - 2009-06-29 17:08:30
|
That does sound like a bug in ConfigObj. Could you post an example ini file and code that shows the problem please. Thanks Michael -- http://www.ironpythoninaction.com On 29 Jun 2009, at 16:14, Pascal Chambon <pyt...@gm...> wrote: > Hello > > I just report a little confusion I once faced : I kept having a > "missing > section" error message when validating my config.ini file, and I > didn't > understand because the section WAS there. In the end, I realized that > there were just typos in the names of the variables inside that > section, > and it made the validator believe that the section didn't exist at all > (actually it existed, but it was empty). > So well, if it's not too much trouble for such a minor bug, it might > be > cool to replace this error message with a more accurate ones ("field > mysection.xxx is missing" or smth like that). > > Cheers for all, > regards, > Pascal Chambon > > --- > --- > --- > --------------------------------------------------------------------- > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop |
|
From: Pascal C. <pyt...@gm...> - 2009-06-29 15:15:06
|
Hello
I just report a little confusion I once faced : I kept having a "missing
section" error message when validating my config.ini file, and I didn't
understand because the section WAS there. In the end, I realized that
there were just typos in the names of the variables inside that section,
and it made the validator believe that the section didn't exist at all
(actually it existed, but it was empty).
So well, if it's not too much trouble for such a minor bug, it might be
cool to replace this error message with a more accurate ones ("field
mysection.xxx is missing" or smth like that).
Cheers for all,
regards,
Pascal Chambon
|
|
From: Robert Š. <smo...@gm...> - 2009-06-22 20:12:11
|
Hi Michael, no problem. I've reworked design to have subsections. And it works ok. Thanks, Robert On Mon, Jun 22, 2009 at 9:02 PM, Michael Foord <fuz...@vo...>wrote: > Hello Robery, > > Repeating sections in configspecs are for differing sections to be > validated with the same spec - it doesn't allow you to have the same > section name repeated many times I'm afraid. You'll need named sections > or subsections to validate with __many__. > > Michael > > Robert Šmol wrote: > > Hi, > > after reading > http://www.voidspace.org.uk/python/articles/configobj.shtml > > I am now wondering if it is possible to validate config that looks > > like this: > > > > > > [general] > > pid_file = 'some.pid' > > > > [scenario] > > name = X > > watched_dir = 'some dir X' > > > > [scenario] > > name = Y > > watched_dir = 'some dir Y' > > > > [worker] > > name = X > > > > [worker] > > name = Y > > <<<<< > > > > Is it possible to have multiple __many__ repeating, or do I have to > > create [scenario] and [worker] section and then list each scenario, > > worker in it as subsection? > > > > Thanks > > > > > ------------------------------------------------------------------------------ > > Are you an open source citizen? Join us for the Open Source Bridge > conference! > > Portland, OR, June 17-19. Two days of sessions, one day of unconference: > $250. > > Need another reason to go? 24-hour hacker lounge. Register today! > > > http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org > > _______________________________________________ > > Configobj-develop mailing list > > Con...@li... > > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > > > ------------------------------------------------------------------------------ > Are you an open source citizen? Join us for the Open Source Bridge > conference! > Portland, OR, June 17-19. Two days of sessions, one day of unconference: > $250. > Need another reason to go? 24-hour hacker lounge. Register today! > > http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > |
|
From: Michael F. <fuz...@vo...> - 2009-06-22 19:03:09
|
Hello Robery, Repeating sections in configspecs are for differing sections to be validated with the same spec - it doesn't allow you to have the same section name repeated many times I'm afraid. You'll need named sections or subsections to validate with __many__. Michael Robert Šmol wrote: > Hi, > after reading http://www.voidspace.org.uk/python/articles/configobj.shtml > I am now wondering if it is possible to validate config that looks > like this: > > > [general] > pid_file = 'some.pid' > > [scenario] > name = X > watched_dir = 'some dir X' > > [scenario] > name = Y > watched_dir = 'some dir Y' > > [worker] > name = X > > [worker] > name = Y > <<<<< > > Is it possible to have multiple __many__ repeating, or do I have to > create [scenario] and [worker] section and then list each scenario, > worker in it as subsection? > > Thanks > > ------------------------------------------------------------------------------ > Are you an open source citizen? Join us for the Open Source Bridge conference! > Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250. > Need another reason to go? 24-hour hacker lounge. Register today! > http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog |
|
From: Robert Š. <smo...@gm...> - 2009-06-22 08:35:34
|
Hi, after reading http://www.voidspace.org.uk/python/articles/configobj.shtml I am now wondering if it is possible to validate config that looks like this: >>>> [general] pid_file = 'some.pid' [scenario] name = X watched_dir = 'some dir X' [scenario] name = Y watched_dir = 'some dir Y' [worker] name = X [worker] name = Y <<<<< Is it possible to have multiple __many__ repeating, or do I have to create [scenario] and [worker] section and then list each scenario, worker in it as subsection? Thanks |