|
From: Scott F. <sc...@st...> - 2009-06-08 00:56:27
|
That works for me. Thanks. One other thing, is it possible to make the keys
in a ConfigObj case insensitive?
On Sun, Jun 7, 2009 at 3:29 PM, Michael Foord <fuz...@vo...>wrote:
> Scott Flynn wrote:
> > Does anyone have a vim syntax file for Config Object?
> >
>
> Not me.
>
> > Second, I want to know if there's a way to have defaults for sections
> > where the name is only partially known.
> >
> > For instance:
> >
> > [widget_MyTimer]
> > type="timer"
> > interval=500
> > expression=doAction()
> >
> > And it may also have a precision option but this widget doesn't need
> > it since the expression's not mathematical. This precision is supposed
> > to be 1000 if missing, not that it matters in this case, meaning
> > precision limited by Python's natural floating point precision. Can
> > that be done on Config Object's side?
>
> Not *really* sure what you want here. One way to do it would be to use
> the get method where you can supply a default if the key is missing:
>
> config = ConfigObj(filename)
> timer = config['widget_MyTimer']
> precision = timer.get('precision', '1000')
>
> All the best,
>
>
> Michael
>
> > ------------------------------------------------------------------------
> >
> >
> ------------------------------------------------------------------------------
> > OpenSolaris 2009.06 is a cutting edge operating system for enterprises
> > looking to deploy the next generation of Solaris that includes the latest
> > innovations from Sun and the OpenSource community. Download a copy and
> > enjoy capabilities such as Networking, Storage and Virtualization.
> > Go to: http://p.sf.net/sfu/opensolaris-get
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Configobj-develop mailing list
> > Con...@li...
> > https://lists.sourceforge.net/lists/listinfo/configobj-develop
> >
>
>
> --
> http://www.ironpythoninaction.com/
> http://www.voidspace.org.uk/blog
>
>
>
>
> ------------------------------------------------------------------------------
> OpenSolaris 2009.06 is a cutting edge operating system for enterprises
> looking to deploy the next generation of Solaris that includes the latest
> innovations from Sun and the OpenSource community. Download a copy and
> enjoy capabilities such as Networking, Storage and Virtualization.
> Go to: http://p.sf.net/sfu/opensolaris-get
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
|