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: Michael F. <fuz...@vo...> - 2011-08-30 14:16:34
|
You have to do it yourself. See the link at the bottom of each email. All the best, Michael Foord On 30/08/2011 14:42, Whitaker, Maria - BLS wrote: > > Thanks. > > > > ------------------------------------------------------------------------------ > Special Offer -- Download ArcSight Logger for FREE! > Finally, a world-class log management solution at an even better > price-free! And you'll get a free "Love Thy Logs" t-shirt when you > download Logger. Secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsisghtdev2dev > > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html |
|
From: Whitaker, M. - B. <Whi...@BL...> - 2011-08-30 14:12:37
|
Thanks. |
|
From: Nicolas M. <nic...@le...> - 2011-08-30 08:40:46
|
On 08/30/2011 09:34 AM, Glauco Uri wrote:
> Il 29/08/2011 19:41, Arash Azarmi ha scritto:
>> Hi all ,
>> I have 2 questions.
>>
>>
>> 1- I was wondering whats the procedure for reading the value for
>> subsection, sub-sub section and so on :
>>
>> config.cfg file :
>>
>> [Header]
>> User=value
>>
>> [[ loop]]
>> start= startPoint
>> step= stepPoint
>> stop= stopPoint
>>
>>
>>
>> Python Code for reading config file :
>>
>> config=configObj(path)
>> Header = config['Header']
>> User = Header['User']
>> loop = ??
>
> loop = Header['loop']
no what you have to do :
User = config['Header']['User']
start = config['Header']['loop']['start']
Of course you can use "shortcuts" like you do with your :
Header = config['Header']
so start would be :
start = Header['loop']['start']
or even :
Header = config['Header']
loop = Header['loop']
start = loop['start']
The loop is only relevant if you have multiple subsections AND you don't
know the names of the subsections like this:
[Header]
User=value
[[loop1]]
start = startPoint
step = stepPoint
stop = stopPoint
[[loop2]]
start = startPoint
step = stepPoint
stop = stopPoint
so you'll have the code like I said in the previous mail which will goes
through loop1 and loop2 and so on.
But once again, this is only relevant if you don't know the name of the
subsections in advance. If you know their name, you don't need to do a
loop. Just call them directly like said above with :
Header = config['Header']
loop = Header['loop']
start = loop['start']
>> step= ???
> step = loop['step']
>
>
> this is described in the documentation.
> User is a string (probably)
> loop is a dictionary
>
>
>>
>> 2 - how can I have multiple subsections with similar name and keywords
>> within one section ?
>> For example having multiple [[loop]] subsections like one is defined
>> above .
>
> multiple "loop" is not possible. this i a keyword. For this use is
> better an xml.
> but you can do something similar using
>
> [[loop1]]
> ...
> [[loop2]]
> ...
> and so on.
>>
>>
>
|
|
From: Glauco U. <gla...@pr...> - 2011-08-30 08:04:27
|
Il 29/08/2011 19:41, Arash Azarmi ha scritto: > Hi all , > I have 2 questions. > > > 1- I was wondering whats the procedure for reading the value for > subsection, sub-sub section and so on : > > config.cfg file : > > [Header] > User=value > > [[ loop]] > start= startPoint > step= stepPoint > stop= stopPoint > > > > Python Code for reading config file : > > config=configObj(path) > Header = config['Header'] > User = Header['User'] > loop = ?? loop = Header['loop'] > step= ??? step = loop['step'] this is described in the documentation. User is a string (probably) loop is a dictionary > > 2 - how can I have multiple subsections with similar name and keywords > within one section ? > For example having multiple [[loop]] subsections like one is defined > above . multiple "loop" is not possible. this i a keyword. For this use is better an xml. but you can do something similar using [[loop1]] ... [[loop2]] ... and so on. > > -- Glauco Uri Prometeia SpA Via G. Marconi, 43 - 40122 Bologna Via Gonzaga, 7 - 20123 Milano Via Tirso, 26 - 00198 Roma Italia e-mail : gla...@pr... phone : +39 051 6480911 --------------------------------------------------------------------------- Il contenuto e gli allegati di questo messaggio sono strettamente confidenziali, e ne sono vietati la diffusione, la riproduzione e l'uso non autorizzato. Il suo contenuto non costituisce impegno da parte della Società salvo accordo scritto tra quest'ultima ed il destinatario. Qualora il presente messaggio Le fosse pervenuto per errore, La preghiamo di comunicare immediatamente al mittente l'errata ricezione e di distruggere quanto ricevuto (compresi i file allegati) senza farne copia. Qualsivoglia utilizzo non autorizzato del contenuto di questo messaggio costituisce violazione dell'obbligo di non rivelare il contenuto della corrispondenza tra altri soggetti, salvo più grave illecito, ed espone il responsabile alle relative conseguenze. This e-mail (and any attachment(s)) is strictly confidential and for use only by intended recipient(s). Any use, distribution, reproduction or disclosure by any other person is strictly prohibited. The content of this e-mail does not constitute a commitment by the Company except where provided for in a written agreement between this e-mail addressee and the Company. If you are not an intended recipient(s), please notify the sender promptly and destroy this message and its attachments without reading or saving it in any manner. Any non authorized use of the content of this message constitutes a violation of the obligation to abstain from learning of the correspondence among other subjects, except for more serious offence, and exposes the person responsible to the relevant consequences. --------------------------------------------------------------------------- Il contenuto di questa e-mail è rivolto unicamente alle persone alle quali è indirizzato e può contenere informazioni la cui riservatezza è tutelata legalmente. Sono vietati la riproduzione, la diffusione e l’uso di questa e-mail in mancanza di autorizzazione del destinatario. Se avete ricevuto questa e-mail per errore vogliate cortesemente contattarci immediatamente. This e-mail is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Unauthorised reproduction, dissemination or use of this e-mail or of the information herein by anyone other than the intended recipient is prohibited. If you have received this e-mail by mistake, please notify us immediately. |
|
From: Nicolas M. <nic...@le...> - 2011-08-30 06:21:41
|
So in my example, "config" is an instance of the ConfigObj object:
config = ConfigObj('PATH_TO_CONFIG_FILE')
# Then you can start a loop :
for key in config[main_key]:
is_a_subsection = isinstance(config[main_key][key],dict)
if is_a_subsection:
do something
So with your exemple, my "main_key" is the [header] and the key is your
[[loop]]
You can understand it like this :
- open python in interractive mode :
python
- import configobj :
from configobj import ConfigObj
- create your configobj instance :
config = ConfigObj('PATH_TO_CONFIG_FILE')
- then display the content of config :
config
Here is an exerpt of my config file :
ConfigObj({'opghl': {'enable': 'yes', 'acc_host': 'ghl-acc',
'acc_storage': '/home/fabric/postgres_repprod/', 'ghl': {'acc_db':
'ghl-sync'}}, ...
So if you reconstruct the tree with that list :
[opghl]
enable = yes
acc_host = ghl-acc
acc_storage = /home/fabric/postgres_repprod/
[[ghl]]
acc_db = ghl-sync
that's because opghl is a dictionnary with some keys/values. And one of
these keys ("ghl") is also a dictionnary.
So in my code isinstance test each keys into opghl (this is the
"main_key"). So it test :
- enable
- acc_host
- acc_storage
- ghl
If one is a dictionnary then it goes through my condition (isinstance
returns true).
On 08/29/2011 10:37 PM, Arash Azarmi wrote:
> Would you elaborate ? I dont get it.
>
> On Mon, Aug 29, 2011 at 1:23 PM, Nicolas Michel
> <nic...@le... <mailto:nic...@le...>> wrote:
>
> Hehe, not so easy! ;)
> This is a subsection only if the key is not only a value but a
> dictionary :
>
> is_a_subsection = isinstance(config[main_key][key],dict)
> if is_a_subsection:
> do ...
>
> On 08/29/2011 07:41 PM, Arash Azarmi wrote:
> > Hi all ,
> > I have 2 questions.
> >
> >
> > 1- I was wondering whats the procedure for reading the value for
> > subsection, sub-sub section and so on :
> >
> > config.cfg file :
> >
> > [Header]
> > User=value
> >
> > [[ loop]]
> > start= startPoint
> > step= stepPoint
> > stop= stopPoint
> >
> >
> >
> > Python Code for reading config file :
> >
> > config=configObj(path)
> > Header = config['Header']
> > User = Header['User']
> > loop = ??
> > step= ???
> >
> > 2 - how can I have multiple subsections with similar name and
> keywords
> > within one section ?
> > For example having multiple [[loop]] subsections like one is
> defined above .
> >
> > Thank you ,
> > Arash.
> >
> >
> >
> ------------------------------------------------------------------------------
> > EMC VNX: the world's simplest storage, starting under $10K
> > The only unified storage solution that offers unified management
> > Up to 160% more powerful than alternatives and 25% more efficient.
> > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
> >
> >
> >
> > _______________________________________________
> > Configobj-develop mailing list
> > Con...@li...
> <mailto:Con...@li...>
> > https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
>
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> <mailto:Con...@li...>
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
>
>
>
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
>
>
>
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
|
|
From: Arash A. <aza...@gm...> - 2011-08-29 20:37:13
|
Would you elaborate ? I dont get it. On Mon, Aug 29, 2011 at 1:23 PM, Nicolas Michel <nic...@le...>wrote: > Hehe, not so easy! ;) > This is a subsection only if the key is not only a value but a dictionary : > > is_a_subsection = isinstance(config[main_key][key],dict) > if is_a_subsection: > do ... > > On 08/29/2011 07:41 PM, Arash Azarmi wrote: > > Hi all , > > I have 2 questions. > > > > > > 1- I was wondering whats the procedure for reading the value for > > subsection, sub-sub section and so on : > > > > config.cfg file : > > > > [Header] > > User=value > > > > [[ loop]] > > start= startPoint > > step= stepPoint > > stop= stopPoint > > > > > > > > Python Code for reading config file : > > > > config=configObj(path) > > Header = config['Header'] > > User = Header['User'] > > loop = ?? > > step= ??? > > > > 2 - how can I have multiple subsections with similar name and keywords > > within one section ? > > For example having multiple [[loop]] subsections like one is defined > above . > > > > Thank you , > > Arash. > > > > > > > ------------------------------------------------------------------------------ > > EMC VNX: the world's simplest storage, starting under $10K > > The only unified storage solution that offers unified management > > Up to 160% more powerful than alternatives and 25% more efficient. > > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev > > > > > > > > _______________________________________________ > > Configobj-develop mailing list > > Con...@li... > > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > > > ------------------------------------------------------------------------------ > Special Offer -- Download ArcSight Logger for FREE! > Finally, a world-class log management solution at an even better > price-free! And you'll get a free "Love Thy Logs" t-shirt when you > download Logger. Secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsisghtdev2dev > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > |
|
From: Nicolas M. <nic...@le...> - 2011-08-29 20:23:35
|
Hehe, not so easy! ;)
This is a subsection only if the key is not only a value but a dictionary :
is_a_subsection = isinstance(config[main_key][key],dict)
if is_a_subsection:
do ...
On 08/29/2011 07:41 PM, Arash Azarmi wrote:
> Hi all ,
> I have 2 questions.
>
>
> 1- I was wondering whats the procedure for reading the value for
> subsection, sub-sub section and so on :
>
> config.cfg file :
>
> [Header]
> User=value
>
> [[ loop]]
> start= startPoint
> step= stepPoint
> stop= stopPoint
>
>
>
> Python Code for reading config file :
>
> config=configObj(path)
> Header = config['Header']
> User = Header['User']
> loop = ??
> step= ???
>
> 2 - how can I have multiple subsections with similar name and keywords
> within one section ?
> For example having multiple [[loop]] subsections like one is defined above .
>
> Thank you ,
> Arash.
>
>
> ------------------------------------------------------------------------------
> EMC VNX: the world's simplest storage, starting under $10K
> The only unified storage solution that offers unified management
> Up to 160% more powerful than alternatives and 25% more efficient.
> Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
>
>
>
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
|
|
From: Arash A. <aza...@gm...> - 2011-08-29 17:41:12
|
Hi all ,
I have 2 questions.
1- I was wondering whats the procedure for reading the value for subsection,
sub-sub section and so on :
config.cfg file :
[Header]
User=value
[[ loop]]
start= startPoint
step= stepPoint
stop= stopPoint
Python Code for reading config file :
config=configObj(path)
Header = config['Header']
User = Header['User']
loop = ??
step= ???
2 - how can I have multiple subsections with similar name and keywords
within one section ?
For example having multiple [[loop]] subsections like one is defined above .
Thank you ,
Arash.
|
|
From: Michael F. <fuz...@vo...> - 2011-08-16 12:59:41
|
Hello Tomi,
I'm sure the VdtTypeError messages could be improved. Feel free to
create an issue:
https://code.google.com/p/configobj/issues/list
All the best,
Michael Foord
On 03/08/2011 16:07, Tomi Pieviläinen wrote:
> Hi!
>
> Please cc me, I'm not on the list.
>
> I just had a hairy bug in my config file; I had an extra comma at the
> end of a string, so it was interpreted as a list, not as a string. The
> validation error was all the time:
>
> VdtTypeError('the value "[\'mplayer -slave -vc null -vo null
> {file}\']" is of the wrong type.',)
>
> I was thinking that if the validator would say what type it expected
> and what it got, I would have seen the comma a lot faster. Maybe the
> exceptions could say that?
>
>
> Then one extra question... Is it possible to put defaults into
> [__many__] subsections? I'm wondering what's the best solution to
> configure cplay (a curses frontend to audio players). It needs some
> config information about what cli players to use, and what command to
> give them. There's a varying amount (different players for different
> file types, though mplayer plays them all), but I'd like to put some
> default players in there (mplayer, ogg123, mpg123 etc).
>
>
>
> ------------------------------------------------------------------------------
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts.
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos& much more. Register early& save!
> http://p.sf.net/sfu/rim-blackberry-1
>
>
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
--
http://www.voidspace.org.uk/
May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
|
|
From: Tomi P. <tom...@ik...> - 2011-08-03 15:30:57
|
Hi!
Please cc me, I'm not on the list.
I just had a hairy bug in my config file; I had an extra comma at the
end of a string, so it was interpreted as a list, not as a string. The
validation error was all the time:
VdtTypeError('the value "[\'mplayer -slave -vc null -vo null
{file}\']" is of the wrong type.',)
I was thinking that if the validator would say what type it expected
and what it got, I would have seen the comma a lot faster. Maybe the
exceptions could say that?
Then one extra question... Is it possible to put defaults into
[__many__] subsections? I'm wondering what's the best solution to
configure cplay (a curses frontend to audio players). It needs some
config information about what cli players to use, and what command to
give them. There's a varying amount (different players for different
file types, though mplayer plays them all), but I'd like to put some
default players in there (mplayer, ogg123, mpg123 etc).
--
Tomi Pieviläinen, +358 400 487 504
A: Because it disrupts the natural way of thinking.
Q: Why is top posting frowned upon?
|
|
From: Michael F. <fuz...@vo...> - 2011-06-25 19:36:44
|
On 20/06/2011 15:49, Nicolas Michel wrote:
> Hello,
>
> I have a problem understanding subsections with configobj.
>
> Here is the structure of my config file :
>
> [__main_section_1__]
> key1 = string
> key2 = string
> key3 = string
> [[__subsection_1__]]
> sub_key_1 = string
> sub_key_2 = string
>
> (So there is an unlimited number of main section in which I have some
> subsections ; at least one subsection by main section)
>
> What I need to do is a loop on each subsection to do some job. I can't
> do it (I'm new with Python so please excuse me if my question seems silly).
>
> something like :
> for subsections in main_section:
> my_code
>
> Here is a structure sample of my current config file :
>
> ConfigObj({'opghl': {'acc_user': 'openerp', 'prod_user': 'openerp',
> 'acc_host': 'ghl-dev.lan.pcsol.be', 'db_prod': {'prod_db_name': 'ghl',
> 'acc_db_name': 'ghl'}, 'db_prod_2': {'prod_db_name': 'ghl2',
> 'acc_db_name': 'ghl2'}}, 'test': {'acc_user': 'openerp-test',
> 'prod_user': 'openerp-test', 'acc_host': 'test-dev.lan.pcsol.be',
> 'db_prod-test': {'prod_db_name': 'ghl-test', 'acc_db_name': 'ghl-test'},
> 'db_prod_2-test': {'prod_db_name': 'ghl2-test', 'acc_db_name':
> 'ghl2-test'}}})
>
> ==> I would want to list all the subsection of opghl or test. In that
> case it would be
> - for opghl : db_prod and db_prod_2
> - for test : db_prod-test, db_prod_2-test
>
Hello Nicolas,
Sorry for the late reply. You can tell what sub-sections are in a
section with the '.sections' attribute. This is a list of strings that
you can loop over.
Here's an example:
>>> from configobj import ConfigObj
>>> c = ConfigObj({'opghl': {'acc_user': 'openerp', 'prod_user':
'openerp',
... 'acc_host': 'ghl-dev.lan.pcsol.be', 'db_prod': {'prod_db_name': 'ghl',
... 'acc_db_name': 'ghl'}, 'db_prod_2': {'prod_db_name': 'ghl2',
... 'acc_db_name': 'ghl2'}}, 'test': {'acc_user': 'openerp-test',
... 'prod_user': 'openerp-test', 'acc_host': 'test-dev.lan.pcsol.be',
... 'db_prod-test': {'prod_db_name': 'ghl-test', 'acc_db_name':
'ghl-test'},
... 'db_prod_2-test': {'prod_db_name': 'ghl2-test', 'acc_db_name':
... 'ghl2-test'}}})
>>> c.sections
['test', 'opghl']
>>> test = c['test']
>>> test.sections
['db_prod_2-test', 'db_prod-test']
>>> for section in test.sections:
... print test[section]
...
{'acc_db_name': 'ghl2-test', 'prod_db_name': 'ghl2-test'}
{'acc_db_name': 'ghl-test', 'prod_db_name': 'ghl-test'}
The '.sections' attribute is documented here:
http://www.voidspace.org.uk/python/configobj.html#section-attributes
I hope this is helpful.
All the best,
Michael Foord
> Thank you a lot for your help!
> sylock
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
--
http://www.voidspace.org.uk/
May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
|
|
From: Nicolas M. <nic...@le...> - 2011-06-20 15:29:46
|
I just find the answer by reading this : http://www.voidspace.org.uk/python/articles/configobj_for_data_persistence.shtml#creating-a-configspec So here is what I did : for sub in (keys for keys in config['opghl'] if isinstance(config['opghl'][keys],dict)): print sub Then it prints me : db_prod db_prod_2 (See my first mail below) But I was wondering if you can't implement a method to do it more easily or maybe to document it better in the official doc : http://www.voidspace.org.uk/python/configobj.html Is this the better way to achieve mu goal? Or there is a more pythonic way? Regards, sylock On 06/20/2011 04:49 PM, Nicolas Michel wrote: > Hello, > > I have a problem understanding subsections with configobj. > > Here is the structure of my config file : > > [__main_section_1__] > key1 = string > key2 = string > key3 = string > [[__subsection_1__]] > sub_key_1 = string > sub_key_2 = string > > (So there is an unlimited number of main section in which I have some > subsections ; at least one subsection by main section) > > What I need to do is a loop on each subsection to do some job. I can't > do it (I'm new with Python so please excuse me if my question seems silly). > > something like : > for subsections in main_section: > my_code > > Here is a structure sample of my current config file : > > ConfigObj({'opghl': {'acc_user': 'openerp', 'prod_user': 'openerp', > 'acc_host': 'ghl-dev.lan.pcsol.be', 'db_prod': {'prod_db_name': 'ghl', > 'acc_db_name': 'ghl'}, 'db_prod_2': {'prod_db_name': 'ghl2', > 'acc_db_name': 'ghl2'}}, 'test': {'acc_user': 'openerp-test', > 'prod_user': 'openerp-test', 'acc_host': 'test-dev.lan.pcsol.be', > 'db_prod-test': {'prod_db_name': 'ghl-test', 'acc_db_name': 'ghl-test'}, > 'db_prod_2-test': {'prod_db_name': 'ghl2-test', 'acc_db_name': > 'ghl2-test'}}}) > > ==> I would want to list all the subsection of opghl or test. In that > case it would be > - for opghl : db_prod and db_prod_2 > - for test : db_prod-test, db_prod_2-test > > Thank you a lot for your help! > sylock > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop |
|
From: Nicolas M. <nic...@le...> - 2011-06-20 15:16:45
|
Hello,
I have a problem understanding subsections with configobj.
Here is the structure of my config file :
[__main_section_1__]
key1 = string
key2 = string
key3 = string
[[__subsection_1__]]
sub_key_1 = string
sub_key_2 = string
(So there is an unlimited number of main section in which I have some
subsections ; at least one subsection by main section)
What I need to do is a loop on each subsection to do some job. I can't
do it (I'm new with Python so please excuse me if my question seems silly).
something like :
for subsections in main_section:
my_code
Here is a structure sample of my current config file :
ConfigObj({'opghl': {'acc_user': 'openerp', 'prod_user': 'openerp',
'acc_host': 'ghl-dev.lan.pcsol.be', 'db_prod': {'prod_db_name': 'ghl',
'acc_db_name': 'ghl'}, 'db_prod_2': {'prod_db_name': 'ghl2',
'acc_db_name': 'ghl2'}}, 'test': {'acc_user': 'openerp-test',
'prod_user': 'openerp-test', 'acc_host': 'test-dev.lan.pcsol.be',
'db_prod-test': {'prod_db_name': 'ghl-test', 'acc_db_name': 'ghl-test'},
'db_prod_2-test': {'prod_db_name': 'ghl2-test', 'acc_db_name':
'ghl2-test'}}})
==> I would want to list all the subsection of opghl or test. In that
case it would be
- for opghl : db_prod and db_prod_2
- for test : db_prod-test, db_prod_2-test
Thank you a lot for your help!
sylock
|
|
From: Michael F. <fuz...@vo...> - 2011-05-02 22:28:46
|
On 02/05/2011 23:02, L. Canessa wrote: > Michael, > > It's quite all right on the late reply. I actually much prefer to find > a solution myself, but I just wanted to check to see what other people > with more experience with the library had done. > > What I ended up doing is to only validate based on the common + > version section, and ignore the rest. The first key in the [common] > section is "version", this allows me to easily pull the version number > out. So when I pass the configuration object to the validator to be > validated, I preserve errors, and subsequently only pay attention to > errors that are in the [common] or [.1] section (if version is .1). > Thus, I always fail validation, but I only check to see if the common > + version in question failed or passed. > > It's not as clean as I would like; but it works. > > Do you / anyone else see multiple configspec versions as a worthwhile > addition to the library? > I think it would add complexity for a reasonably rare use case (and I suspect that different use cases would want different ways of specifying the version to use, so there isn't necessarily a "one size fits all" solution). It probably wouldn't be *very* hard to add it as a separate function or set of functions built on top of the validate library. You can look at the ConfigObj.validate method to see how the standard validation is implemented. All the best, Michael Foord > Thanks, > Leonardo > > > On Mon, May 2, 2011 at 5:40 PM, Michael Foord > <fuz...@vo... <mailto:fuz...@vo...>> wrote: > > On 07/04/2011 18:07, L. Canessa wrote: >> Hello all, >> >> I wanted to make one configuration specification file for >> multiple versions of the configspec. That way as the requirements >> of the configspec change, only one configspec has to be updated >> and it will still work with the old and new specs. >> >> Right now I have the configspec in the following format: >> >> specVersion = float(min=0.0) >> >> # Common among all versions >> [common] >> id = integer(min=0) >> ... >> >> # Specific to Spec Version .2 >> [.2] >> width = integer() >> >> #specific to spec version .1 >> [.1] >> height = integer() >> >> >> The issue I have is that I don't think I can write a custom >> validate function to only validate the needed sections. >> Is it not possible for me to do this? Will I just have to make >> different configspec files and load them based on what >> specVersion is? >> > > Hello Leonardo, > > Sorry for the late reply. My daughter has just been born so life > has been kind of hectic recently. > > ConfigObj has no support for multiple configspec versions, so I > think you'll need several different configspec files and select > them depending on which version you need (as you suggest). > > All the best, > > Michael Foord > >> Does this even make sense?! >> >> Thank you for your help, >> Leonardo >> >> >> ------------------------------------------------------------------------------ >> Xperia(TM) PLAY >> It's a major breakthrough. An authentic gaming >> smartphone on the nation's most reliable network. >> And it wants your games. >> http://p.sf.net/sfu/verizon-sfdev >> >> >> _______________________________________________ >> Configobj-develop mailing list >> Con...@li... <mailto:Con...@li...> >> https://lists.sourceforge.net/lists/listinfo/configobj-develop > > > -- > http://www.voidspace.org.uk/ > > May you do good and not evil > May you find forgiveness for yourself and forgive others > May you share freely, never taking more than you give. > -- the sqlite blessinghttp://www.sqlite.org/different.html > > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html |
|
From: Michael F. <fuz...@vo...> - 2011-05-02 22:08:50
|
On 07/04/2011 18:07, L. Canessa wrote: > Hello all, > > I wanted to make one configuration specification file for multiple > versions of the configspec. That way as the requirements of the > configspec change, only one configspec has to be updated and it will > still work with the old and new specs. > > Right now I have the configspec in the following format: > > specVersion = float(min=0.0) > > # Common among all versions > [common] > id = integer(min=0) > ... > > # Specific to Spec Version .2 > [.2] > width = integer() > > #specific to spec version .1 > [.1] > height = integer() > > > The issue I have is that I don't think I can write a custom validate > function to only validate the needed sections. > Is it not possible for me to do this? Will I just have to make > different configspec files and load them based on what specVersion is? > Hello Leonardo, Sorry for the late reply. My daughter has just been born so life has been kind of hectic recently. ConfigObj has no support for multiple configspec versions, so I think you'll need several different configspec files and select them depending on which version you need (as you suggest). All the best, Michael Foord > Does this even make sense?! > > Thank you for your help, > Leonardo > > > ------------------------------------------------------------------------------ > Xperia(TM) PLAY > It's a major breakthrough. An authentic gaming > smartphone on the nation's most reliable network. > And it wants your games. > http://p.sf.net/sfu/verizon-sfdev > > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html |
|
From: L. C. <l.c...@gm...> - 2011-05-02 22:02:28
|
Michael, It's quite all right on the late reply. I actually much prefer to find a solution myself, but I just wanted to check to see what other people with more experience with the library had done. What I ended up doing is to only validate based on the common + version section, and ignore the rest. The first key in the [common] section is "version", this allows me to easily pull the version number out. So when I pass the configuration object to the validator to be validated, I preserve errors, and subsequently only pay attention to errors that are in the [common] or [.1] section (if version is .1). Thus, I always fail validation, but I only check to see if the common + version in question failed or passed. It's not as clean as I would like; but it works. Do you / anyone else see multiple configspec versions as a worthwhile addition to the library? Thanks, Leonardo On Mon, May 2, 2011 at 5:40 PM, Michael Foord <fuz...@vo...>wrote: > On 07/04/2011 18:07, L. Canessa wrote: > > Hello all, > > I wanted to make one configuration specification file for multiple versions > of the configspec. That way as the requirements of the configspec change, > only one configspec has to be updated and it will still work with the old > and new specs. > > Right now I have the configspec in the following format: > >> specVersion = float(min=0.0) >> >> # Common among all versions >> [common] >> id = integer(min=0) >> ... >> >> # Specific to Spec Version .2 >> [.2] >> width = integer() >> >> #specific to spec version .1 >> [.1] >> height = integer() >> > > The issue I have is that I don't think I can write a custom validate > function to only validate the needed sections. > Is it not possible for me to do this? Will I just have to make different > configspec files and load them based on what specVersion is? > > > Hello Leonardo, > > Sorry for the late reply. My daughter has just been born so life has been > kind of hectic recently. > > ConfigObj has no support for multiple configspec versions, so I think > you'll need several different configspec files and select them depending on > which version you need (as you suggest). > > All the best, > > Michael Foord > > Does this even make sense?! > > Thank you for your help, > Leonardo > > > ------------------------------------------------------------------------------ > Xperia(TM) PLAY > It's a major breakthrough. An authentic gaming > smartphone on the nation's most reliable network. > And it wants your games.http://p.sf.net/sfu/verizon-sfdev > > > _______________________________________________ > Configobj-develop mailing lis...@li...://lists.sourceforge.net/lists/listinfo/configobj-develop > > > > -- http://www.voidspace.org.uk/ > > May you do good and not evil > May you find forgiveness for yourself and forgive others > May you share freely, never taking more than you give. > -- the sqlite blessing http://www.sqlite.org/different.html > > |
|
From: Lawrence A. <la...@gm...> - 2011-04-20 22:04:38
|
Because arrays make it easy to use the data
eg
# Create max min arrays
self.max_data = np.maximum(y_data, self.max_data)
self.min_data = np.minimum(y_data, self.min_data)
instead of
# Create max min lists
for i in range(0, 601):
if float(y_list[i]) < float(self.min_list[i]):
self.min_list[i] = y_list[i]
if float(y_list[i]) > float(self.max_list[i]):
self.max_list[i] = y_list[i]
There is a numpy tolist() also.. I didn't know that. Thanks.
Lawrie
On Thu, Apr 21, 2011 at 5:50 AM, L. Canessa <l.c...@gm...> wrote:
> Why are you using an array anyways?
> Array has a built in function to do so. It's array.tolist(), there's also
> array.fromlist(LIST), check the docs:
> http://docs.python.org/library/array.html
>
> This is assuming you are using the reg python array and not the NumPy array.
> Leonardo
>
>
> On Wed, Apr 20, 2011 at 5:41 PM, Lawrence Abbott <la...@gm...> wrote:
>>
>> It seems you are correct. If I convert the array (which is one
>> dimensional) to a list then I can read and write. Its a little clumsy
>> but will do for now.. unless someone wants to add array support :)
>>
>> Lawrie
>>
>> On Thu, Apr 21, 2011 at 5:02 AM, L. Canessa <l.c...@gm...> wrote:
>> > As far as I know, Configobj doesn't handle arrays. It does handle lists
>> > though.
>> > I am by no means an expert.
>> >
>> > Take a quick read through configobj.py.
>> >
>> > Leonardo
>> >
>> >
>> > On Wed, Apr 20, 2011 at 4:19 PM, Lawrence Abbott <la...@gm...>
>> > wrote:
>> >>
>> >> Hi, I've need to add an array to the end af my configobj file but am
>> >> getting an error when I try and read back. line 19 is line starting
>> >> with DATA . Does configobj handle arrays?
>> >>
>> >>
>> >> configobj.UnreprError: Unknown name or type in value at line 19.
>> >>
>> >> ---cut---
>> >> [INFO]
>> >> Customer = 'Customer'
>> >> Site = 'Site'
>> >> Satellite = 'Satellite'
>> >> Transponder = 'Transponder'
>> >> CarrierDB = 'CXxxxx'
>> >> Comment = 'Add comment here'
>> >> [PLOT_DATA]
>> >> [[11-04-21_04:05]]
>> >> DATA = array([-84.06, -84.26, -83.96, -83.76, -84.8 , -84.06, -84.03,
>> >> -83.83,
>> >> -84.03, -83.96, -84.1 , -84.16, -84.23, -84.26, -84.13, -83.6 ,
>> >> -83.9 , -83.63, -83.9 , -83.8 , -83.96, -84.5 , -84. , -84.2 ,
>> >> -83.96, -83.96, -83.96, -84. , -84.03, -84.36, -83.9 , -84. ,
>> >> -84. , -83.5 , -83.86, -84.13, -83.96, -84.23, -84.3 , -84. ,
>> >> -83.66, -83.6 , -84. , -84.7 , -84.2 , -83.93, -84.2 , -84.26,
>> >> ---cut---
>> >>
>> >>
>> >>
>> >> ------------------------------------------------------------------------------
>> >> Benefiting from Server Virtualization: Beyond Initial Workload
>> >> Consolidation -- Increasing the use of server virtualization is a top
>> >> priority.Virtualization can reduce costs, simplify management, and
>> >> improve
>> >> application availability and disaster protection. Learn more about
>> >> boosting
>> >> the value of server virtualization.
>> >> http://p.sf.net/sfu/vmware-sfdev2dev
>> >> _______________________________________________
>> >> Configobj-develop mailing list
>> >> Con...@li...
>> >> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>> >
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Benefiting from Server Virtualization: Beyond Initial Workload
>> > Consolidation -- Increasing the use of server virtualization is a top
>> > priority.Virtualization can reduce costs, simplify management, and
>> > improve
>> > application availability and disaster protection. Learn more about
>> > boosting
>> > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
>> > _______________________________________________
>> > Configobj-develop mailing list
>> > Con...@li...
>> > https://lists.sourceforge.net/lists/listinfo/configobj-develop
>> >
>> >
>>
>>
>> ------------------------------------------------------------------------------
>> Benefiting from Server Virtualization: Beyond Initial Workload
>> Consolidation -- Increasing the use of server virtualization is a top
>> priority.Virtualization can reduce costs, simplify management, and improve
>> application availability and disaster protection. Learn more about
>> boosting
>> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
>> _______________________________________________
>> Configobj-develop mailing list
>> Con...@li...
>> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
>
> ------------------------------------------------------------------------------
> Benefiting from Server Virtualization: Beyond Initial Workload
> Consolidation -- Increasing the use of server virtualization is a top
> priority.Virtualization can reduce costs, simplify management, and improve
> application availability and disaster protection. Learn more about boosting
> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
>
|
|
From: L. C. <l.c...@gm...> - 2011-04-20 21:50:32
|
Why are you using an array anyways? Array has a built in function to do so. It's array.tolist(), there's also array.fromlist(LIST), check the docs: http://docs.python.org/library/array.html This is assuming you are using the reg python array and not the NumPy array. Leonardo On Wed, Apr 20, 2011 at 5:41 PM, Lawrence Abbott <la...@gm...> wrote: > It seems you are correct. If I convert the array (which is one > dimensional) to a list then I can read and write. Its a little clumsy > but will do for now.. unless someone wants to add array support :) > > Lawrie > > On Thu, Apr 21, 2011 at 5:02 AM, L. Canessa <l.c...@gm...> wrote: > > As far as I know, Configobj doesn't handle arrays. It does handle lists > > though. > > I am by no means an expert. > > > > Take a quick read through configobj.py. > > > > Leonardo > > > > > > On Wed, Apr 20, 2011 at 4:19 PM, Lawrence Abbott <la...@gm...> > wrote: > >> > >> Hi, I've need to add an array to the end af my configobj file but am > >> getting an error when I try and read back. line 19 is line starting > >> with DATA . Does configobj handle arrays? > >> > >> > >> configobj.UnreprError: Unknown name or type in value at line 19. > >> > >> ---cut--- > >> [INFO] > >> Customer = 'Customer' > >> Site = 'Site' > >> Satellite = 'Satellite' > >> Transponder = 'Transponder' > >> CarrierDB = 'CXxxxx' > >> Comment = 'Add comment here' > >> [PLOT_DATA] > >> [[11-04-21_04:05]] > >> DATA = array([-84.06, -84.26, -83.96, -83.76, -84.8 , -84.06, -84.03, > >> -83.83, > >> -84.03, -83.96, -84.1 , -84.16, -84.23, -84.26, -84.13, -83.6 , > >> -83.9 , -83.63, -83.9 , -83.8 , -83.96, -84.5 , -84. , -84.2 , > >> -83.96, -83.96, -83.96, -84. , -84.03, -84.36, -83.9 , -84. , > >> -84. , -83.5 , -83.86, -84.13, -83.96, -84.23, -84.3 , -84. , > >> -83.66, -83.6 , -84. , -84.7 , -84.2 , -83.93, -84.2 , -84.26, > >> ---cut--- > >> > >> > >> > ------------------------------------------------------------------------------ > >> Benefiting from Server Virtualization: Beyond Initial Workload > >> Consolidation -- Increasing the use of server virtualization is a top > >> priority.Virtualization can reduce costs, simplify management, and > improve > >> application availability and disaster protection. Learn more about > >> boosting > >> the value of server virtualization. > http://p.sf.net/sfu/vmware-sfdev2dev > >> _______________________________________________ > >> Configobj-develop mailing list > >> Con...@li... > >> https://lists.sourceforge.net/lists/listinfo/configobj-develop > > > > > > > ------------------------------------------------------------------------------ > > Benefiting from Server Virtualization: Beyond Initial Workload > > Consolidation -- Increasing the use of server virtualization is a top > > priority.Virtualization can reduce costs, simplify management, and > improve > > application availability and disaster protection. Learn more about > boosting > > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > > _______________________________________________ > > Configobj-develop mailing list > > Con...@li... > > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > > > > > > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > |
|
From: Lawrence A. <la...@gm...> - 2011-04-20 21:41:43
|
It seems you are correct. If I convert the array (which is one dimensional) to a list then I can read and write. Its a little clumsy but will do for now.. unless someone wants to add array support :) Lawrie On Thu, Apr 21, 2011 at 5:02 AM, L. Canessa <l.c...@gm...> wrote: > As far as I know, Configobj doesn't handle arrays. It does handle lists > though. > I am by no means an expert. > > Take a quick read through configobj.py. > > Leonardo > > > On Wed, Apr 20, 2011 at 4:19 PM, Lawrence Abbott <la...@gm...> wrote: >> >> Hi, I've need to add an array to the end af my configobj file but am >> getting an error when I try and read back. line 19 is line starting >> with DATA . Does configobj handle arrays? >> >> >> configobj.UnreprError: Unknown name or type in value at line 19. >> >> ---cut--- >> [INFO] >> Customer = 'Customer' >> Site = 'Site' >> Satellite = 'Satellite' >> Transponder = 'Transponder' >> CarrierDB = 'CXxxxx' >> Comment = 'Add comment here' >> [PLOT_DATA] >> [[11-04-21_04:05]] >> DATA = array([-84.06, -84.26, -83.96, -83.76, -84.8 , -84.06, -84.03, >> -83.83, >> -84.03, -83.96, -84.1 , -84.16, -84.23, -84.26, -84.13, -83.6 , >> -83.9 , -83.63, -83.9 , -83.8 , -83.96, -84.5 , -84. , -84.2 , >> -83.96, -83.96, -83.96, -84. , -84.03, -84.36, -83.9 , -84. , >> -84. , -83.5 , -83.86, -84.13, -83.96, -84.23, -84.3 , -84. , >> -83.66, -83.6 , -84. , -84.7 , -84.2 , -83.93, -84.2 , -84.26, >> ---cut--- >> >> >> ------------------------------------------------------------------------------ >> Benefiting from Server Virtualization: Beyond Initial Workload >> Consolidation -- Increasing the use of server virtualization is a top >> priority.Virtualization can reduce costs, simplify management, and improve >> application availability and disaster protection. Learn more about >> boosting >> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev >> _______________________________________________ >> Configobj-develop mailing list >> Con...@li... >> https://lists.sourceforge.net/lists/listinfo/configobj-develop > > > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > |
|
From: L. C. <l.c...@gm...> - 2011-04-20 21:02:44
|
As far as I know, Configobj doesn't handle arrays. It does handle lists though. I am by no means an expert. Take a quick read through configobj.py. Leonardo On Wed, Apr 20, 2011 at 4:19 PM, Lawrence Abbott <la...@gm...> wrote: > Hi, I've need to add an array to the end af my configobj file but am > getting an error when I try and read back. line 19 is line starting > with DATA . Does configobj handle arrays? > > > configobj.UnreprError: Unknown name or type in value at line 19. > > ---cut--- > [INFO] > Customer = 'Customer' > Site = 'Site' > Satellite = 'Satellite' > Transponder = 'Transponder' > CarrierDB = 'CXxxxx' > Comment = 'Add comment here' > [PLOT_DATA] > [[11-04-21_04:05]] > DATA = array([-84.06, -84.26, -83.96, -83.76, -84.8 , -84.06, -84.03, > -83.83, > -84.03, -83.96, -84.1 , -84.16, -84.23, -84.26, -84.13, -83.6 , > -83.9 , -83.63, -83.9 , -83.8 , -83.96, -84.5 , -84. , -84.2 , > -83.96, -83.96, -83.96, -84. , -84.03, -84.36, -83.9 , -84. , > -84. , -83.5 , -83.86, -84.13, -83.96, -84.23, -84.3 , -84. , > -83.66, -83.6 , -84. , -84.7 , -84.2 , -83.93, -84.2 , -84.26, > ---cut--- > > > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > |
|
From: Lawrence A. <la...@gm...> - 2011-04-20 20:20:01
|
Hi, I've need to add an array to the end af my configobj file but am
getting an error when I try and read back. line 19 is line starting
with DATA . Does configobj handle arrays?
configobj.UnreprError: Unknown name or type in value at line 19.
---cut---
[INFO]
Customer = 'Customer'
Site = 'Site'
Satellite = 'Satellite'
Transponder = 'Transponder'
CarrierDB = 'CXxxxx'
Comment = 'Add comment here'
[PLOT_DATA]
[[11-04-21_04:05]]
DATA = array([-84.06, -84.26, -83.96, -83.76, -84.8 , -84.06, -84.03, -83.83,
-84.03, -83.96, -84.1 , -84.16, -84.23, -84.26, -84.13, -83.6 ,
-83.9 , -83.63, -83.9 , -83.8 , -83.96, -84.5 , -84. , -84.2 ,
-83.96, -83.96, -83.96, -84. , -84.03, -84.36, -83.9 , -84. ,
-84. , -83.5 , -83.86, -84.13, -83.96, -84.23, -84.3 , -84. ,
-83.66, -83.6 , -84. , -84.7 , -84.2 , -83.93, -84.2 , -84.26,
---cut---
|
|
From: L. C. <l.c...@gm...> - 2011-04-07 17:07:41
|
Hello all, I wanted to make one configuration specification file for multiple versions of the configspec. That way as the requirements of the configspec change, only one configspec has to be updated and it will still work with the old and new specs. Right now I have the configspec in the following format: > specVersion = float(min=0.0) > > # Common among all versions > [common] > id = integer(min=0) > ... > > # Specific to Spec Version .2 > [.2] > width = integer() > > #specific to spec version .1 > [.1] > height = integer() > The issue I have is that I don't think I can write a custom validate function to only validate the needed sections. Is it not possible for me to do this? Will I just have to make different configspec files and load them based on what specVersion is? Does this even make sense?! Thank you for your help, Leonardo |
|
From: Helmut G. <h.g...@cy...> - 2011-03-01 13:11:13
|
Hi, On Mon, Feb 28, 2011 at 11:20:21PM +0200, Stefan Parviainen wrote: > On Mon, Feb 28, 2011 at 5:28 PM, Helmut Grohne > <h.g...@cy...> wrote: > > I tried this using the following example. > [...] > > The expected outcome would be False, because spam is "not an integer". > > The observed outcome in contrast is True. > > The code works for me with configobj-4.7.2: it prints False as expected. You are correct. I thought that I did try 4.7.2, but my sys.path was messed up. Just the system version 4.5.2 (of Debian Lenny) is affected. Thanks for pointing out Helmut |
|
From: Stefan P. <pa...@ik...> - 2011-02-28 21:20:28
|
On Mon, Feb 28, 2011 at 5:28 PM, Helmut Grohne <h.g...@cy...> wrote: > I tried this using the following example. [...] > The expected outcome would be False, because spam is "not an integer". > The observed outcome in contrast is True. The code works for me with configobj-4.7.2: it prints False as expected. -- Stefan Parviainen |
|
From: Helmut G. <h.g...@cy...> - 2011-02-28 15:45:59
|
Hi,
Please CC me in a reply, because I am not subscribed to the mailing
list.
The documentation section 5.1.2.3[1] explains how to force all values of a
section to have the same type.
I tried this using the following example.
***snip***
import configobj
import validate
spec = configobj.ConfigObj("""
[test]
__many__ = integer
""".splitlines(), interpolation=False, list_values=False)
config = configobj.ConfigObj("""
[test]
spam = not an integer
""".splitlines(), configspec=spec)
print config.validate(validate.Validator())
***snip***
The expected outcome would be False, because spam is "not an integer".
The observed outcome in contrast is True. Changing __many__ to spam
gives the expected outcome False.
So what is wrong here?
Helmut
[1] http://www.voidspace.org.uk/python/configobj.html#id43
|