summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Šplíchal <psplicha@redhat.com>2012-02-16 13:21:50 +0100
committerPetr Šplíchal <psplicha@redhat.com>2012-02-29 11:27:57 +0100
commit9f1d5efd31893d670a0f43201f111c44766b20be (patch)
treeb779a250e0ba2b10c4609c75dadc319ad0c22488
parent4a90568a98a0698bb2cad57b8e17effb7abaa124 (diff)
downloadpython-nitrate-9f1d5efd31893d670a0f43201f111c44766b20be.zip
python-nitrate-9f1d5efd31893d670a0f43201f111c44766b20be.tar.gz
python-nitrate-9f1d5efd31893d670a0f43201f111c44766b20be.tar.xz
Report [None] when no components linked
-rw-r--r--source/api.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/api.py b/source/api.py
index 7fbf1c7..1c7ef08 100644
--- a/source/api.py
+++ b/source/api.py
@@ -1630,7 +1630,10 @@ class Components(Container):
def __unicode__(self):
""" The list of linked components' names """
- return listed(sorted([component.name for component in self]))
+ if self._items:
+ return listed(sorted([component.name for component in self]))
+ else:
+ return "[None]"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Components Methods