'Return a specified server preference.
Parameters required:    pref { name of preference }
Output: string'

def get_server_pref(self, pref=None):

    if pref:
        prefs = self.get_server_prefs(output_format='xml')
        try:
            xml_head = prefs.getElementsByTagName('Setting')
        except Exception as e:
            logger.warn((u'PlexPy    Pmsconnect    ::    Unable    to    parse    XML    for    get_local_server_name:    %s.' % e))
            return ''
        pref_value = 'None'
        for a in xml_head:
            if (helpers.get_xml_attr(a, 'id') == pref):
                pref_value = helpers.get_xml_attr(a, 'value')
                break
        return pref_value
    else:
        logger.debug(u'PlexPy    Pmsconnect    ::    Server    preferences    queried    but    no    parameter    received.')
        return None
