Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "André Erdmann" <dywi@...>
Subject: proj/R_overlay:master commit in: roverlay/config/
Date: Mon, 25 Jun 2012 18:19:48 +0000 (UTC)
commit:     3608ce9e8abe2412f2cf032b1e22c1a3be8aee2a
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Jun 25 18:05:17 2012 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Mon Jun 25 18:05:17 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=3608ce9e

fix _tree_to_str() in ConfigTree

	modified:   roverlay/config/tree.py

---
 roverlay/config/tree.py |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/roverlay/config/tree.py b/roverlay/config/tree.py
index 707aa8a..adcdcde 100644
--- a/roverlay/config/tree.py
+++ b/roverlay/config/tree.py
@@ -189,13 +189,17 @@ class ConfigTree ( object ):
 		var_indent =  indent + '* '
 		if root is None:
 			return "%s%s is unset\n" % ( var_indent, name )
-		elif len ( root ) == 0:
-			return "%s%s is empty\n" % ( var_indent, name )
 		elif isinstance ( root, dict ):
-			extra = ''.join ( [
-				self._tree_to_str ( n, r, level+1 ) for r, n in root.items()
-			] )
-			return "%s%s {\n%s%s}\n" % ( indent, name, extra, indent )
+			if len ( root ) == 0:
+				return "%s%s is empty\n" % ( var_indent, name )
+			else:
+				extra = ''.join ( [
+					self._tree_to_str ( n, r, level+1 ) for r, n in root.items()
+				] )
+				return "%s%s {\n%s%s}\n" % ( indent, name, extra, indent )
+		elif level == 1:
+			# non-nested config entry
+			return "\n%s%s = '%s'\n\n" % ( var_indent, name, root )
 		else:
 			return "%s%s = '%s'\n" % ( var_indent, name, root )
 	# --- end of _tree_to_str (...) ---


Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
proj/R_overlay:master commit in: roverlay/config/
Next by thread:
proj/R_overlay:master commit in: roverlay/config/
Previous by date:
proj/R_overlay:master commit in: roverlay/remote/
Next by date:
proj/R_overlay:master commit in: roverlay/


Updated Jun 26, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.