public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/config/
Date: Sun, 30 Jun 2013 15:58:11 +0000 (UTC)	[thread overview]
Message-ID: <1372267347.84f3fafe99ee9e291ef09cd4b9ea0c8ec933a45b.dywi@gentoo> (raw)

commit:     84f3fafe99ee9e291ef09cd4b9ea0c8ec933a45b
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jun 26 17:22:27 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jun 26 17:22:27 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=84f3fafe

roverlay/config/tree, visualize(): sort entries

---
 roverlay/config/tree.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/roverlay/config/tree.py b/roverlay/config/tree.py
index 3466889..4be20c1 100644
--- a/roverlay/config/tree.py
+++ b/roverlay/config/tree.py
@@ -252,12 +252,15 @@ class ConfigTree ( object ):
             return "{}{} is empty\n".format ( var_indent, name )
          else:
             extra = ''.join ( [
-               self._tree_to_str ( n, r, level+1 ) for r, n in root.items()
+               self._tree_to_str ( n, r, level+1 ) for r, n in sorted (
+                  root.items(),
+                  key=lambda e: ( isinstance ( e[1], dict ), e[0] )
+               )
             ] )
-            return "{i}{} {{\n{}{i}}}\n".format ( name, extra, i=indent )
-      elif level == 1:
-         # non-nested config entry
-         return "\n{}{} = {!r}\n\n".format ( var_indent, name, root )
+            return "{i}{n} {{\n{e}{i}}}\n".format ( n=name, e=extra, i=indent )
+#      elif level == 1:
+#         # non-nested config entry
+#         return "\n{}{} = {!r}\n".format ( var_indent, name, root )
       else:
          return "{}{} = {!r}\n".format ( var_indent, name, root )
    # --- end of _tree_to_str (...) ---


WARNING: multiple messages have this Message-ID (diff)
From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:gsoc13/next commit in: roverlay/config/
Date: Wed, 26 Jun 2013 17:29:24 +0000 (UTC)	[thread overview]
Message-ID: <1372267347.84f3fafe99ee9e291ef09cd4b9ea0c8ec933a45b.dywi@gentoo> (raw)
Message-ID: <20130626172924.azoy15fRhjYnBtCkRtzLS_Fz4-fVhsUb8c9ZD7xVohw@z> (raw)

commit:     84f3fafe99ee9e291ef09cd4b9ea0c8ec933a45b
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jun 26 17:22:27 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jun 26 17:22:27 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=84f3fafe

roverlay/config/tree, visualize(): sort entries

---
 roverlay/config/tree.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/roverlay/config/tree.py b/roverlay/config/tree.py
index 3466889..4be20c1 100644
--- a/roverlay/config/tree.py
+++ b/roverlay/config/tree.py
@@ -252,12 +252,15 @@ class ConfigTree ( object ):
             return "{}{} is empty\n".format ( var_indent, name )
          else:
             extra = ''.join ( [
-               self._tree_to_str ( n, r, level+1 ) for r, n in root.items()
+               self._tree_to_str ( n, r, level+1 ) for r, n in sorted (
+                  root.items(),
+                  key=lambda e: ( isinstance ( e[1], dict ), e[0] )
+               )
             ] )
-            return "{i}{} {{\n{}{i}}}\n".format ( name, extra, i=indent )
-      elif level == 1:
-         # non-nested config entry
-         return "\n{}{} = {!r}\n\n".format ( var_indent, name, root )
+            return "{i}{n} {{\n{e}{i}}}\n".format ( n=name, e=extra, i=indent )
+#      elif level == 1:
+#         # non-nested config entry
+#         return "\n{}{} = {!r}\n".format ( var_indent, name, root )
       else:
          return "{}{} = {!r}\n".format ( var_indent, name, root )
    # --- end of _tree_to_str (...) ---


             reply	other threads:[~2013-06-30 15:58 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-30 15:58 André Erdmann [this message]
2013-06-26 17:29 ` [gentoo-commits] proj/R_overlay:gsoc13/next commit in: roverlay/config/ André Erdmann
  -- strict thread matches above, loose matches on Subject: below --
2018-05-30  5:31 [gentoo-commits] proj/R_overlay:master " Benda XU
2018-05-28  8:41 Benda XU
2014-08-23 19:03 André Erdmann
2014-08-23 19:03 André Erdmann
2014-04-01 16:38 André Erdmann
2014-04-01 16:38 André Erdmann
2014-04-01 16:38 André Erdmann
2014-01-26 19:06 André Erdmann
2013-09-13 15:10 André Erdmann
2013-09-11 11:14 André Erdmann
2013-09-11 10:30 André Erdmann
2013-09-11 10:27 André Erdmann
2013-09-11 10:27 André Erdmann
2013-09-10 14:40 André Erdmann
2013-09-10 14:40 André Erdmann
2013-09-06 17:27 André Erdmann
2013-09-04 10:16 André Erdmann
2013-08-14 14:56 André Erdmann
2013-08-12  8:18 André Erdmann
2013-08-09 15:27 André Erdmann
2013-08-09 15:27 André Erdmann
2013-08-06 10:58 André Erdmann
2013-08-05 11:44 André Erdmann
2013-08-02 13:39 André Erdmann
2013-07-30 18:40 André Erdmann
2013-07-29 14:56 André Erdmann
2013-07-24 17:45 André Erdmann
2013-07-16 16:36 André Erdmann
2013-07-12 13:57 André Erdmann
2013-07-12 13:57 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-07-12 13:57 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-07-11 16:29 André Erdmann
2013-07-10 15:10 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-07-10 16:16 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-06-19 18:59 André Erdmann
2013-06-13 16:34 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-06-18 14:12 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-06-04 21:06 André Erdmann
2013-02-09 20:45 André Erdmann
2013-02-09 20:45 André Erdmann
2013-02-09 20:45 André Erdmann
2013-01-28 23:54 André Erdmann
2013-01-28 23:54 André Erdmann
2012-08-09  9:26 André Erdmann
2012-08-08 23:46 André Erdmann
2012-08-02 15:14 André Erdmann
2012-08-01 21:10 André Erdmann
2012-07-11 18:43 André Erdmann
2012-07-06 22:19 André Erdmann
2012-07-06 22:19 André Erdmann
2012-07-05 16:00 André Erdmann
2012-07-03 17:48 André Erdmann
2012-06-29 22:48 André Erdmann
2012-06-26 15:42 André Erdmann
2012-06-25 18:19 André Erdmann
2012-06-25 18:19 André Erdmann

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=1372267347.84f3fafe99ee9e291ef09cd4b9ea0c8ec933a45b.dywi@gentoo \
    --to=dywi@mailerd.de \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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