← Back to team overview

configglue team mailing list archive

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

 

Hi,

just wanted to know if there was anything else I can do regarding this
issue, before closing it.

For your reported use case, you can use configglue as stated in the last
comment. In order to iterate over the different sections, you can just
get the value for the repos option, and iterate over all the items
listed there.

This will give you your desired behaviour with the added benefit of not
allowing unexpected data in the config file (thus, catching typos).

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

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/configglue/+bug/690670/+subscriptions


Follow ups

References