'Sets properties and text of this info from a dictionary'

def setProperties(self, properties):

    if isinstance(properties, dict):
        self.properties = properties
        list = []
        result = ''
        for key in properties:
            value = properties[key]
            if (value is None):
                suffix = ''
            elif isinstance(value, str):
                suffix = value
            elif isinstance(value, int):
                suffix = ((value and 'true') or 'false')
            else:
                suffix = ''
            list.append('='.join((key, suffix)))
        for item in list:
            result = ''.join((result, struct.pack('!c', chr(len(item))), item))
        self.text = result
    else:
        self.text = properties
