1.1 --- a/imiptools/content.py Sun Jan 25 00:18:48 2015 +0100
1.2 +++ b/imiptools/content.py Sun Jan 25 00:29:40 2015 +0100
1.3 @@ -42,15 +42,18 @@
1.4 """
1.5 Get all items from 'd' with the given 'name', returning single items if
1.6 'all' is specified and set to a false value and if only one value is
1.7 - present for the name. Return None if no items are found for the name.
1.8 + present for the name. Return None if no items are found for the name or if
1.9 + many items are found but 'all' is set to a false value.
1.10 """
1.11
1.12 if d.has_key(name):
1.13 values = d[name]
1.14 - if not all and len(values) == 1:
1.15 + if all:
1.16 + return values
1.17 + elif len(values) == 1:
1.18 return values[0]
1.19 else:
1.20 - return values
1.21 + return None
1.22 else:
1.23 return None
1.24