|
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: 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: 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: 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? > > > |