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: David H. <neg...@gm...> - 2011-01-03 15:27:06
|
I had posted some thoughts awhile back regarding generalization of the list API. It doesn't necessarily directly address all of the things that Stefan is saying, but I think it factors into the discussion: On Fri, Jul 17, 2009 at 12:41, David Hostetler <neg...@gm...> 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. I do still have that on my queue of stuff to do. Eventually. :) regards, -hoss David Hostetler neg...@gm... |
|
From: Michael F. <fuz...@vo...> - 2011-01-03 14:49:55
|
On 03/01/2011 14:41, Stefan Parviainen wrote:
> On Mon, Jan 3, 2011 at 3:37 PM, Michael Foord<fuz...@vo...> wrote:
>>> This would also solve problems with inconsistent naming (integer vs.
>>> int_list types). The old types could be kept for backwards compatibility.
>> This sounds like a good change.
> I can take a stab at it myself if you are busy/not interested in doing
> it yourself.
>
Tested patch with documentation stands a much better chance of making it
into a release than leaving it to me... :-)
>> Note that in issue 26 values will *already* have been converted to lists if
>> they are in list format - so doing an *additional* split on ',' is
>> incorrect. For example this single string does *not* represent a list:
>>
>> value = "something, with, commas"
> Well, I think that string does represent a list :-) And so does
> ConfigObj in some cases. Consider the following:
>
> import configobj, validate
> spec_str = """
> a = list
> b = integer
> """
> conf_str = """
> a = 1, 2
> b = 0
> """
> spec = configobj.ConfigObj(spec_str.split('\n'))
> conf = configobj.ConfigObj(conf_str.split('\n'), configspec=spec)
>
> conf.validate(validate.Validator())
>
> print type(conf['a']), conf['a']
> print type(conf['b']), conf['b']
>
> conf['a'] = '1, 2'
> conf['b'] = '0'
>
> res = conf.validate(validate.Validator())
>
> print type(conf['a']), conf['a']
> print type(conf['b']), conf['b']
>
> ---
> The above outputs:
> <type 'list'> ['1', '2']
> <type 'int'> 0
> <type 'str'> 1, 2
> <type 'int'> 0
>
> So when parsing the config file "1,2" is indeed interpreted as a list,
No. 1,2 without quotes is a list. "1,2" with quotes is a string that
happens to contain a comma.
The specified behaviour of ConfigObj and validate interaction is that
list values should have already been parsed into a list *before* being
validated - so the validation code must honour this. Otherwise, as I
indicated, string values that contain commas can be incorrectly split
into lists.
> but when "1,2" is assigned as a string it fails. Note that with the
> integer type, it succeeds in both cases. I expect that assigning a
> string with the same content as I would write in the config file would
> result in the same values after validation. It does not, which is
> confusing at least to me. I don't see a problem with splitting a
> string when it is assigned to something expecting a list. This is
> probably what the user wants anyway. Currently nothing sensible at all
> happens (you end up with a string where you are expecting a list!).
>
The list validation when a list is not supplied is not ideal - that is
why I said your API suggestion was a good one. However quoted strings
can contain commas that don't represent lists which is why your
suggestion of always splitting on commas is bad.
> There is the force_list type, which kind of solves the problem (in a
> bad way IMHO), by converting the string to a list with a single item.
> But why is a string properly converted to an int, while a string is
> only converted to a list if force_list is used? Why is there no
> force_int?
What would be the use case of force_int? I don't really understand your
point here.
> In summary: It is terribly confusing when I can't use the same syntax
> when assigning as I can when writing config files.
>
This is a different issue though. A ConfigObj instance will have
*already* parsed list values. If you want a list value then assign a
list. (Note that if you assign a value to the string "1,2" (without the
quotes in the string itself) then ConfigObj will put quotes round it
when it writes so that it is *not* read back in as a list.
Alternatively, it sounds like a reasonable feature request to ask for a
method to parse a string using the ConfigObj syntax rules - so that you
can use ConfigObj syntax for assigning strings.
All the best,
Michael Foord
--
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: Stefan P. <pa...@ik...> - 2011-01-03 14:41:32
|
On Mon, Jan 3, 2011 at 3:37 PM, Michael Foord <fuz...@vo...> wrote:
>> This would also solve problems with inconsistent naming (integer vs.
>> int_list types). The old types could be kept for backwards compatibility.
> This sounds like a good change.
I can take a stab at it myself if you are busy/not interested in doing
it yourself.
> Note that in issue 26 values will *already* have been converted to lists if
> they are in list format - so doing an *additional* split on ',' is
> incorrect. For example this single string does *not* represent a list:
>
> value = "something, with, commas"
Well, I think that string does represent a list :-) And so does
ConfigObj in some cases. Consider the following:
import configobj, validate
spec_str = """
a = list
b = integer
"""
conf_str = """
a = 1, 2
b = 0
"""
spec = configobj.ConfigObj(spec_str.split('\n'))
conf = configobj.ConfigObj(conf_str.split('\n'), configspec=spec)
conf.validate(validate.Validator())
print type(conf['a']), conf['a']
print type(conf['b']), conf['b']
conf['a'] = '1, 2'
conf['b'] = '0'
res = conf.validate(validate.Validator())
print type(conf['a']), conf['a']
print type(conf['b']), conf['b']
---
The above outputs:
<type 'list'> ['1', '2']
<type 'int'> 0
<type 'str'> 1, 2
<type 'int'> 0
So when parsing the config file "1,2" is indeed interpreted as a list,
but when "1,2" is assigned as a string it fails. Note that with the
integer type, it succeeds in both cases. I expect that assigning a
string with the same content as I would write in the config file would
result in the same values after validation. It does not, which is
confusing at least to me. I don't see a problem with splitting a
string when it is assigned to something expecting a list. This is
probably what the user wants anyway. Currently nothing sensible at all
happens (you end up with a string where you are expecting a list!).
There is the force_list type, which kind of solves the problem (in a
bad way IMHO), by converting the string to a list with a single item.
But why is a string properly converted to an int, while a string is
only converted to a list if force_list is used? Why is there no
force_int?
In summary: It is terribly confusing when I can't use the same syntax
when assigning as I can when writing config files.
--
Stefan Parviainen
|
|
From: Michael F. <fuz...@vo...> - 2011-01-03 13:37:56
|
On 26/12/2010 11:49, Stefan Parviainen wrote: > I've noticed some issues with how list types are handled in Validate. > There are several different list types, including, int_list for > integers, string_list for strings, etc. IMHO the list handling could > be generalized to be much more useful. > > Right now there is no easy way to declare a list of e.g. integers with > min and max values. You could declare a completely new type, > "list_of_ints_min_0_max_10" but in practice it's not really feasible. > It's also not easily possible to declare a list containing some custom > type. > > I think an optional argument, type, should be added to the list type, > so something like this would be possible: > > list(type=int(min=0,max=10), min=1, max=2) > > This would also solve problems with inconsistent naming (integer vs. > int_list types). The old types could be kept for backwards > compatibility. This sounds like a good change. > I've reported one issue related to lists, and three other issues (some > with patches) to the Google Code issue tracker at > http://code.google.com/p/configobj/issues/ but have not gotten any > reaction to them. Is the Google Code tracker the correct place to > report bugs? If not, could this be clarified somewhere? > Google code tracker is the correct place. I'm not using ConfigObj a great deal myself at the moment so don't have much spare time to work on it. I will eventually get to it though. I see you submitted a patch along with issue 26, but no tests. Patches with tests and documentation are likely to get applied *much* sooner. :-) Note that in issue 26 values will *already* have been converted to lists if they are in list format - so doing an *additional* split on ',' is incorrect. For example this single string does *not* represent a list: value = "something, with, commas" I'm really not sure about issue 19 - only supporting # for comments was a deliberate design decision and in general I'm against making the configobj API more complex. Issue 3 has been merged into the Python 3 port. Other than these it looks like most issues could be resolved in a new release. All the best, Michael Foord -- 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: Stefan P. <pa...@ik...> - 2010-12-26 11:49:41
|
I've noticed some issues with how list types are handled in Validate. There are several different list types, including, int_list for integers, string_list for strings, etc. IMHO the list handling could be generalized to be much more useful. Right now there is no easy way to declare a list of e.g. integers with min and max values. You could declare a completely new type, "list_of_ints_min_0_max_10" but in practice it's not really feasible. It's also not easily possible to declare a list containing some custom type. I think an optional argument, type, should be added to the list type, so something like this would be possible: list(type=int(min=0,max=10), min=1, max=2) This would also solve problems with inconsistent naming (integer vs. int_list types). The old types could be kept for backwards compatibility. I've reported one issue related to lists, and three other issues (some with patches) to the Google Code issue tracker at http://code.google.com/p/configobj/issues/ but have not gotten any reaction to them. Is the Google Code tracker the correct place to report bugs? If not, could this be clarified somewhere? -- Stefan Parviainen |
|
From: Michael F. <fuz...@vo...> - 2010-12-15 23:22:28
|
Hey Stefan, Wow, that's great! Nice work. All the best, Michael On 15/12/2010 22:06, Stefan Parviainen wrote: > Hi all, > > I made a graphical interface for editing configobj-based configs in my > own graphical applications and I thought it might be useful for others > as well. > It's made using PyQt so probably your application also needs to use > this toolkit, although I guess it's theoretically possible to mix Qt > and GTK+ code nowadays. > The code should work on all platforms where PyQt works (Linux, > Windows, MacOS X, ...) > > The project can be found at https://github.com/pafcu/ConfigObj-GUI. > > Currently the editor looks like this: > https://github.com/pafcu/ConfigObj-GUI/wiki/Screenshots > > An example program: > > import sys > from PyQt4.QtGui import QApplication > import configobj > import configobj_gui > > app = QApplication(sys.argv) > > spec = configobj.ConfigObj('yourspecfile', list_values=False) > conf = configobj.ConfigObj('yourconffile', configspec=spec) > > wnd = configobj_gui.ConfigWindow(conf, spec) > wnd.show() > > app.exec_() > print conf > > There are still some limitations, like not being able to add new > sections (coming at some point). There are also a few small, mostly > graphics related, bugs. The grey text is supposed to symbolize default > values, but it looks a bit like the controls are disabled. There > probably are a lot of bigger bugs as well since the code has not been > tested very much. > -- 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: Stefan P. <pa...@ik...> - 2010-12-15 22:07:00
|
Hi all, I made a graphical interface for editing configobj-based configs in my own graphical applications and I thought it might be useful for others as well. It's made using PyQt so probably your application also needs to use this toolkit, although I guess it's theoretically possible to mix Qt and GTK+ code nowadays. The code should work on all platforms where PyQt works (Linux, Windows, MacOS X, ...) The project can be found at https://github.com/pafcu/ConfigObj-GUI. Currently the editor looks like this: https://github.com/pafcu/ConfigObj-GUI/wiki/Screenshots An example program: import sys from PyQt4.QtGui import QApplication import configobj import configobj_gui app = QApplication(sys.argv) spec = configobj.ConfigObj('yourspecfile', list_values=False) conf = configobj.ConfigObj('yourconffile', configspec=spec) wnd = configobj_gui.ConfigWindow(conf, spec) wnd.show() app.exec_() print conf There are still some limitations, like not being able to add new sections (coming at some point). There are also a few small, mostly graphics related, bugs. The grey text is supposed to symbolize default values, but it looks a bit like the controls are disabled. There probably are a lot of bigger bugs as well since the code has not been tested very much. -- Stefan Parviainen |
|
From: Michael F. <fuz...@vo...> - 2010-12-14 16:51:29
|
Hello all, Zubin Mithra and Prashant Kuma have ported ConfigObj to Python 3! https://bitbucket.org/zubin71/configobj-py3 Many thanks for their work. Details in a blog post: http://www.voidspace.org.uk/python/weblog/arch_d7_2010_12_11.shtml#e1199 All the best, Michael Foord -- http://www.voidspace.org.uk/ READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. |
|
From: Michael F. <fuz...@vo...> - 2010-12-13 16:07:23
|
On 13/12/2010 08:56, Stefan Parviainen wrote:
> Hi,
>
> I'm writing a graphical editor for configuration files that work with
> configobj. I would like the GUI to take into account what type an
> option has, e.g. if it's an integer with a minimum and a maximum
> specified a slider should be shown while a standard text box is shown
> if no limits are given.
>
> The problem is getting the parameters, such as "min" and "max". I know
> I can parse the spec using ConfigObj and then do a lookup based on the
> option name, but that only results in a string like
> "integer(default=3, min=0, max=5)" which I would then have to parse
> further. Does validate.py provide any help with this or do I need to
> do the parsing myself. I realize that somewhere deep down inside
> validate the values are parsed, but are they exposed to users in any
> way?
Hmm... the "real" parsing of the configspec (pulling out min and max
values etc) is done, as you guessed, inside validate.py. There is no
public API for this but you could just "steal" some of the code from there.
The checks come in as strings and they are turned into function name,
arguments and keyword arguments by Validator.check which calls
Validator._parse_with_caching.
For example:
validator = Validator()
fun_name, fun_args, fun_kwargs, default =
validator._parse_with_caching('myfunc(min=3, max=5)')
The keyword arguments, which is what you are after, come back as a
dictionary.
All the best,
Michael
> ------------------------------------------------------------------------------
> Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
> new data types, scalar functions, improved concurrency, built-in packages,
> OCI, SQL*Plus, data movement tools, best practices and more.
> http://p.sf.net/sfu/oracle-sfdev2dev
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
--
http://www.voidspace.org.uk/
READ CAREFULLY. By accepting and reading this email you agree,
on behalf of your employer, to release me from all obligations
and waivers arising from any and all NON-NEGOTIATED agreements,
licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap,
confidentiality, non-disclosure, non-compete and acceptable use
policies (”BOGUS AGREEMENTS”) that I have entered into with your
employer, its partners, licensors, agents and assigns, in
perpetuity, without prejudice to my ongoing rights and privileges.
You further represent that you have the authority to release me
from any BOGUS AGREEMENTS on behalf of your employer.
|
|
From: Michael F. <fuz...@vo...> - 2010-12-13 12:07:50
|
On 08/12/2010 14:34, Rob...@co... wrote: > > Hi, > > I'm trying to use ConfigObj for handling my property files. > > This works just fine when I'm running locally on my computer with > Python 2.6.6. > > But the purpose of the script I'm working on is to run it as a python > script in Oracle WebLogic with WLST. > > That's where I have the current problem. > > When I run this with WLST I get an error immediately that looks like: > > CLASSPATH=/u01/app/oracle/wls1033/patch_wls1033/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/wls1033/patch_ocp353/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/jrockit_wls/lib/tools.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/weblogic_sp.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/weblogic.jar:/u01/app/oracle/wls1033/modules/features/weblogic.server.modules_10.3.3.0.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/webservices.jar:/u01/app/oracle/wls1033/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/u01/app/oracle/wls1033/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar: > > PATH=/u01/app/oracle/wls1033/wlserver_10.3/server/bin:/u01/app/oracle/wls1033/modules/org.apache.ant_1.7.1/bin:/u01/app/oracle/jrockit_wls/jre/bin:/u01/app/oracle/jrockit_wls/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin > > Your environment has been set. > > CLASSPATH=/u01/app/oracle/wls1033/patch_wls1033/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/wls1033/patch_ocp353/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/jrockit_wls/lib/tools.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/weblogic_sp.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/weblogic.jar:/u01/app/oracle/wls1033/modules/features/weblogic.server.modules_10.3.3.0.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/webservices.jar:/u01/app/oracle/wls1033/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/u01/app/oracle/wls1033/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/u01/app/oracle/wls1033/utils/config/10.3/config-launch.jar::/u01/app/oracle/wls1033/wlserver_10.3/common/derby/lib/derbynet.jar:/u01/app/oracle/wls1033/wlserver_10.3/common/derby/lib/derbyclient.jar:/u01/app/oracle/wls1033/wlserver_10.3/common/derby/lib/derbytools.jar:: > > Initializing WebLogic Scripting Tool (WLST) ... > > Welcome to WebLogic Server Administration Scripting Shell > > Type help() for help on available commands > > Problem invoking WLST - Traceback (innermost last): > > File "/home/tipdev/wlst_test/start.py", line 17, in ? > > File "/home/tipdev/wlst_test/./wlst_common.py", line 8, in ? > > File "/home/tipdev/wlst_test/./configobj.py", line 25, in ? > > ImportError: cannot import names BOM_UTF8, BOM_UTF16, BOM_UTF16_BE, > BOM_UTF16_LE > These are all constants though, so it should be easy to modify configobj.py to not require importing them. All the best, Michael Foord > Anyone got any good hints about how to solve this issue? > > /Robert > > > ------------------------------------------------------------------------------ > What happens now with your Lotus Notes apps - do you make another costly > upgrade, or settle for being marooned without product support? Time to move > off Lotus Notes and onto the cloud with Force.com, apps are easier to build, > use, and manage than apps on traditional platforms. Sign up for the Lotus > Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d > > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop -- http://www.voidspace.org.uk/ READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. |
|
From: Stefan P. <pa...@ik...> - 2010-12-13 08:56:24
|
Hi, I'm writing a graphical editor for configuration files that work with configobj. I would like the GUI to take into account what type an option has, e.g. if it's an integer with a minimum and a maximum specified a slider should be shown while a standard text box is shown if no limits are given. The problem is getting the parameters, such as "min" and "max". I know I can parse the spec using ConfigObj and then do a lookup based on the option name, but that only results in a string like "integer(default=3, min=0, max=5)" which I would then have to parse further. Does validate.py provide any help with this or do I need to do the parsing myself. I realize that somewhere deep down inside validate the values are parsed, but are they exposed to users in any way? |
|
From: David H. <neg...@gm...> - 2010-12-08 15:19:59
|
WLST uses jython, so my guess is that they've got a compatibility bug in their implementation of the codecs module. The 1st party python docs clearly state that the BOM constants are provided and exposed by the module. regards, -David On Wed, Dec 8, 2010 at 09:34, <Rob...@co...> wrote: > Hi, > > > > I’m trying to use ConfigObj for handling my property files. > > This works just fine when I’m running locally on my computer with Python > 2.6.6. > > > > But the purpose of the script I’m working on is to run it as a python script > in Oracle WebLogic with WLST. > > That’s where I have the current problem. > > > > When I run this with WLST I get an error immediately that looks like: > > > > CLASSPATH=/u01/app/oracle/wls1033/patch_wls1033/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/wls1033/patch_ocp353/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/jrockit_wls/lib/tools.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/weblogic_sp.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/weblogic.jar:/u01/app/oracle/wls1033/modules/features/weblogic.server.modules_10.3.3.0.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/webservices.jar:/u01/app/oracle/wls1033/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/u01/app/oracle/wls1033/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar: > > > > PATH=/u01/app/oracle/wls1033/wlserver_10.3/server/bin:/u01/app/oracle/wls1033/modules/org.apache.ant_1.7.1/bin:/u01/app/oracle/jrockit_wls/jre/bin:/u01/app/oracle/jrockit_wls/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin > > > > Your environment has been set. > > > > CLASSPATH=/u01/app/oracle/wls1033/patch_wls1033/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/wls1033/patch_ocp353/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/jrockit_wls/lib/tools.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/weblogic_sp.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/weblogic.jar:/u01/app/oracle/wls1033/modules/features/weblogic.server.modules_10.3.3.0.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/webservices.jar:/u01/app/oracle/wls1033/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/u01/app/oracle/wls1033/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/u01/app/oracle/wls1033/utils/config/10.3/config-launch.jar::/u01/app/oracle/wls1033/wlserver_10.3/common/derby/lib/derbynet.jar:/u01/app/oracle/wls1033/wlserver_10.3/common/derby/lib/derbyclient.jar:/u01/app/oracle/wls1033/wlserver_10.3/common/derby/lib/derbytools.jar:: > > > > Initializing WebLogic Scripting Tool (WLST) ... > > > > Welcome to WebLogic Server Administration Scripting Shell > > > > Type help() for help on available commands > > Problem invoking WLST - Traceback (innermost last): > > File "/home/tipdev/wlst_test/start.py", line 17, in ? > > File "/home/tipdev/wlst_test/./wlst_common.py", line 8, in ? > > File "/home/tipdev/wlst_test/./configobj.py", line 25, in ? > > ImportError: cannot import names BOM_UTF8, BOM_UTF16, BOM_UTF16_BE, > BOM_UTF16_LE > > > > > > Anyone got any good hints about how to solve this issue? > > > > /Robert > > ------------------------------------------------------------------------------ > What happens now with your Lotus Notes apps - do you make another costly > upgrade, or settle for being marooned without product support? Time to move > off Lotus Notes and onto the cloud with Force.com, apps are easier to build, > use, and manage than apps on traditional platforms. Sign up for the Lotus > Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > |
|
From: <Rob...@co...> - 2010-12-08 14:47:01
|
Hi, I'm trying to use ConfigObj for handling my property files. This works just fine when I'm running locally on my computer with Python 2.6.6. But the purpose of the script I'm working on is to run it as a python script in Oracle WebLogic with WLST. That's where I have the current problem. When I run this with WLST I get an error immediately that looks like: CLASSPATH=/u01/app/oracle/wls1033/patch_wls1033/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/wls1033/patch_ocp353/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/jrockit_wls/lib/tools.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/weblogic_sp.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/weblogic.jar:/u01/app/oracle/wls1033/modules/features/weblogic.server.modules_10.3.3.0.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/webservices.jar:/u01/app/oracle/wls1033/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/u01/app/oracle/wls1033/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar: PATH=/u01/app/oracle/wls1033/wlserver_10.3/server/bin:/u01/app/oracle/wls1033/modules/org.apache.ant_1.7.1/bin:/u01/app/oracle/jrockit_wls/jre/bin:/u01/app/oracle/jrockit_wls/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin Your environment has been set. CLASSPATH=/u01/app/oracle/wls1033/patch_wls1033/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/wls1033/patch_ocp353/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/jrockit_wls/lib/tools.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/weblogic_sp.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/weblogic.jar:/u01/app/oracle/wls1033/modules/features/weblogic.server.modules_10.3.3.0.jar:/u01/app/oracle/wls1033/wlserver_10.3/server/lib/webservices.jar:/u01/app/oracle/wls1033/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/u01/app/oracle/wls1033/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/u01/app/oracle/wls1033/utils/config/10.3/config-launch.jar::/u01/app/oracle/wls1033/wlserver_10.3/common/derby/lib/derbynet.jar:/u01/app/oracle/wls1033/wlserver_10.3/common/derby/lib/derbyclient.jar:/u01/app/oracle/wls1033/wlserver_10.3/common/derby/lib/derbytools.jar:: Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands Problem invoking WLST - Traceback (innermost last): File "/home/tipdev/wlst_test/start.py", line 17, in ? File "/home/tipdev/wlst_test/./wlst_common.py", line 8, in ? File "/home/tipdev/wlst_test/./configobj.py", line 25, in ? ImportError: cannot import names BOM_UTF8, BOM_UTF16, BOM_UTF16_BE, BOM_UTF16_LE Anyone got any good hints about how to solve this issue? /Robert |
|
From: Michael F. <fuz...@vo...> - 2010-11-17 16:13:22
|
On 14/11/2010 23:23, Jendrik Seipp wrote: > Hello, > first I have to say thank you for such a great tool like configobj! I > can't believe it hasn't made its way into the python stdlib, yet. > > Is there any way to write a configobj to disk sorted by the key names? I > think this would be a very nice feature addition if it doesn't exist. Hello Jendrik, This feature doesn't exist directly and you are the first (that I recall) to request / suggest it. ConfigObj writes out its members honouring their original order in the config file or the order you create them in. However... the order is exposed in the form of two lists - the "scalars" and "sections" members on each section. If you recursively walk the sections of the ConfigObj instance and sort these two lists then you would have a sorted config file. All the best, Michael Foord > Cheers, > Jendrik > > > PS. Please add me to CC. > > ------------------------------------------------------------------------------ > Centralized Desktop Delivery: Dell and VMware Reference Architecture > Simplifying enterprise desktop deployment and management using > Dell EqualLogic storage and VMware View: A highly scalable, end-to-end > client virtualization framework. Read more! > http://p.sf.net/sfu/dell-eql-dev2dev > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop -- http://www.voidspace.org.uk/ |
|
From: Jendrik S. <jen...@we...> - 2010-11-14 23:46:50
|
Hello, first I have to say thank you for such a great tool like configobj! I can't believe it hasn't made its way into the python stdlib, yet. Is there any way to write a configobj to disk sorted by the key names? I think this would be a very nice feature addition if it doesn't exist. Cheers, Jendrik PS. Please add me to CC. |
|
From: Michael F. <fuz...@vo...> - 2010-10-10 18:00:06
|
On 28/09/2010 05:27, Faheem Mitha wrote: > Hi, > > I'm having problems writing a validation file. > > For the config below, what I would like to do is something like > > [__many__] > annotfile = string > > [[__many__]] > phenofiles = string_list > genofile = string > test_genofile = string > > [affy6] > fidlist = string_list > > [illumina] > rsidlist = string_list Hello Faheem, I can't reproduce this error I'm afraid. I can create and validate config files using __many__ sections that contain __many__ sections. If this is still an issue, can you create a *minimal* way to reproduce the error and attach it to a bug report on the ConfigObj bug tracker: https://code.google.com/p/configobj/issues/list All the best, Michael Foord > but I can't because I get complaints of duplicate sections. I've no idea > why trying to do this should be a problem. It seems quite reasonable to > me. The following (with repeated checks for affy6 and illumina) > > [affy6] > annotfile = string > fidlist = string_list > > [[__many__]] > phenofiles = string_list > genofile = string > test_genofile = string > > [illumina] > annotfile = string > rsidlist = string_list > > [[__many__]] > phenofiles = string_list > genofile = string > test_genofile = string > > works, but having all this duplication (eg. identical __many__ sections > for both the affy6 and illumina sections) seems kind of dotty. > > So, how can I nest a many inside a many and still have specific sections > at an upper level? The idea is to avoid duplication as much as possible. > > Thanks, Faheem > > ******************************************************************** > > [affy6] > annotfile = "/data/snppy/Hapmap6.0/Geno/GenomeWideSNP_6.na29.annot.csv" > fidlist = SNP_A-1780419, SNP_A-1780418, SNP_A-1780415, SNP_A-1780414, SNP_A-1780413, SNP_A-8493668, SNP_A-8497683, SNP_A-8499914, SNP_A-8515633, SNP_A-8558729, SNP_A-8580441, AFFX-SNP_11601946, SNP_A-1884440, AFFX-SNP_9061467, SNP_A-2254440 > [[hapmap]] > phenofiles = /data/snppy/Hapmap6.0/Pheno/hapmappheno_909.csv, > genofile = /data/snppy/Hapmap6.0/Geno/birdseed-v2.calls.txt > test_genofile = birdseed-v2.calls.trunc.txt > [[btsnp]] > phenofiles = /data/snppy/btsnp/WG4_BreastBmt.csv, /data/snppy/btsnp/WG4_demog.csv > genofile = /data/snppy/btsnp/birdseed.calls.txt > test_genofile = birdseed.calls.trunc.txt > [illumina] > annotfile = "/data/snppy/Hapmap610/Human610-Quadv1_B.csv" > rsidlist = rs8179466, rs943918, rs798075, rs4650275, rs7552097 > [[ceu]] > phenofiles = /data/snppy/Hapmap610/ceupheno.csv, > genofile = "/data/snppy/Hapmap610/Human610-Quadv1_CEU_Genotype_Report.txt" > test_genofile = "Human610-Quadv1_CEU_Genotype_Report.trunc.txt" > [[chbjpt]] > phenofiles = "/data/snppy/Hapmap610/chbjptpheno.csv", > genofile = "/data/snppy/Hapmap610/Human610-Quadv1_CHBJPT_Genotype_Report.txt" > test_genofile = "Human610-Quadv1_CHBJPT_Genotype_Report.trunc.txt" > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop -- http://www.voidspace.org.uk/ READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. |
|
From: Faheem M. <fa...@em...> - 2010-09-28 04:27:18
|
Hi,
I'm having problems writing a validation file.
For the config below, what I would like to do is something like
[__many__]
annotfile = string
[[__many__]]
phenofiles = string_list
genofile = string
test_genofile = string
[affy6]
fidlist = string_list
[illumina]
rsidlist = string_list
but I can't because I get complaints of duplicate sections. I've no idea
why trying to do this should be a problem. It seems quite reasonable to
me. The following (with repeated checks for affy6 and illumina)
[affy6]
annotfile = string
fidlist = string_list
[[__many__]]
phenofiles = string_list
genofile = string
test_genofile = string
[illumina]
annotfile = string
rsidlist = string_list
[[__many__]]
phenofiles = string_list
genofile = string
test_genofile = string
works, but having all this duplication (eg. identical __many__ sections
for both the affy6 and illumina sections) seems kind of dotty.
So, how can I nest a many inside a many and still have specific sections
at an upper level? The idea is to avoid duplication as much as possible.
Thanks, Faheem
********************************************************************
[affy6]
annotfile = "/data/snppy/Hapmap6.0/Geno/GenomeWideSNP_6.na29.annot.csv"
fidlist = SNP_A-1780419, SNP_A-1780418, SNP_A-1780415, SNP_A-1780414, SNP_A-1780413, SNP_A-8493668, SNP_A-8497683, SNP_A-8499914, SNP_A-8515633, SNP_A-8558729, SNP_A-8580441, AFFX-SNP_11601946, SNP_A-1884440, AFFX-SNP_9061467, SNP_A-2254440
[[hapmap]]
phenofiles = /data/snppy/Hapmap6.0/Pheno/hapmappheno_909.csv,
genofile = /data/snppy/Hapmap6.0/Geno/birdseed-v2.calls.txt
test_genofile = birdseed-v2.calls.trunc.txt
[[btsnp]]
phenofiles = /data/snppy/btsnp/WG4_BreastBmt.csv, /data/snppy/btsnp/WG4_demog.csv
genofile = /data/snppy/btsnp/birdseed.calls.txt
test_genofile = birdseed.calls.trunc.txt
[illumina]
annotfile = "/data/snppy/Hapmap610/Human610-Quadv1_B.csv"
rsidlist = rs8179466, rs943918, rs798075, rs4650275, rs7552097
[[ceu]]
phenofiles = /data/snppy/Hapmap610/ceupheno.csv,
genofile = "/data/snppy/Hapmap610/Human610-Quadv1_CEU_Genotype_Report.txt"
test_genofile = "Human610-Quadv1_CEU_Genotype_Report.trunc.txt"
[[chbjpt]]
phenofiles = "/data/snppy/Hapmap610/chbjptpheno.csv",
genofile = "/data/snppy/Hapmap610/Human610-Quadv1_CHBJPT_Genotype_Report.txt"
test_genofile = "Human610-Quadv1_CHBJPT_Genotype_Report.trunc.txt"
|
|
From: Michael F. <fuz...@vo...> - 2010-08-29 20:05:12
|
On 27/08/2010 10:47, Tom wrote: > Hi, > > want i want is a configobj only with the spec. Then i want to use this > object to validate a simple dict and i want to use the same configobj > ever time i have to validate a dict. > Actually i create a new configobj every time i want to validate a dict. > That's very slow. I can imagine. > How can i do this? > Did you try my suggestion of reading the configspec into a ConfigObj instance (once) and then using the validate library directly to do your validation? All the best, Michael Foord > Cheers, > > Tom > > On Wed, 2010-08-25 at 21:26 +0300, Michael Foord wrote: >> On 25/08/2010 09:47, Tom wrote: >>> Hi, >>> >>> i have a configspec with about 200 lines and validate a simple dict with >>> about 5 key/value pairs. >>> >>> For validation of the dict, i create a new config-obj with the config >>> spec (and copy=True), merge the dict into the new config and run the >>> validate() method. >>> But this is very slow (on an embedded device (400 Mhz)). How can i speed >>> up this process? Is it possible to validate only the dict without all >>> the other stuff? >> You could use the validate library directly. ConfigObj will attempt to >> validate against the whole configspec, but you could pull the keys out >> of the configspec / dict and only validate against rules you actually >> need (I assume this is your intent?). >> >> The documentation for validate can be found at: >> >> http://www.voidspace.org.uk/python/validate.html >> >> You may first need to read your configspec into a ConfigObj instance. >> The correct way to do this is: >> >> from configobj import ConfigObj >> spec = ConfigObj(filename, list_values=False, _inspec=True) >> >> HTH. >> >> All the best, >> >> Michael Foord >> >>> Cheers, >>> >>> Tom >>> >>> >>> ------------------------------------------------------------------------------ >>> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program >>> Be part of this innovative community and reach millions of netbook users >>> worldwide. Take advantage of special opportunities to increase revenue and >>> speed time-to-market. Join now, and jumpstart your future. >>> http://p.sf.net/sfu/intel-atom-d2d >>> _______________________________________________ >>> Configobj-develop mailing list >>> Con...@li... >>> https://lists.sourceforge.net/lists/listinfo/configobj-develop >> > > > ------------------------------------------------------------------------------ > Sell apps to millions through the Intel(R) Atom(Tm) Developer Program > Be part of this innovative community and reach millions of netbook users > worldwide. Take advantage of special opportunities to increase revenue and > speed time-to-market. Join now, and jumpstart your future. > http://p.sf.net/sfu/intel-atom-d2d > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop -- http://www.ironpythoninaction.com/ |
|
From: Tom <to...@go...> - 2010-08-27 07:48:02
|
Hi, want i want is a configobj only with the spec. Then i want to use this object to validate a simple dict and i want to use the same configobj ever time i have to validate a dict. Actually i create a new configobj every time i want to validate a dict. That's very slow. How can i do this? Cheers, Tom On Wed, 2010-08-25 at 21:26 +0300, Michael Foord wrote: > On 25/08/2010 09:47, Tom wrote: > > Hi, > > > > i have a configspec with about 200 lines and validate a simple dict with > > about 5 key/value pairs. > > > > For validation of the dict, i create a new config-obj with the config > > spec (and copy=True), merge the dict into the new config and run the > > validate() method. > > But this is very slow (on an embedded device (400 Mhz)). How can i speed > > up this process? Is it possible to validate only the dict without all > > the other stuff? > > You could use the validate library directly. ConfigObj will attempt to > validate against the whole configspec, but you could pull the keys out > of the configspec / dict and only validate against rules you actually > need (I assume this is your intent?). > > The documentation for validate can be found at: > > http://www.voidspace.org.uk/python/validate.html > > You may first need to read your configspec into a ConfigObj instance. > The correct way to do this is: > > from configobj import ConfigObj > spec = ConfigObj(filename, list_values=False, _inspec=True) > > HTH. > > All the best, > > Michael Foord > > > Cheers, > > > > Tom > > > > > > ------------------------------------------------------------------------------ > > Sell apps to millions through the Intel(R) Atom(Tm) Developer Program > > Be part of this innovative community and reach millions of netbook users > > worldwide. Take advantage of special opportunities to increase revenue and > > speed time-to-market. Join now, and jumpstart your future. > > http://p.sf.net/sfu/intel-atom-d2d > > _______________________________________________ > > Configobj-develop mailing list > > Con...@li... > > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > |
|
From: Michael F. <fuz...@vo...> - 2010-08-25 18:26:12
|
On 25/08/2010 09:47, Tom wrote:
> Hi,
>
> i have a configspec with about 200 lines and validate a simple dict with
> about 5 key/value pairs.
>
> For validation of the dict, i create a new config-obj with the config
> spec (and copy=True), merge the dict into the new config and run the
> validate() method.
> But this is very slow (on an embedded device (400 Mhz)). How can i speed
> up this process? Is it possible to validate only the dict without all
> the other stuff?
You could use the validate library directly. ConfigObj will attempt to
validate against the whole configspec, but you could pull the keys out
of the configspec / dict and only validate against rules you actually
need (I assume this is your intent?).
The documentation for validate can be found at:
http://www.voidspace.org.uk/python/validate.html
You may first need to read your configspec into a ConfigObj instance.
The correct way to do this is:
from configobj import ConfigObj
spec = ConfigObj(filename, list_values=False, _inspec=True)
HTH.
All the best,
Michael Foord
> Cheers,
>
> Tom
>
>
> ------------------------------------------------------------------------------
> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> Be part of this innovative community and reach millions of netbook users
> worldwide. Take advantage of special opportunities to increase revenue and
> speed time-to-market. Join now, and jumpstart your future.
> http://p.sf.net/sfu/intel-atom-d2d
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
--
http://www.ironpythoninaction.com/
|
|
From: Tom <to...@go...> - 2010-08-25 06:47:49
|
Hi, i have a configspec with about 200 lines and validate a simple dict with about 5 key/value pairs. For validation of the dict, i create a new config-obj with the config spec (and copy=True), merge the dict into the new config and run the validate() method. But this is very slow (on an embedded device (400 Mhz)). How can i speed up this process? Is it possible to validate only the dict without all the other stuff? Cheers, Tom |
|
From: F. <bou...@gm...> - 2010-08-13 19:00:23
|
Le 13/08/2010 20:52, Michael Foord a écrit : > On 13/08/2010 15:40, François wrote: >> Le 13/08/2010 14:34, Michael Foord a écrit : >> >>> On 13/08/2010 13:29, François wrote: >>> >>>> Hi, >>>> >>>> I don't know if it is a bug or if I'm using the library in a wrong way >>>> but I can pass successfully a configfile which is obviously wrong. >>>> >>>> >>>> >>> I think you are using validation incorrectly. Try printing the result of >>> config.validate(Validator()) and I think you will see your mistake. >>> >>> Michael >>> >>> >> You mean I have to make a for loop on the hash elements to be sure they >> are all correct? >> >> >> > >From the docs on the validate method: > > By default, the validate method either returns True (everything > passed) or a dictionary of True / False representing pass/fail. The > dictionary follows the structure of the ConfigObj. > > http://www.voidspace.org.uk/python/configobj.html#return-value > > So in the event of a validation fail you will get a dictionary of > values telling you which one(s) failed. This is going to evaluate as > True if you check it in an if statement. Instead you should do > (something like): > > result = configobj.validate(Validator()) > > if result == True > # validation succeeded Ok! I feel stupid since I read many times the doc and missed the mention of the dictionary. I thought the two steps were to explicit as much as possible, so I tried to compress the code. Many thanks for your answer (and your job). Regards, Francois. |
|
From: Michael F. <fuz...@vo...> - 2010-08-13 18:52:40
|
On 13/08/2010 15:40, François wrote: > Le 13/08/2010 14:34, Michael Foord a écrit : > >> On 13/08/2010 13:29, François wrote: >> >>> Hi, >>> >>> I don't know if it is a bug or if I'm using the library in a wrong way >>> but I can pass successfully a configfile which is obviously wrong. >>> >>> >>> >> I think you are using validation incorrectly. Try printing the result of >> config.validate(Validator()) and I think you will see your mistake. >> >> Michael >> >> > You mean I have to make a for loop on the hash elements to be sure they > are all correct? > > > From the docs on the validate method: By default, the validate method either returns True (everything passed) or a dictionary of True / False representing pass/fail. The dictionary follows the structure of the ConfigObj. http://www.voidspace.org.uk/python/configobj.html#return-value So in the event of a validation fail you will get a dictionary of values telling you which one(s) failed. This is going to evaluate as True if you check it in an if statement. Instead you should do (something like): result = configobj.validate(Validator()) if result == True: # validation succeeded All the best, Michael Foord >>> here, the files: >>> cat monte.py >>> http://pastebin.com/2Z8JUHrH >>> cat choices.conf >>> http://pastebin.com/EstuqNhK >>> cat specs.conf >>> http://pastebin.com/EVhh6vfy >>> >>> _________________ >>> If choices.conf is >>> >>> [Pierre] >>> Lundi=r >>> >>> then it prints OOPS. >>> >>> >>> _________________ >>> If choices.conf is >>> >>> [Pierre] >>> Lundi=r >>> >>> [Paul] >>> Lundi=r >>> >>> >>> then it prints OOPS. >>> >>> >>> But if only one variable named Lundi is wrong, it prints 'OK' >>> >>> >>> Do you have any idea? I didn't any clue in the documentation, maybe I >>> missed an option... >>> >>> Regards, >>> Francois. >>> >>> >>> ------------------------------------------------------------------------------ >>> This SF.net email is sponsored by >>> >>> Make an app they can't live without >>> Enter the BlackBerry Developer Challenge >>> http://p.sf.net/sfu/RIM-dev2dev >>> _______________________________________________ >>> Configobj-develop mailing list >>> Con...@li... >>> https://lists.sourceforge.net/lists/listinfo/configobj-develop >>> >>> >> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. |
|
From: F. <bou...@gm...> - 2010-08-13 14:43:01
|
Le 13/08/2010 14:34, Michael Foord a écrit : > On 13/08/2010 13:29, François wrote: >> Hi, >> >> I don't know if it is a bug or if I'm using the library in a wrong way >> but I can pass successfully a configfile which is obviously wrong. >> >> > I think you are using validation incorrectly. Try printing the result of > config.validate(Validator()) and I think you will see your mistake. > > Michael > You mean I have to make a for loop on the hash elements to be sure they are all correct? >> here, the files: >> cat monte.py >> http://pastebin.com/2Z8JUHrH >> cat choices.conf >> http://pastebin.com/EstuqNhK >> cat specs.conf >> http://pastebin.com/EVhh6vfy >> >> _________________ >> If choices.conf is >> >> [Pierre] >> Lundi=r >> >> then it prints OOPS. >> >> >> _________________ >> If choices.conf is >> >> [Pierre] >> Lundi=r >> >> [Paul] >> Lundi=r >> >> >> then it prints OOPS. >> >> >> But if only one variable named Lundi is wrong, it prints 'OK' >> >> >> Do you have any idea? I didn't any clue in the documentation, maybe I >> missed an option... >> >> Regards, >> Francois. >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by >> >> Make an app they can't live without >> Enter the BlackBerry Developer Challenge >> http://p.sf.net/sfu/RIM-dev2dev >> _______________________________________________ >> Configobj-develop mailing list >> Con...@li... >> https://lists.sourceforge.net/lists/listinfo/configobj-develop >> > |
|
From: Michael F. <fuz...@vo...> - 2010-08-13 12:34:20
|
On 13/08/2010 13:29, François wrote: > Hi, > > I don't know if it is a bug or if I'm using the library in a wrong way > but I can pass successfully a configfile which is obviously wrong. > > I think you are using validation incorrectly. Try printing the result of config.validate(Validator()) and I think you will see your mistake. Michael > here, the files: > cat monte.py > http://pastebin.com/2Z8JUHrH > cat choices.conf > http://pastebin.com/EstuqNhK > cat specs.conf > http://pastebin.com/EVhh6vfy > > _________________ > If choices.conf is > > [Pierre] > Lundi=r > > then it prints OOPS. > > > _________________ > If choices.conf is > > [Pierre] > Lundi=r > > [Paul] > Lundi=r > > > then it prints OOPS. > > > But if only one variable named Lundi is wrong, it prints 'OK' > > > Do you have any idea? I didn't any clue in the documentation, maybe I > missed an option... > > Regards, > Francois. > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. |