Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mariano Lopez <mariano.lopez@linux.intel.com>
To: Markus Lehtonen <markus.lehtonen@linux.intel.com>,
	openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 7/8] oeqa.utils.metadata: have layer name as an attribute in xml
Date: Wed, 4 Jan 2017 09:43:05 -0600	[thread overview]
Message-ID: <23139570-1257-66eb-482c-e2f438a11976@linux.intel.com> (raw)
In-Reply-To: <1482930164-15721-8-git-send-email-markus.lehtonen@linux.intel.com>



On 28/12/16 07:02, Markus Lehtonen wrote:
> -def dict_to_XML(tag, dictionary):
> +def dict_to_XML(tag, dictionary, **kwargs):
>      """ Return XML element converting dicts recursively. """
>  
> -    elem = Element(tag)
> +    elem = Element(tag, **kwargs)
>      for key, val in dictionary.items():
> -        if isinstance(val, MutableMapping):
> +        if tag == 'layers':
> +            child = (dict_to_XML('layer', val, name=key))
> +        elif isinstance(val, MutableMapping):
>              child = (dict_to_XML(key, val))
>          else:
>              child = Element(key)

I was thinking that this function would be more generic, adding a
comparison to a tag name surely won't keep the function generic, is
there another way to implement this keeping this function generic enough?


  reply	other threads:[~2017-01-04 15:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-28 13:02 [PATCH 0/8] oeqa.utils.metadata: update xml schema Markus Lehtonen
2016-12-28 13:02 ` [PATCH 1/8] oeqa.utils.metadata: re-organise host distro information Markus Lehtonen
2016-12-28 13:02 ` [PATCH 2/8] oeqa.utils.metadata: re-organise " Markus Lehtonen
2016-12-28 13:02 ` [PATCH 3/8] oeqa.utils.metadata: drop 'unknown' git data elements Markus Lehtonen
2017-01-04 15:30   ` Mariano Lopez
2017-01-05  9:19     ` Markus Lehtonen
2016-12-28 13:02 ` [PATCH 4/8] oeqa.utils.metadata: fix retrieval of git branch and revision Markus Lehtonen
2016-12-28 13:02 ` [PATCH 5/8] oeqa.utils.metadata: rename 'revision' to 'commit' Markus Lehtonen
2016-12-28 13:02 ` [PATCH 6/8] oeqa.utils.metadata: add commit count information Markus Lehtonen
2016-12-28 13:02 ` [PATCH 7/8] oeqa.utils.metadata: have layer name as an attribute in xml Markus Lehtonen
2017-01-04 15:43   ` Mariano Lopez [this message]
2017-01-05  9:35     ` Markus Lehtonen
2016-12-28 13:02 ` [PATCH 8/8] oeqa.utils.metadata: add bitbake revision information Markus Lehtonen
2017-01-04 15:45   ` Mariano Lopez
2017-01-05  9:40     ` Markus Lehtonen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23139570-1257-66eb-482c-e2f438a11976@linux.intel.com \
    --to=mariano.lopez@linux.intel.com \
    --cc=markus.lehtonen@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox