diff options
author | Petr Šplíchal <psplicha@redhat.com> | 2012-02-16 13:21:50 +0100 |
---|---|---|
committer | Petr Šplíchal <psplicha@redhat.com> | 2012-02-29 11:27:57 +0100 |
commit | 9f1d5efd31893d670a0f43201f111c44766b20be (patch) | |
tree | b779a250e0ba2b10c4609c75dadc319ad0c22488 /source/api.py | |
parent | 4a90568a98a0698bb2cad57b8e17effb7abaa124 (diff) | |
download | python-nitrate-9f1d5efd31893d670a0f43201f111c44766b20be.tar.gz python-nitrate-9f1d5efd31893d670a0f43201f111c44766b20be.tar.xz python-nitrate-9f1d5efd31893d670a0f43201f111c44766b20be.zip |
Report [None] when no components linked
Diffstat (limited to 'source/api.py')
-rw-r--r-- | source/api.py | 5 |
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 |