← Back to team overview

configglue team mailing list archive

Re: [Bug 690670] [NEW] Please provide a way to validate arbitrarily named sections

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi James,

thank you for your interest in configglue. Right now, what you ask is
not supported. However, if you give me some time I may be able to
implement something for this use case.


On 12/15/2010 11:36 AM, James Westby wrote:
> """
> [hwpack]
> name = foo
> architectures = bar
> 
> [ubuntu]
> sources-entry=http://archive.ubuntu.com/
> 
> [linaro]
> sources-entry=http://ppa.launchpad.net/linaro
> """
> 
> where "hwpack" is always required, and the other sections are up to the
> user to choose.


Regarding the optional sections, the section names are dynamic, or are
they known beforehand? (ie, do we know all potential section names, or
anything can be a section?)

>
> I don't know how this would link with the command line, but I don't
have a requirement to
> override these sections from the command line at this time.


For the integration with the command line, ideally this will behave like
any other section/option, ie.

- --section_option=value


Ricardo


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0J8SkACgkQaHF+Qaymu6dMtQCaAh3O4VVHWGWkpeFsy1LHKbgR
POoAoIdJ/gnGRE2QlvOIMja6hy3QDGL3
=e870
-----END PGP SIGNATURE-----

-- 
You received this bug notification because you are a member of
Configglue developers, which is the registrant for configglue.
https://bugs.launchpad.net/bugs/690670

Title:
  Please provide a way to validate arbitrarily named sections

Status in configglue:
  New

Bug description:
  Hi,

I have a use for configglue, but it doesn't yet meet all the criteria.

I have a config file that looks like

"""
[hwpack]
name = foo
architectures = bar

[ubuntu]
sources-entry=http://archive.ubuntu.com/

[linaro]
sources-entry=http://ppa.launchpad.net/linaro
"""

where "hwpack" is always required, and the other sections are up to the user to choose.

Therefore I want to be able to validate this. I can deal with the "hwpack" section fine, but
I can't currently validate the other sections. I would like to be able to define an "other"
validator, that is used to validate any section not explicitly named.

Michael said that ConfigObj can do this with __many__.

I don't know how this would link with the command line, but I don't have a requirement to
override these sections from the command line at this time.

Thanks,

James





Follow ups

References