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: Jeffrey B. <jef...@ea...> - 2009-01-16 14:35:47
|
On Friday 16 January 2009 04:07:43 Michael Foord wrote:
> Jeffrey Barish wrote:
> > On Monday 12 January 2009 08:16:57 Michael Foord wrote:
> >> Jeffrey Barish wrote:
> >>> I write the repr of a tuple to my configuration file on exit. Usually,
> >>> I find "<tuple>" in my configuration file afterward, but occasionally
> >>> the quotation marks are missing. I have not been able to detect a
> >>> pattern. Any suggestions?
> >>
> >> Is it actually causing any problems?
> >
> > Or worse: If the value in the configuration file is
> >
> > ('a', ['b', 'c'])
> >
> > then I get a ParseError (at line 8) when I try to read it. That error I
> > cannot fix.
> >
> > BTW, I am using version 4.5.3.
>
> Did you have any luck reproducing this?
>
> Michael
Not really. The problem occurs only on one platform (maemo) when I interrupt
the program (^c). I circumvented the problem by catching the SIGINT so that
I can write the configuration file. I do not understand why configobj
otherwise writes the right data but without the quotes nor why on another
platform it writes exactly the right data including the quotes. In fact, I
don't really understand why it writes anything as the program is exiting.
There could be an issue with my program, but since the program is exiting
anyway, I am satisfied with my remedy.
--
Jeffrey Barish
|
|
From: Michael F. <fuz...@vo...> - 2009-01-16 11:07:53
|
Jeffrey Barish wrote:
> On Monday 12 January 2009 08:16:57 Michael Foord wrote:
>
>> Jeffrey Barish wrote:
>>
>>> I write the repr of a tuple to my configuration file on exit. Usually, I
>>> find "<tuple>" in my configuration file afterward, but occasionally the
>>> quotation marks are missing. I have not been able to detect a pattern.
>>> Any suggestions?
>>>
>> Is it actually causing any problems?
>>
>
> Or worse: If the value in the configuration file is
>
> ('a', ['b', 'c'])
>
> then I get a ParseError (at line 8) when I try to read it. That error I
> cannot fix.
>
> BTW, I am using version 4.5.3.
>
Did you have any luck reproducing this?
Michael
--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog
|
|
From: Jeffrey B. <jef...@ea...> - 2009-01-12 16:03:53
|
On Monday 12 January 2009 08:16:57 Michael Foord wrote:
> Jeffrey Barish wrote:
> > I write the repr of a tuple to my configuration file on exit. Usually, I
> > find "<tuple>" in my configuration file afterward, but occasionally the
> > quotation marks are missing. I have not been able to detect a pattern.
> > Any suggestions?
>
> Is it actually causing any problems?
Or worse: If the value in the configuration file is
('a', ['b', 'c'])
then I get a ParseError (at line 8) when I try to read it. That error I
cannot fix.
BTW, I am using version 4.5.3.
--
Jeffrey Barish
|
|
From: Michael F. <fuz...@vo...> - 2009-01-12 16:01:12
|
Jeffrey Barish wrote:
> On Monday 12 January 2009 08:16:57 Michael Foord wrote:
>
>> Jeffrey Barish wrote:
>>
>>> I write the repr of a tuple to my configuration file on exit. Usually, I
>>> find "<tuple>" in my configuration file afterward, but occasionally the
>>> quotation marks are missing. I have not been able to detect a pattern.
>>> Any suggestions?
>>>
>> Is it actually causing any problems?
>>
>
> When I subsequently read the value from the configuration file, I get a list
> instead of a string. For example, when I write
>
> ('a', ['b'])
>
> I expect to see
>
> "('a', ['b'])"
>
> in the configuration file. When I read that value, I get a string. I eval
> the string to get the original tuple. Occasionally I find
>
> ('a', ['b'])
>
> in the configuration file. When I read that value, I get
>
> ["('a'", "['b'])"]
>
> When I eval that value, I get an error. It seems that I could circumvent the
> problem by restoring the string when I get a list, but the unexpected
> behavior is disturbing.
>
Hmmm... that is a problem. Quoting behaviour should be correct if the
value needs quoting - so it sounds like there is a bug somewhere in the
quoting logic. It will be deterministic - so it should be possible to
reproduce.
If you set the value to be the tuple instead of the repr of the tuple it
will get written out as a list however.
Michael
--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog
|
|
From: Jeffrey B. <jef...@ea...> - 2009-01-12 15:52:14
|
On Monday 12 January 2009 08:16:57 Michael Foord wrote:
> Jeffrey Barish wrote:
> > I write the repr of a tuple to my configuration file on exit. Usually, I
> > find "<tuple>" in my configuration file afterward, but occasionally the
> > quotation marks are missing. I have not been able to detect a pattern.
> > Any suggestions?
>
> Is it actually causing any problems?
When I subsequently read the value from the configuration file, I get a list
instead of a string. For example, when I write
('a', ['b'])
I expect to see
"('a', ['b'])"
in the configuration file. When I read that value, I get a string. I eval
the string to get the original tuple. Occasionally I find
('a', ['b'])
in the configuration file. When I read that value, I get
["('a'", "['b'])"]
When I eval that value, I get an error. It seems that I could circumvent the
problem by restoring the string when I get a list, but the unexpected
behavior is disturbing.
--
Jeffrey Barish
|
|
From: Michael F. <fuz...@vo...> - 2009-01-12 15:17:07
|
Jeffrey Barish wrote: > I write the repr of a tuple to my configuration file on exit. Usually, I > find "<tuple>" in my configuration file afterward, but occasionally the > quotation marks are missing. I have not been able to detect a pattern. Any > suggestions? > Is it actually causing any problems? Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog |
|
From: Jeffrey B. <jef...@ea...> - 2009-01-12 15:10:20
|
I write the repr of a tuple to my configuration file on exit. Usually, I find "<tuple>" in my configuration file afterward, but occasionally the quotation marks are missing. I have not been able to detect a pattern. Any suggestions? -- Jeffrey Barish |
|
From: Michael F. <fuz...@vo...> - 2009-01-12 14:34:27
|
Nicholas Bayle wrote: > Hello- > > I have a need to read an ini file (that I have no control over) that > uses ; as the comment marker. > > I found the following with respect to that: > http://sourceforge.net/mailarchive/message.php?msg_id=46F666FC.8080500%40voidspace.org.uk > > > You should be able to switch over the dividers and comment markers > that > > ConfigObj allows by changing the regular expressions it uses for > parsing. > > > > The regexes are class attributes of the ConfigObj class. > Unfortunately > > you probably need to modify all of them. This should be quite easy > though. > > But, as I'm new to all of this, I have no idea how to set class > attributes or what the correct regular expression(s) would be. Can > anyone provide examples? > Hmmm... try swapping the hashes (#) in the regexes for semicolons. > Also, this particular ini file lists duplicate "keyword" names as a > way to specify multiple parameters, like so: > > TrustedCACert=/etc/CA/admin.pem > TrustedCACert=/etc/CA/client.pem > > This causes ConfigObj to barf--which is fine, because I don't need to > read these values, I would just like to ignore the error and move on. > Is this possible? > This is actually the default behavior - but you have to catch the exception to access the successfully parsed values. try: config = ConfigObj(filename) except Exception, e: config = e.config Michael Foord > > Thanks for any help and excuse my voluminous ignorance... > Nick > > ------------------------------------------------------------------------------ > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB > _______________________________________________ > 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: Nicholas B. <nic...@mi...> - 2009-01-07 20:30:58
|
Hello- I have a need to read an ini file (that I have no control over) that uses ; as the comment marker. I found the following with respect to that: http://sourceforge.net/mailarchive/message.php?msg_id=46F666FC.8080500%40voidspace.org.uk > You should be able to switch over the dividers and comment markers that > ConfigObj allows by changing the regular expressions it uses for parsing. > > The regexes are class attributes of the ConfigObj class. Unfortunately > you probably need to modify all of them. This should be quite easy though. But, as I'm new to all of this, I have no idea how to set class attributes or what the correct regular expression(s) would be. Can anyone provide examples? Also, this particular ini file lists duplicate "keyword" names as a way to specify multiple parameters, like so: TrustedCACert=/etc/CA/admin.pem TrustedCACert=/etc/CA/client.pem This causes ConfigObj to barf--which is fine, because I don't need to read these values, I would just like to ignore the error and move on. Is this possible? Thanks for any help and excuse my voluminous ignorance... Nick |
|
From: Sebastian W. <bas...@gm...> - 2008-12-02 09:33:40
|
Monday 01 December 2008 23:40:42 T. Hariharan
> This is what I'm doing in my script to convert the single value to a list.
> Perhaps there is a better way. if type(pathList) == type(''):
> pathList = [pathList]
if isinstance(pathList, basestring):
pathList = [pathList]
--
Freedom is always the freedom of dissenters.
(Rosa Luxemburg)
|
|
From: T. H. <har...@ya...> - 2008-12-01 22:40:46
|
Thanks for the fast response.
This is what I'm doing in my script to convert the single value to a list. Perhaps there is a better way.
if type(pathList) == type(''):
pathList = [pathList]
I don't really like the the special syntax with a trailing comma (similar to the python syntax to create a tuple with 1 element). It's easy to forget it yourself, but if other people are going to write ini files it's a disaster waiting to happen.
I haven't checked out configspec, but it looks like the way to go. For now I'm going to leave it the way it is - I may add a utility function to get values for keywords that should be lists.
Hari
----- Original Message ----
From: Michael Foord <fuz...@vo...>
To: T. Hariharan <har...@ya...>; con...@li...
Sent: Monday, December 1, 2008 2:24:40 PM
Subject: Re: [Configobj-develop] List values
T. Hariharan wrote:
> When you have a keyword that has a list of values, eg:
>
> PathList = /path1, /path2
>
> config['PathList'] returns a list of values. However if you have only one value:
>
> PathList = /path1
>
> config['PathList'] returns a string value.
>
> It would be nice if you can tell ConfigObj to always return values for certain keywords as a list, even if there is only one value. In the second case above, config['PathList'] would return [ '/path1' ]. Is there a way to do this? I'm sure others would have run into this issue.
>
An even better way to achieve this would be to create a custom
configspec with a check function that can take a single value or a list
and always returns a list.
All the best,
Michael Foord
> Thanks,
> Hari
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> 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...> - 2008-12-01 22:24:48
|
T. Hariharan wrote: > When you have a keyword that has a list of values, eg: > > PathList = /path1, /path2 > > config['PathList'] returns a list of values. However if you have only one value: > > PathList = /path1 > > config['PathList'] returns a string value. > > It would be nice if you can tell ConfigObj to always return values for certain keywords as a list, even if there is only one value. In the second case above, config['PathList'] would return [ '/path1' ]. Is there a way to do this? I'm sure others would have run into this issue. > An even better way to achieve this would be to create a custom configspec with a check function that can take a single value or a list and always returns a list. All the best, Michael Foord > Thanks, > Hari > > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > 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...> - 2008-12-01 22:22:07
|
T. Hariharan wrote: > When you have a keyword that has a list of values, eg: > > PathList = /path1, /path2 > > config['PathList'] returns a list of values. However if you have only one value: > > PathList = /path1 > > config['PathList'] returns a string value. > > It would be nice if you can tell ConfigObj to always return values for certain keywords as a list, even if there is only one value. In the second case above, config['PathList'] would return [ '/path1' ]. Is there a way to do this? I'm sure others would have run into this issue. > The correct syntax for a list with a single member is: PathList = /path1, Otherwise the code to check for a string first and turn it into a single membered list is quite straightforward. :-) All the best, Michael > Thanks, > Hari > > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > 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: T. H. <har...@ya...> - 2008-12-01 22:13:59
|
When you have a keyword that has a list of values, eg:
PathList = /path1, /path2
config['PathList'] returns a list of values. However if you have only one value:
PathList = /path1
config['PathList'] returns a string value.
It would be nice if you can tell ConfigObj to always return values for certain keywords as a list, even if there is only one value. In the second case above, config['PathList'] would return [ '/path1' ]. Is there a way to do this? I'm sure others would have run into this issue.
Thanks,
Hari
|
|
From: Michael F. <fuz...@vo...> - 2008-11-25 11:23:24
|
Hello Hagen, You should be able to use ConfigObj with IronPythonStudio - but I don't think IronPythonStudio makes it easy to create projects with additional libraries. I don't recommend it as an IDE. Instead use something like Wing or Komodo, with Visual Studio Express for the windows forms designer. If you have Visual Studio generate C# for your forms / dialogs you can always subclass from IronPython to implement functionality in Python. For what its worth the code you provided should work, so long as the path is to the directory containing ConfigObj. It won't work if ConfigObj is installed as an egg - other than that you will have to show the actual error message (full traceback) for me to diagnose it. Michael Foord Hagen Layer wrote: > Hello, > > is there a way to use configObj within IronPython Studio? > I cannot import os without an exception... > > I tried import sys > sys.path.append(r'c:\Programme\Python\Lib') > > I hope you could help me. > > Many thanks, Hagen > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ |
|
From: Hagen L. <Hag...@gm...> - 2008-11-25 10:12:12
|
Hello, is there a way to use configObj within IronPython Studio? I cannot import os without an exception... I tried import sys sys.path.append(r'c:\Programme\Python\Lib') I hope you could help me. Many thanks, Hagen |
|
From: Michael F. <fuz...@vo...> - 2008-11-24 02:01:14
|
Iain Murchland wrote: > Hi all, > > I have a need to specify a python class (as opposed to a string > referring to said class) as the value of a ConfigObj config variable. > > If I do so without importing the relevant module in the config file, > then I get a "configobj.UnreprError: Unknown name or type in value". If > I import the module at the start of the config file, then I get a parser > error, cos its not good config file syntax. > > I realise its a bit outside scope of a Win INI, but was hoping that > somebody might have had a similar problem before and know a solution. > > I'm afraid you can't do it within ConfigObj. Allowing it would allow the loading of a config file to trigger code execution, which is potentially unsafe and outside the scope of ConfigObj. You could pickle objects into strings and store them in ConfigObj which would also be pretty evil. Best to allow the storing of names corresponding to objects and turn it back into an object yourself. All the best, Michael > Thanks > Iain > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > 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: Iain M. <iai...@gm...> - 2008-11-24 00:33:49
|
Hi all, I have a need to specify a python class (as opposed to a string referring to said class) as the value of a ConfigObj config variable. If I do so without importing the relevant module in the config file, then I get a "configobj.UnreprError: Unknown name or type in value". If I import the module at the start of the config file, then I get a parser error, cos its not good config file syntax. I realise its a bit outside scope of a Win INI, but was hoping that somebody might have had a similar problem before and know a solution. Thanks Iain |
|
From: Michael F. <fuz...@vo...> - 2008-11-19 20:28:12
|
Manjunath Sripadarao wrote:
> I found that the config file generated by python-configobj cannot be
> read by some programs
> like gdm, because of a quirk. Instead of generating lines like below
>
> command=X -br -audit :0
>
> python-config puts a space on either side of the '=' as in below
>
> command = X -br -audit :0
>
> Is there an option where I can eliminate this space ?
>
There's no built-in way to do this.
You can either filter every line of the output with line.replace(' = ',
'=') or add the functionality to ConfigObj itself (with tests and
documentation patches preferably).
Michael
> Thanks,
> Manju
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> 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: Manjunath S. <man...@gm...> - 2008-11-19 15:39:26
|
I found that the config file generated by python-configobj cannot be read by some programs like gdm, because of a quirk. Instead of generating lines like below command=X -br -audit :0 python-config puts a space on either side of the '=' as in below command = X -br -audit :0 Is there an option where I can eliminate this space ? Thanks, Manju |
|
From: Michael F. <fuz...@vo...> - 2008-11-18 23:01:54
|
David Hostetler wrote: > On Tue, Nov 18, 2008 at 5:31 PM, Michael Foord > <fuz...@vo...> wrote: > >> That's a good idea. Let me check my time machine: >> >> http://www.voidspace.org.uk/python/weblog/arch_d7_2008_10_25.shtml#e1020 >> >> > > Sweeeeet!!! > > And not only that, but apparently... > > "Previously a __many__ section had to be the only sub-section in a > section - now __many__ can appear alongside other sections and will > only be used to validate sub-sections that don't have an explicit > validation section." > > Does that same behavior apply to the scalar __many__ support? If so > - double sweet. > It should work like that. Let me know if you have any problems. Michael > cheers, > > -David > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > 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...> - 2008-11-18 22:57:11
|
On Tue, Nov 18, 2008 at 5:31 PM, Michael Foord <fuz...@vo...> wrote: > > That's a good idea. Let me check my time machine: > > http://www.voidspace.org.uk/python/weblog/arch_d7_2008_10_25.shtml#e1020 > Sweeeeet!!! And not only that, but apparently... "Previously a __many__ section had to be the only sub-section in a section - now __many__ can appear alongside other sections and will only be used to validate sub-sections that don't have an explicit validation section." Does that same behavior apply to the scalar __many__ support? If so - double sweet. cheers, -David |
|
From: Michael F. <fuz...@vo...> - 2008-11-18 22:31:22
|
David Hostetler wrote: > I'm finally getting around to taking advantage of Validator (have been > using configobj for awhile), and unfortunately I'm finding that it > currently lacks a capability that is (for my purposes) a necessity. > > Basically, I need a repetition mechanisms that works for keyword=value > pairs. The '__many__' feature works for repeated subsections within a > given section, but I need something that lets me validate repeated > keywords within a given section. > > I.e., for a config like: > > [somesection] > foo = 1 > bar = 2 > > > I could define a configspec like so: > > [somesection] > __many__ = integer(default=0) > > That's a good idea. Let me check my time machine: http://www.voidspace.org.uk/python/weblog/arch_d7_2008_10_25.shtml#e1020 Yup, in Subversion and due for release soon. In the meantime you can try out the version in Subversion. https://svn.pythonutils.python-hosting.com/trunk/pythonutils/configobj.py Michael Foord > That would allow a config file to include an arbitrary number of > keyword=value pairs in the 'somesection' section, and I don't need a > priori knowledge of the full set (the very same logical justification > for the existing __many__ subsection feature). > > Without this capability, I'm compelled to restructure to something like this: > > [somesection] > [[foo]] > value = 1 > [[bar]] > value = 2 > > > with a configspec like: > > [somesection] > [[__many__]] > value = integer(default=0) > > > Which in my opinion is less syntactically efficient for the nature of > the data I need to support. That is - it forces another layer of > config sectional hierarchy where it isn't needed and it muddies the > namespace unnecessarily. > > > Is there a way to do this in the current implementation that I haven't > discovered, and if not - could this possibly be added as a new > capability? > > regards, > > -David > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > 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...> - 2008-11-18 22:23:25
|
I'm finally getting around to taking advantage of Validator (have been
using configobj for awhile), and unfortunately I'm finding that it
currently lacks a capability that is (for my purposes) a necessity.
Basically, I need a repetition mechanisms that works for keyword=value
pairs. The '__many__' feature works for repeated subsections within a
given section, but I need something that lets me validate repeated
keywords within a given section.
I.e., for a config like:
[somesection]
foo = 1
bar = 2
I could define a configspec like so:
[somesection]
__many__ = integer(default=0)
That would allow a config file to include an arbitrary number of
keyword=value pairs in the 'somesection' section, and I don't need a
priori knowledge of the full set (the very same logical justification
for the existing __many__ subsection feature).
Without this capability, I'm compelled to restructure to something like this:
[somesection]
[[foo]]
value = 1
[[bar]]
value = 2
with a configspec like:
[somesection]
[[__many__]]
value = integer(default=0)
Which in my opinion is less syntactically efficient for the nature of
the data I need to support. That is - it forces another layer of
config sectional hierarchy where it isn't needed and it muddies the
namespace unnecessarily.
Is there a way to do this in the current implementation that I haven't
discovered, and if not - could this possibly be added as a new
capability?
regards,
-David
|
|
From: Michael F. <fuz...@vo...> - 2008-11-18 14:25:29
|
mai...@op... wrote:
> Zitat von Michael Foord <fuz...@vo...>:
>
>> mai...@op... wrote:
>>> Hi,
>>>
>>> i have a problem starting elisa with follow error that come from
>>> configobj (i think)
>>
>> I've just tested that config file with ConfigObj 4.5.3 and it reads
>> fine. What version of ConfigObj does Elisa use?
>
> Where can i see this? it begins with:
>>> import configobj
>>> configobj.__version__
'4.5.3'
>>>
>
> # configobj.py
> # A config file reader/writer that supports nested sections in config
> files.
> # Copyright (C) 2005-2006 Michael Foord, Nicola Larosa
> # E-mail: fuzzyman AT voidspace DOT org DOT uk
> # nico AT tekNico DOT net
>
> # ConfigObj 4
>
> - i have updated ConfigObj to 4.5.3 and its not working to. How can i
> test what is wrong? Do i have Python compiled wrong?
>
It is *highly* unlikely to be due to Python being incorrectly compiled.
You can see if it is due to an invalid config file by trying it from the
interactive interpreter:
>>> from configobj import ConfigObj
>>> c = ConfigObj(filename, unrepr=True)
As I said, I tried the config file you attached and could use it fine
with ConfigObj 4.5.3.
The error in the traceback definitely *looks* like an error from
ConfigObj. You could modify the '__init__' method of your copy of
ConfigObj to print the filename to see if it is loading the config file
you think. Other than that you will have to go to the Elisa mailing list
I'm afraid (although if it is a problem with ConfigObj I'm happy to help.)
Michael Foord
>>
>> Michael Foord
>>>
>>> the code, elisa uses is (./elisa/core/config.py):
>>>
>>> self.info("Using %r config file", config_file)
>>> try:
>>> self._config = ConfigObj(config_file, unrepr=True)
>>> except ConfigObjError, ex:
>>> errors = [ error.message for error in ex.errors ]
>>> errors = ';'.join(errors)
>>> raise ConfigError("Config format error in %s: %s" %
>>> (config_file,
>>>
>>> errors))
>>>
>>> the error i become is:
>>>
>>> File "build/lib.linux-i686-2.5/twisted/internet/base.py", line
>>> 705, in runUntilCurrent
>>>
>>>
>>> File "/usr/bin/elisa", line 153,
>>> in _start_application
>>>
>>> options=options)
>>>
>>> File
>>> "/usr/lib/python2.5/site-packages/elisa/core/application.py", line
>>> 269, in __init__
>>>
>>>
>>>
>>> File
>>> "/usr/lib/python2.5/site-packages/elisa/core/application.py", line
>>> 165, in __init__
>>>
>>>
>>>
>>> File
>>> "/usr/lib/python2.5/site-packages/elisa/core/application.py", line
>>> 209, in _load_config
>>>
>>>
>>>
>>> File "/usr/lib/python2.5/site-packages/elisa/core/config.py", line 92,
>>> in __init__
>>>
>>>
>>>
>>> elisa.core.config.ConfigError: Config format error in
>>> /storage/.elisa-0.5/elisa_0_5_6.conf: Parse error in value at line
>>> 2.;Parse error in
>>> value at line 3.;Parse error in value at line 4.;Parse error in value
>>> at line 5.;Parse
>>> error in value at line 7.;Parse error in value at line 10.;Parse error
>>> in value at line
>>> 11.;Parse error in value at line 12.;Parse error in value at line
>>> 15.;Parse error in
>>> value at line 16.;Parse error in value at line 17.
>>>
>>>
>>>
>>> (twisted/internet/base.py:707)
>>>
>>> i have build my complete Distribution incl. Python-2.5.2 with uClibc
>>> from Scratch. Where can be my problem?
>>>
>>> Stephan
>>> i have attached the configfile, that elisa creates, it looks valid.
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> -------------------------------------------------------------------------
>>>
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>> challenge
>>> Build the coolest Linux based applications with Moblin SDK & win
>>> great prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in
>>> the world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> ------------------------------------------------------------------------
>>>
>>>
>>> _______________________________________________
>>> Configobj-develop mailing list
>>> Con...@li...
>>> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>>>
>>
>>
>> --
>> http://www.ironpythoninaction.com/
>>
>>
>> -------------------------------------------------------------------------
>>
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win
>> great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Configobj-develop mailing list
>> Con...@li...
>> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>>
>>
>
>
>
>
--
http://www.ironpythoninaction.com/
|