Go to the documentation of this file.00001 """
00002 .. module:: clean1
00003
00004 This Python module should pass ``pylint`` cleanly.
00005
00006 """
00007
00008 def get(msg, key):
00009 """ Get property value.
00010
00011 :param msg: Message containing properties.
00012 :param key: Property key to match.
00013
00014 :returns: Corresponding value, if defined; None otherwise.
00015 Beware: the value may be '', which evaluates False as a
00016 predicate, use ``is not None`` to test for presence.
00017 """
00018 for prop in msg.props:
00019 if prop.key == key:
00020 return prop.value
00021 return None