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: Jack K. <kj...@gm...> - 2006-11-07 15:41:46
|
Hi all,
sorry, I couldn't wait for ConfigObj to be pickle-able (for pickle protocol
2). So, after some investigation here are some changes
that I've found necessary:
def __newobj__(cls, *args):
"""Required by Section.__reduce__ for using Pickle protocol 2 with
newstyle class. """
return cls.__new__(cls, *args)
class Section(dict):
def __reduce__(self):
d = {}
d.update(self.__dict__)
d['parent'] = d['main'] = None # remove recursive references
d['sections'] = d['scalars'] = [] # must be empty since we are
going to Section.__setitem__
return __newobj__, (self.__class__, d), self.__dict__, None,
self.iteritems()
def __new__(cls, *args, **kws):
"""Partially initialize the object so that it's safe to call
Section.__setitem__ before
the full states are restored during unpickling.
"""
inst = super(Section, cls).__new__(cls)
# Check the args to make sure it's called by __newobj__ before
updating
# there's probably a better way to verify this....
if len(args) == 1 and isinstance(args[0], dict):
d = args[0]
try:
if d['parent'] == d['main'] == None:
inst.__dict__.update(d)
except:
pass
return inst
then we also need to change just one line in Section.__setitem__:
the line where it says "if not self.main.stringify:", change it to "if
self.main and not self.main.stringify:" since if we are unpickling
self.main will be None, plus there's no need to check the value during
unpickling anyway.
I did some tests on a my configuration, it seems to work. But anyway, the
basic idea I think is that we need to have some states
restored so that during unpickling Section.__setitem__ can rebuild the
section tree structure, and then we complete the unpickling by restoring
the the original states.
Thanks,
Jack
|
|
From: Michael F. <fuz...@vo...> - 2006-09-10 17:13:37
|
Tomi Kyöstilä wrote: > Michael Foord wrote: >> Tomi Kyöstilä wrote: >>> Hi! >>> >>> Is it possible to spread lists over multiple lines in ConfigObj? >>> >>> For example, this one-line list >>> >>> asd = foo, bar, baz >>> >>> would be written as >>> >>> asd = foo, >>> bar, >>> baz >>> >>> When I try that, I get a parse error. It would make managing the >>> config files easier when it contains long lists. >> This feature would be very cool, but also quite tricky to implement. :-) >> >> If you are able to do it without making the parser even harder to >> read, I would welcome the patch... > So I've put together a patch in the last four hours and it works well > enough for my needs. I've made just a few test cases so there might > very well be something wrong with it that I haven't thought of. Great - you've even included tests. :-) I'll have a play with it and aim to include it in the next release. > It doesn't work with unrepr mode (I don't really need that feature, I > just tried this with it), but is it even possible to change the > parsing in that mode since it uses the compiler package? > In order to be a valid list it would have to start with [ and end with ]. I *think* that multiline parsing is done before a line is handled to unrepr; so it might be possible to make it work. I'll have a look. > I've attached the patch to this message (don't know if attachments are > allowed) and you can also get the patch from > http://fout.dy.fi/~tomik/configobj-multiline_lists.patch for now. > Fuzzyman, do you want me to upload it to SourceForge? I hesitated > because the patch area seems a bit empty at the moment :). No, posting here is fine. > > Please let me know if you find something wrong with it. I have to update Movable Python docs first, and then I am on to ConfigObj. I will certainly give you feedback. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > > -- > Tomi Kyöstilä > >> >> Fuzzyman >> http://www.voidspace.org.uk/python/index.shtml >> >>> >>> -- >>> Tomi Kyöstilä > ------------------------------------------------------------------------ > > |
|
From: <tom...@gm...> - 2006-09-09 23:54:23
|
Michael Foord wrote: > Tomi Kyöstilä wrote: >> Hi! >> >> Is it possible to spread lists over multiple lines in ConfigObj? >> >> For example, this one-line list >> >> asd = foo, bar, baz >> >> would be written as >> >> asd = foo, >> bar, >> baz >> >> When I try that, I get a parse error. It would make managing the >> config files easier when it contains long lists. > This feature would be very cool, but also quite tricky to implement. :-) > > If you are able to do it without making the parser even harder to read, > I would welcome the patch... So I've put together a patch in the last four hours and it works well enough for my needs. I've made just a few test cases so there might very well be something wrong with it that I haven't thought of. It doesn't work with unrepr mode (I don't really need that feature, I just tried this with it), but is it even possible to change the parsing in that mode since it uses the compiler package? I've attached the patch to this message (don't know if attachments are allowed) and you can also get the patch from http://fout.dy.fi/~tomik/configobj-multiline_lists.patch for now. Fuzzyman, do you want me to upload it to SourceForge? I hesitated because the patch area seems a bit empty at the moment :). Please let me know if you find something wrong with it. -- Tomi Kyöstilä > > Fuzzyman > http://www.voidspace.org.uk/python/index.shtml > >> >> -- >> Tomi Kyöstilä |
|
From: Michael F. <fuz...@vo...> - 2006-09-09 19:07:12
|
Tomi Kyöstilä wrote: > Hi! > > Is it possible to spread lists over multiple lines in ConfigObj? > > For example, this one-line list > > asd = foo, bar, baz > > would be written as > > asd = foo, > bar, > baz > > When I try that, I get a parse error. It would make managing the > config files easier when it contains long lists. This feature would be very cool, but also quite tricky to implement. :-) If you are able to do it without making the parser even harder to read, I would welcome the patch... Fuzzyman http://www.voidspace.org.uk/python/index.shtml > > -- > Tomi Kyöstilä > |
|
From: Jorge V. <jor...@gm...> - 2006-09-05 23:20:48
|
On 9/4/06, Michael Foord <mi...@pc...> wrote: > Subject: Re: [Configobj-develop] [PATCH] add indent_size was: add > indent_size + patch (sort of) > > > > On 8/6/06, *Michael Foord* <fuz...@vo... > > <mailto:fuz...@vo...>> wrote: > > > > Jorge Vargas wrote: > > > bah I'm so stupid.... I forgot setuptools takes eggs before > > files, so > > > my code was actually calling the official release. > > > > > > this patch works. > > > > > > by the way I think you can delete DEFAULT_INDENT_TYPE and set it > > > inside the OPTION_DEFAULTS that will solve the readonly NOTE > > from the > > > __all__ > > > > > > again great work keep it up. > > Hello Jorge, > > > > Thanks for the compliments and the patch Jorge. :-) > > > > My main concern with ConfigObj at the moment is that the number of > > features and options seems to grow with every release. This actually > > makes it harder for people to use ConfigObj, rather than easier. > > > Hello Jorge, > > I don't think I can include an indent size option in the main ConfigObj > distribution. What I can do (in the forthcoming change), is expose a > semi private variable. Probably '_indent_sixe' or similar. that sound just about right, the only reason I wanted the change was "style" and I'm sure most people won't need it. although I suggest using indent_size, because sixe is a little odd :p ones again thanks for this great product and i'm looking forward for the next release > > This will default to 4, but you can set it to 2 to get your desired > behaviour. > > All the best, > > Fuzzyman > http://www.voidspace.org.uk/python/index.shtml > > > > > actually I didn't find any fiction getting into it, I wrote a inifile > > by hand in order to understand what I wanted then I google for > > configObj, open the first link read and started writting the code, > > then make my patch. when I read the options sections on > > http://www.voidspace.org.uk/python/configobj.html#options I found that > > I could use them all if it was needed. > > > > I think the key is here > > > > Simple is better than complex. > > Complex is better than complicated. > > > > yes ConfigObj is complex with all those options. but if you don't need > > them you don't even have to worry about them > > > > as shown here > > http://www.voidspace.org.uk/python/configobj.html#reading-a-config-file > > and here > > http://www.voidspace.org.uk/python/configobj.html#writing-a-config-file > > <http://www.voidspace.org.uk/python/configobj.html#writing-a-config-file> > > > > so in this case ConfigObj is simple. > > > > and as the first paragraph in this message, how can something that you > > get up, running and enhance(although a small feature) in an afternoon > > be complicated? > > > > > > ------------------------------------------------------------------------ > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share your > > opinions on IT & business topics through brief surveys -- and earn cash > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Configobj-develop mailing list > > Con...@li... > > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > > > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > |
|
From: Michael F. <fuz...@vo...> - 2006-09-04 20:20:55
|
Michael Foord wrote: > > > ---------- Forwarded message ---------- > From: *Kong-Jei Kuan* <kj...@ho... <mailto:kj...@ho...>> > Date: 06-Aug-2006 16:55 > Subject: [Configobj-develop] [__INCLUDE__] + allow_overrides > To: con...@li... > <mailto:con...@li...> > > Hi all, > > thanks for the great project! Just like to share some ideas. > > Due to a requirement of my personal project, I added an option, > "allow_overrides", to ConfigObj. The option, if True, allows duplicate > sections at the same depth and also duplicate scalars in the same > section. > Later scalars of the same name in the same section override earlier ones, > and later sections of the same name and depth update earlier ones. > This is done during the parsing of a configuration file. > > Then, I added a merge_includes function to configobj.py which > basically look > for special sections named, "__INCLUDE__", and merge the configuration > file > specified by the "file" scalar of that section. The merge is done so that > all the top level scalars in the included file override the scalars of > the > including section(the section that has the __INCLUDE__ sub section). The > __INCLUDE__ section is "replace" with sections from the included file. > Some > cares have been taken so that this include feature works with the > 'allow_overrides' feature in an expected way. For example: > Hello Jack, Thanks for your suggestion and patch. I've thought about ways of including external files in config files. I don't think adding support directly in ConfigObj is the best way. It adds complexity to the implementation, syntax and API. You could write a fairly simple recursive wrapper that checks for the presence of '__include__' in sections, and use the section method 'merge' to achieve the same thing. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > #The file "x.ini" is: > a=1 > b=2 > [sec1] > c=3 > [[__INCLUDE__]] > file=inc.ini > [[sec1.1]] > d=4 > > #where the file, "inc.ini " is: > a=0 > [sec1.1] > c=5 > d=6 > [sec1.2] > x=a > y=b > z=c > > and the result of merge_includes(ConfigObj("x.ini")) is: > > a=1 > b=2 > [sec1] > c=3 > a=0 > [[sec1.1]] > c=5 > d=4 > [[sec1.2]] > x=a > y=b > z=c > > I needed these two features because I would like to include some base > configuration files in a "child" configuration file but have the child > override some values defined in the base configurations. I've attached my > modified(against 4.3.2) configobj.py, which includes the merge_includes > function and the allow_overrides option to this mail for anyone > interested. > > > Best regards, > Jack > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642> > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > <mailto:Con...@li...> > https://lists.sourceforge.net/lists/listinfo/configobj-develop > <https://lists.sourceforge.net/lists/listinfo/configobj-develop> > |
|
From: Michael F. <mi...@pc...> - 2006-09-04 20:15:50
|
Subject: Re: [Configobj-develop] [PATCH] add indent_size was: add indent_size + patch (sort of) > > On 8/6/06, *Michael Foord* <fuz...@vo... > <mailto:fuz...@vo...>> wrote: > > Jorge Vargas wrote: > > bah I'm so stupid.... I forgot setuptools takes eggs before > files, so > > my code was actually calling the official release. > > > > this patch works. > > > > by the way I think you can delete DEFAULT_INDENT_TYPE and set it > > inside the OPTION_DEFAULTS that will solve the readonly NOTE > from the > > __all__ > > > > again great work keep it up. > Hello Jorge, > > Thanks for the compliments and the patch Jorge. :-) > > My main concern with ConfigObj at the moment is that the number of > features and options seems to grow with every release. This actually > makes it harder for people to use ConfigObj, rather than easier. > Hello Jorge, I don't think I can include an indent size option in the main ConfigObj distribution. What I can do (in the forthcoming change), is expose a semi private variable. Probably '_indent_sixe' or similar. This will default to 4, but you can set it to 2 to get your desired behaviour. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > > actually I didn't find any fiction getting into it, I wrote a inifile > by hand in order to understand what I wanted then I google for > configObj, open the first link read and started writting the code, > then make my patch. when I read the options sections on > http://www.voidspace.org.uk/python/configobj.html#options I found that > I could use them all if it was needed. > > I think the key is here > > Simple is better than complex. > Complex is better than complicated. > > yes ConfigObj is complex with all those options. but if you don't need > them you don't even have to worry about them > > as shown here > http://www.voidspace.org.uk/python/configobj.html#reading-a-config-file > and here > http://www.voidspace.org.uk/python/configobj.html#writing-a-config-file > <http://www.voidspace.org.uk/python/configobj.html#writing-a-config-file> > > so in this case ConfigObj is simple. > > and as the first paragraph in this message, how can something that you > get up, running and enhance(although a small feature) in an afternoon > be complicated? > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > ------------------------------------------------------------------------ > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > |
|
From: Michael F. <fuz...@vo...> - 2006-09-04 09:23:00
|
Terrence Brannon wrote: > I am confused on the use of the terminology "DEFAULT" subsection in > the docs and they dont have any examples of what such a section is. > Sorry. It's not documented very well, but it's a straight copy of what ConfigParser does. > Anyway, I did the intuitive thing with my .ini file and it is failing. > Any feedback on how to get interpolation to work is appreciated: > > [ntis] > user = jim > pass = beam > base_url = https://whiskey.gov/ > page_url = %(base_url)whip.html > You need : [DEFAULT] base_url = https://whiskey.gov/ [ntis] user = jim pass = beam page_url = %(base_url)whip.html In the next update (soon!), interpolation will be changed to allow interpolation from the current section. Fuzzyman http://www.voidspace.org.uk/python/index.shtml > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ------------------------------------------------------------------------ > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > |
|
From: Terrence B. <met...@gm...> - 2006-09-04 02:32:06
|
I am confused on the use of the terminology "DEFAULT" subsection in the docs and they dont have any examples of what such a section is. Anyway, I did the intuitive thing with my .ini file and it is failing. Any feedback on how to get interpolation to work is appreciated: [ntis] user = jim pass = beam base_url = https://whiskey.gov/ page_url = %(base_url)whip.html |
|
From: Michael F. <fuz...@vo...> - 2006-09-02 12:59:18
|
Terrence Brannon wrote: > I first want to thank the authors of ConfigObj. I am enjoying using it > quite a bit. > > I just realized that an exception is not thrown when the config file > is not found... shouldn't one be? In order to have ConfigObj throw an exception if the specified file doesn't exist, specify 'file_error=True'. Fuzzyman http://www.voidspace.org.uk/python/index.shtml > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ------------------------------------------------------------------------ > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > |
|
From: Terrence B. <met...@gm...> - 2006-09-02 08:26:24
|
I first want to thank the authors of ConfigObj. I am enjoying using it quite a bit. I just realized that an exception is not thrown when the config file is not found... shouldn't one be? |
|
From: Jorge V. <jor...@gm...> - 2006-08-07 05:04:50
|
sorry first line says fiction it should be friction > > actually I didn't find any fiction getting into it, I wrote a inifile by > hand in order to understand what I wanted then I google for configObj, open > the first link read and started writting the code, then make my patch. when > I read the options sections on > http://www.voidspace.org.uk/python/configobj.html#options I found that I > could use them all if it was needed. > > I think the key is here > > Simple is better than complex. > Complex is better than complicated. > > yes ConfigObj is complex with all those options. but if you don't need > them you don't even have to worry about them > > as shown here > http://www.voidspace.org.uk/python/configobj.html#reading-a-config-fileand here http://www.voidspace.org.uk/python/configobj.html#writing-a-config-file > > > so in this case ConfigObj is simple. > > and as the first paragraph in this message, how can something that you get > up, running and enhance(although a small feature) in an afternoon be > complicated? > > > |
|
From: Jorge V. <jor...@gm...> - 2006-08-07 05:03:41
|
On 8/6/06, Michael Foord <fuz...@vo...> wrote: > > Jorge Vargas wrote: > > bah I'm so stupid.... I forgot setuptools takes eggs before files, so > > my code was actually calling the official release. > > > > this patch works. > > > > by the way I think you can delete DEFAULT_INDENT_TYPE and set it > > inside the OPTION_DEFAULTS that will solve the readonly NOTE from the > > __all__ > > > > again great work keep it up. > Hello Jorge, > > Thanks for the compliments and the patch Jorge. :-) > > My main concern with ConfigObj at the moment is that the number of > features and options seems to grow with every release. This actually > makes it harder for people to use ConfigObj, rather than easier. actually I didn't find any fiction getting into it, I wrote a inifile by hand in order to understand what I wanted then I google for configObj, open the first link read and started writting the code, then make my patch. when I read the options sections on http://www.voidspace.org.uk/python/configobj.html#options I found that I could use them all if it was needed. I think the key is here Simple is better than complex. Complex is better than complicated. yes ConfigObj is complex with all those options. but if you don't need them you don't even have to worry about them as shown here http://www.voidspace.org.uk/python/configobj.html#reading-a-config-file and here http://www.voidspace.org.uk/python/configobj.html#writing-a-config-file so in this case ConfigObj is simple. and as the first paragraph in this message, how can something that you get up, running and enhance(although a small feature) in an afternoon be complicated? |
|
From: Michael F. <fuz...@vo...> - 2006-08-06 21:43:47
|
Jorge Vargas wrote: > bah I'm so stupid.... I forgot setuptools takes eggs before files, so > my code was actually calling the official release. > > this patch works. > > by the way I think you can delete DEFAULT_INDENT_TYPE and set it > inside the OPTION_DEFAULTS that will solve the readonly NOTE from the > __all__ > > again great work keep it up. Hello Jorge, Thanks for the compliments and the patch Jorge. :-) My main concern with ConfigObj at the moment is that the number of features and options seems to grow with every release. This actually makes it harder for people to use ConfigObj, rather than easier. Although your patch is straightforward, I don't think I can include in the standard package. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > > PS: if I should post this to somewhere please say so. > > On 8/5/06, *Jorge Vargas* < jor...@gm... > <mailto:jor...@gm...>> wrote: > > Hi > > I don't know why but I wanted 2 indent spaces, 0 seems too flew > and 4 too much so I went into the code and saw it was simple so I > gave it a try. But it seems I'm missing something. > > here is the traceback for creating an object with my patch i > believe it has something to do with your subclass of dict > > Traceback (most recent call last): > File "configObjTest.py", line 5, in ? > config = ConfigObj('file',indent_type=' > ',raise_errors=True,indent_size=4) > File "C:\Python24\lib\site-packages\configobj.py", line 984, in > __init__ > # keyword arguments take precedence over an options dictionary > TypeError: Unrecognised option "indent_size". > > > > it's failing here which doesn't makes sence to me since. > >>> o={} > >>> o.update({'2':2}) > >>> o > {'2': 2} > > def __init__(self, infile=None, options=None, **kwargs): > """ > Parse or create a config file object. > > ``ConfigObj(infile=None, options=None, **kwargs)`` > """ > if infile is None: > infile = [] > if options is None: > options = {} > else: > options = dict(options) > # keyword arguments take precedence over an options dictionary > options.update(kwargs) > > > it's a small indeed :) > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > |
|
From: Kong-Jei K. <kj...@ho...> - 2006-08-06 15:56:38
|
Hi all,
thanks for the great project! Just like to share some ideas.
Due to a requirement of my personal project, I added an option,
"allow_overrides", to ConfigObj. The option, if True, allows duplicate
sections at the same depth and also duplicate scalars in the same section.
Later scalars of the same name in the same section override earlier ones,
and later sections of the same name and depth update earlier ones.
This is done during the parsing of a configuration file.
Then, I added a merge_includes function to configobj.py which basically look
for special sections named, "__INCLUDE__", and merge the configuration file
specified by the "file" scalar of that section. The merge is done so that
all the top level scalars in the included file override the scalars of the
including section(the section that has the __INCLUDE__ sub section). The
__INCLUDE__ section is "replace" with sections from the included file. Some
cares have been taken so that this include feature works with the
'allow_overrides' feature in an expected way. For example:
#The file "x.ini" is:
a=1
b=2
[sec1]
c=3
[[__INCLUDE__]]
file=inc.ini
[[sec1.1]]
d=4
#where the file, "inc.ini" is:
a=0
[sec1.1]
c=5
d=6
[sec1.2]
x=a
y=b
z=c
and the result of merge_includes(ConfigObj("x.ini")) is:
a=1
b=2
[sec1]
c=3
a=0
[[sec1.1]]
c=5
d=4
[[sec1.2]]
x=a
y=b
z=c
I needed these two features because I would like to include some base
configuration files in a "child" configuration file but have the child
override some values defined in the base configurations. I've attached my
modified(against 4.3.2) configobj.py, which includes the merge_includes
function and the allow_overrides option to this mail for anyone interested.
Best regards,
Jack
|
|
From: Jorge V. <jor...@gm...> - 2006-08-05 21:58:43
|
bah I'm so stupid.... I forgot setuptools takes eggs before files, so my
code was actually calling the official release.
this patch works.
by the way I think you can delete DEFAULT_INDENT_TYPE and set it inside the
OPTION_DEFAULTS that will solve the readonly NOTE from the __all__
again great work keep it up.
PS: if I should post this to somewhere please say so.
On 8/5/06, Jorge Vargas <jor...@gm...> wrote:
>
> Hi
>
> I don't know why but I wanted 2 indent spaces, 0 seems too flew and 4 too
> much so I went into the code and saw it was simple so I gave it a try. But
> it seems I'm missing something.
>
> here is the traceback for creating an object with my patch i believe it
> has something to do with your subclass of dict
>
> Traceback (most recent call last):
> File "configObjTest.py", line 5, in ?
> config = ConfigObj('file',indent_type='
> ',raise_errors=True,indent_size=4)
> File "C:\Python24\lib\site-packages\configobj.py", line 984, in __init__
>
> # keyword arguments take precedence over an options dictionary
> TypeError: Unrecognised option "indent_size".
>
>
>
> it's failing here which doesn't makes sence to me since.
> >>> o={}
> >>> o.update({'2':2})
> >>> o
> {'2': 2}
>
> def __init__(self, infile=None, options=None, **kwargs):
> """
> Parse or create a config file object.
>
> ``ConfigObj(infile=None, options=None, **kwargs)``
> """
> if infile is None:
> infile = []
> if options is None:
> options = {}
> else:
> options = dict(options)
> # keyword arguments take precedence over an options dictionary
> options.update(kwargs)
>
>
> it's a small indeed :)
>
>
|
|
From: Jorge V. <jor...@gm...> - 2006-08-05 20:49:56
|
Hello I just started using ConfigObj directly and I love it great work guys. I have been using Turbogears's config files but this is the first time I use you directly and it's great. I saw one thing on ur site that say's TG 1.1 and above will use ConfigObj, well that's not true anymore the 0.9 branch is using it and it's in alpha now. |
|
From: Michael F. <fuz...@vo...> - 2006-07-28 09:07:56
|
Mike Krell wrote:
> Thank you for the ConfigObj module -- I find it quite useful.
>
> Is there a way to specify that section / keyword names should be treated case
> insensitively, i.e., Database and database would fold onto the same entry in
> the dictionary? This would be more consistent with the way these names are
> handled under Windows.
>
Hello Mike,
I'm afraid case insensitivity isn't part of ConfigObj. A recursive
'post-processor' that iterates over all sections and keys making them
uppercase or lowercase could be done in a few lines of code though.
You should use the ``walk`` method to do this :
http://www.voidspace.org.uk/python/configobj.html#walking-a-section
All the best,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
> Mike
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
|
|
From: Michael F. <fuz...@vo...> - 2006-07-17 23:18:31
|
Justus Pendleton wrote:
> [I found this thread in the archives...]
>
> Abhi initially said:
>
>>> I see in the documentation that the use of '\' as a continuation
>>> character for multi-line data is no longer supported in ConfigObj 4.
>>>
>
> To which Fuzzyman responded:
>
>> I'm afraid I don't like '\' as continuation syntax, and won't add it
>> back to ConfigObj.
>>
>> The correct way to create multiline values is with triple quote
>> strings
>>
>
> Except ConfigObj3 let you create a multi-line list like:
>
> foo = a, \
> b, \
> c
>
> But ConfigObj4 just turns the following into a big (and useless to me)
> string:
> foo = """a,
> b,
> c"""
>
What about preprocessing as I suggested ?
infile = open(filename).read().splitlines()
processedFile = []
x = 0
while x < len(infile):
line = infile[x]
x += 1
while line.endswith('\\'):
line = line[:-1]
x += 1
if x == len(infile):
break
line += infile[x]
processedFile.append(line)
Then pass processedFile to ConfigObj. Something like that anyway...
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
>
|
|
From: Justus P. <ju...@ry...> - 2006-07-17 22:47:07
|
[I found this thread in the archives...] Abhi initially said: >> I see in the documentation that the use of '\' as a continuation >> character for multi-line data is no longer supported in ConfigObj 4. To which Fuzzyman responded: > I'm afraid I don't like '\' as continuation syntax, and won't add it > back to ConfigObj. > > The correct way to create multiline values is with triple quote > strings Except ConfigObj3 let you create a multi-line list like: foo = a, \ b, \ c But ConfigObj4 just turns the following into a big (and useless to me) string: foo = """a, b, c""" |
|
From: Michael F. <fuz...@vo...> - 2006-07-17 09:59:48
|
Jack Kuan wrote:
> Hi all,
>
> when trying to use a ConfigObj with the shelve module, I get the
> following exception while trying to
> print the unpickled ConfigObj in the shelf:
>
> $ python ./test.py
> Traceback (most recent call last):
> File "./test.py", line 15, in ?
> print shelf['b0conf']
> File "/home/versant/Apps/lib/python/configobj.py", line 537, in __repr__
> return '{%s}' % ', '.join([('%s: %s' % (repr(key), repr(self[key])))
> File "/home/versant/Apps/lib/python/configobj.py", line 537, in __repr__
> return '{%s}' % ', '.join([('%s: %s' % (repr(key), repr(self[key])))
> File "/home/versant/Apps/lib/python/configobj.py", line 376, in
> __getitem__
> if self.main.interpolation and isinstance(val, StringTypes):
> AttributeError: 'dict' object has no attribute 'interpolation'
>
> How can I correctly pickle/unpickle a ConfigObj object?
>
It looks like it will take a bit of work to make ConfigObj 'pickle-able'.
I will try and support this in ConfigObj 4.4.
Thanks
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
> Thanks,
> Jack
>
>
|
|
From: Jack K. <jac...@wu...> - 2006-07-17 09:58:17
|
Hi all,
when trying to use a ConfigObj with the shelve module, I get the=20
following exception while trying to
print the unpickled ConfigObj in the shelf:
$ python ./test.py
Traceback (most recent call last):
File "./test.py", line 15, in ?
print shelf['b0conf']
File "/home/versant/Apps/lib/python/configobj.py", line 537, in __repr_=
_
return '{%s}' % ', '.join([('%s: %s' % (repr(key), repr(self[key])))
File "/home/versant/Apps/lib/python/configobj.py", line 537, in __repr_=
_
return '{%s}' % ', '.join([('%s: %s' % (repr(key), repr(self[key])))
File "/home/versant/Apps/lib/python/configobj.py", line 376, in=20
__getitem__
if self.main.interpolation and isinstance(val, StringTypes):
AttributeError: 'dict' object has no attribute 'interpolation'
How can I correctly pickle/unpickle a ConfigObj object?
Thanks,
Jack
--=20
**********************************************************************
W=A8=B9rth Phoenix Shanghai
Jack Kuan
W=A8=B9rth Phoenix Product Development Shanghai
WeiHai Road No.511 ShenShi Mansion 14F,Shanghai, China, 200041
Phone: +86 021 62532266 *217
Fax: +86 021 62150009
mailto: jac...@wu...
http://www.wuerth-phoenix.com/
**********************************************************************
|
|
From: Michael F. <fuz...@vo...> - 2006-07-17 09:58:01
|
Robin Munn wrote:
> On 7/17/06, Jack Kuan <jac...@wu...> wrote:
>
>> Hi all,
>>
>> I'm using ConfigObj 4.3.2 with its interpolation feature but the order
>> in which it does the
>> lookup is first in a child default section, and then in parent default
>> section , and then in the
>> global default section. What's preventing it from looking up in its own
>> section first? This
>> would be very convenient for me as I don't need to create an extra
>> default section just so that
>> things can be found by the lookup. Am I missing something?
>>
>> Thanks,
>> Jack
>>
>
> What you describe is how I thought it should work, too. So when I
> submitted a patch to add PEP 292-style interpolation ("$variable"
> instead of "%(variable)s"), I also included a patch to change the
> interpolation behavior to look up interpolated variables in the
> variable's own section, then its default, then its parent and its
> parent's default, and so on up to the top section. Kind of like how
> scoping works for nested functions. Michael Foord has said that the
> patch should go in the next version of ConfigObj (which will probably
> be 4.4.0) once he gets back to working on it.
>
> So it should behave the way you describe pretty soon.
>
>
You got there before me. :-)
I will hopefully announce the first alpha release of Movable Python 2
tonight, so I should get back to ConfigObj 'real soon now'.
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
|
|
From: Robin M. <rob...@gm...> - 2006-07-17 09:23:48
|
On 7/17/06, Jack Kuan <jac...@wu...> wrote:
> Hi all,
>
> I'm using ConfigObj 4.3.2 with its interpolation feature but the order
> in which it does the
> lookup is first in a child default section, and then in parent default
> section , and then in the
> global default section. What's preventing it from looking up in its own
> section first? This
> would be very convenient for me as I don't need to create an extra
> default section just so that
> things can be found by the lookup. Am I missing something?
>
> Thanks,
> Jack
What you describe is how I thought it should work, too. So when I
submitted a patch to add PEP 292-style interpolation ("$variable"
instead of "%(variable)s"), I also included a patch to change the
interpolation behavior to look up interpolated variables in the
variable's own section, then its default, then its parent and its
parent's default, and so on up to the top section. Kind of like how
scoping works for nested functions. Michael Foord has said that the
patch should go in the next version of ConfigObj (which will probably
be 4.4.0) once he gets back to working on it.
So it should behave the way you describe pretty soon.
--
Robin Munn
Rob...@gm...
GPG key 0xD6497014
|
|
From: Jack K. <jac...@wu...> - 2006-07-17 03:48:44
|
Hi all, I'm using ConfigObj 4.3.2 with its interpolation feature but the order in which it does the lookup is first in a child default section, and then in parent default section , and then in the global default section. What's preventing it from looking up in its own section first? This would be very convenient for me as I don't need to create an extra default section just so that things can be found by the lookup. Am I missing something? Thanks, Jack |